Game Development Community

Error with Chapter 4 on my end

by Michael Branin · in Torque Game Engine · 03/01/2006 (8:15 am) · 1 replies

Wondering if anyone can help out here I keep getting this error in my console.log and not sure what I am doing wrong.

//-------------------------- 3/1/2006 -- 10:13:40 -----
Loading compiled script common/main.cs.
Loading compiled script common/presets.cs.
*** Activating common package ***
Loading compiled script control/main.cs.
--------- Loading Add-ons ---------
Engine initialization complete.

--------- Initializing module: Common ---------
Loading compiled script common/client/canvas.cs.
Loading compiled script common/client/audio.cs.

---------- Initializing control module ------------
Loading compiled script control/initialize.cs.

---------- Initializing module: emaga server -----------------
Loading compiled script common/server/audio.cs.
Loading compiled script common/server/server.cs.
Loading compiled script common/server/message.cs.
Loading compiled script common/server/commands.cs.
Loading compiled script common/server/missionInfo.cs.
Loading compiled script common/server/missionLoad.cs.
Loading compiled script common/server/missionDownload.cs.
Loading compiled script common/server/clientConnection.cs.
Loading compiled script common/server/game.cs.
Loading compiled script control/server.cs.
Compiling control/player.cs...
control/player.cs Line: 9 - Syntax error.
>>> Advanced script error report. Line 17.
>>> Some error context, with ## on sides of error halt:
//------------------------------------------------------------------------



dataBlock PlayerData(##H##umanMaleAvatar)

{

^className = Avatar;

^shapeFile = "~/player.dts";
>>> Error report complete.

Executing control/player.cs.
control/player.cs Line: 9 - Syntax error.
>>> Advanced script error report. Line 17.
>>> Some error context, with ## on sides of error halt:
//------------------------------------------------------------------------



dataBlock PlayerData(##H##umanMaleAvatar)

{

^className = Avatar;

^shapeFile = "~/player.dts";
>>> Error report complete.

*** LOADING MISSION: control/data/maps/book_ch4.mis
*** Stage 1 load
*** Stage 2 load
Executing control/data/maps/book_ch4.mis.
*** Mission loaded

---------- Initializing module: emaga client -----------------
Loading compiled script common/client/message.cs.
Loading compiled script common/client/mission.cs.
Loading compiled script common/client/missionDownload.cs.
Loading compiled script common/client/actionMap.cs.
Loading compiled script common/editor/editor.cs.
Video Init:
Accelerated OpenGL display device detected.
Accelerated D3D device detected.
Voodoo 2 display device not detected.

Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 800x600x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: NVIDIA Corporation
Renderer: GeForce 6600/AGP/SSE2
Version: 2.0.1
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 4)
EXT_compiled_vertex_array
NV_vertex_array_range
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16.000000)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
3DFX_texture_compression_FXT1
NPatch tessellation

Loading compiled script common/ui/defaultProfiles.cs.
Loading compiled script common/ui/GuiEditorGui.gui.
Loading compiled script common/ui/ConsoleDlg.gui.
Loading compiled script common/ui/InspectDlg.gui.
Loading compiled script common/ui/InspectAddFieldDlg.gui.
Loading compiled script common/ui/LoadFileDlg.gui.
Loading compiled script common/ui/SaveFileDlg.gui.
Loading compiled script common/ui/MessageBoxOkDlg.gui.
Loading compiled script common/ui/MessageBoxYesNoDlg.gui.
Loading compiled script common/ui/MessageBoxOKCancelDlg.gui.
Loading compiled script common/ui/MessagePopupDlg.gui.
Loading compiled script common/ui/HelpDlg.gui.
Loading compiled script common/ui/RecordingsDlg.gui.
Loading compiled script common/client/metrics.cs.
Loading compiled script common/ui/FrameOverlayGui.gui.
Loading compiled script common/client/messageBox.cs.
Loading compiled script common/client/screenshot.cs.
Loading compiled script common/client/cursor.cs.
Loading compiled script common/client/help.cs.
Loading compiled script common/client/recordings.cs.

OpenAL Driver Init:

Loading compiled script control/client.cs.
Connect request from:
Connection established 1206
CADD: 1207 local
*** Sending mission load to client: control/data/maps/book_ch4.mis
Mapping string: ServerMessage to index: 0
Mapping string: MsgConnectionError to index: 1
Mapping string: MsgLoadInfo to index: 2
Mapping string: MsgLoadDescripition to index: 3
Mapping string: MsgLoadInfoDone to index: 4
Mapping string: MsgClientJoin to index: 5
Mapping string: Welcome to Emaga4 %1. to index: 6
Mapping string: Poser to index: 7
Mapping string: MissiOnStartPhase1 to index: 8
*** New Mission: control/data/maps/book_ch4.mis
*** Phase 1: Download Datablocks & Targets
Mapping string: MissionStartPhase1Ack to index: 0
Mapping string: MissiOnStartPhase2 to index: 9
*** Phase 2: Download Ghost Objects
Mapping string: MissionStartPhase2Ack to index: 1
Ghost Always objects received.
Mapping string: MissiOnStartPhase3 to index: 10
Client Replication Startup has Happened!
fxFoliageReplicator - Client Foliage Replication Startup is complete.
*** Phase 3: Mission Lighting
Successfully loaded mission lighting file: 'control/data/maps/book_ch4_c1eb4cc2.ml'
Mission lighting done
Mapping string: MissionStartPhase3Ack to index: 2
Object 'HumanMaleAvatar' is not a member of the 'GameBaseData' data block class
control/server.cs (56): Register object failed for object (null) of class Player.
control/server.cs (59): Unable to find object: '0' attempting to call function 'setTransform'



Now here is my player.cs as typed from the book

//------------------------------------------------------------------------
// control/player.cs
//
// player definition module for 3DGPAI1 emaga4 sample game
//
// Copyright (c) 2003 by Kenneth C. Finney.
//------------------------------------------------------------------------

dataBlock PlayerData(HumanMaleAvatar)
{
className = Avatar;
shapeFile = "~/player.dts";
emap = true;
renderFirstPerson = false;
cameraMaxDist = 4;
mass = 100;
density = 10;
drag = 0.1;
maxdrag = 0.5;
maxEnergy = 100;
maxDamage = 100;
maxForwardSpeed = 15;
maxBackwardSpeed = 10;
maxSideSpeed = 12;
minJumpSpeed = 20;
maxJumpSpeed = 30;
runForce = 4000;
jumpForce = 1000;
runSurfaceAngle = 70;
jumpSurfaceAngle = 80;
};

//------------------------------------------------------------------------
// Avatar Datablock methods
//------------------------------------------------------------------------

function Avatar::onAdd(%this,%obj)
{
}

function Avatar::onRemove(%this,%obj)
{
if (%obj.client.player == %obj)
%obj.client.player = 0;
}

#1
03/01/2006 (7:00 pm)
Have you looked at the cd to find the resources folder?
The book has a bunch of typos and several files and code that get loaded later. I was on chapter 6 before I had code that actually did anything. (and had to use the exe to get it. The book code didn't work)
Your code looks identicle to mine, so I'd say the error is comming from elsewhere.
With this book, patience is the key. By the time you finish this book, you will know how to fix all of Mr. Finneys mistakes.