Game Development Community

Fish Game Turorial fish wont move

by Glen the boy · in Torque Game Builder · 04/15/2008 (6:00 pm) · 3 replies

Hi just downloaded 1.7 trial after seeing it highly recommended on a couple of gamedev forums and was very impressed with it, up to the point where i'm now stuck on only the 2nd tutorial. This doesn't bode well for me :(

Anyway i followed the tutorial through to setting up the movement behaviour script which i just copied and pasted and then saved in the correct folder. When i load up the project again i can select the script, i can attach it to the fish sprite and i can edit all the values associated with the script, but when i run it the fish wont move.

After getting lost in the forums for a while i finally found that there's a console so i open it to check and the problem is that there's an error in the script.

Now unfortunately the tutorial doesn't explain what any of the script is doing so i can't really figure out what the problem is, but it's a straight copy from the documentation and from my limited experience with C and Java i can't see any obvious syntax problems. So if anyone could help me with this i'd be so happy because i was really impressed with tgb. I thought i'd finally found my perfect gamedev environment.

Anyway here's the error (damn, can't copy from the console..)

C:/Documents and Settings/Administrator/My Documents/MyGames/fishfucker/game/behaviors/fishControls.cs Line: 24 - parse error
>>> Advanced script error report. Line 24.
>>> Some error context, with ## on sides of error halt:
function fishControlsBehavior::onBehaviorAdd(%this)

{

if (!isObject(moveMap))

return;



// bind our keys on the keyboard

moveMap.bindObj(getWordFieldManipulators::getWord(string text, int index)(%this.upKey, 0), getWord(%this.upKey, 1), "moveUp", %this);

## ## moveMap.bindObj(getWord(%this.downKey, 0), getWord(%this.downKey, 1), "moveDown", %this);

moveMap.bindObj(getWord(%this.leftKey, 0), getWord(%this.leftKey, 1), "moveLeft", %this);

moveMap.bindObj(getWord(%this.rightKey, 0), getWord(%this.rightKey, 1), "moveRight", %this);
>>> Error report complete.


So there we go. Please help me. I must be being really stupid cos no-one else has posted this problem, but for the life of me i can't figure out what's wrong. Thanks

About the author

Recent Threads


#1
04/17/2008 (10:50 am)
Can't seem to find an edit button so forgive the double post.

It seems i've been a silly chap and did the tutorials in the wrong order, the tut i did was in the behaviours section. Maybe this is an old remnant? Not entirely clear from the documentation and would have thought it should still work, but i can be incredibly stupid sometimes.

Anyway followed the correct tutorial progression as outlined in the introduction and am flying now. Excellent package. Well impressed.
#2
07/02/2008 (8:44 pm)
I have a question about the Fish Demo. I am assuming since you did the Fish Game Tutorial, that you finished the Fish Demo tutorial. The problem I am having is that the fish doesn't recognize it's own World Limit boundaries. I have the mode set to NULL and the Callbacks button checked. I triple checked the code from the tutorial and I made sure it was accurate. I even moved the World Limit bounding box into the level to see what the fish is doing when it hits the right side of the world limit. It goes right through it! Is anyone else having this issue?

Edit: I fixed the problem by changing the semi-colons to regular colons in the script where needed. Wow. You learn something new every day. I thought you ended every line with a semi-colon. It's easy to see how an inexperienced person could make this mistake. I'm leaving this here in case someone else makes the same mistake.
#3
07/03/2008 (1:13 am)
I used semi colons on the end of all of my statements, and it worked.