Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Best on Thu 31/07/2003 21:36:27

Title: Problems with picking up the object
Post by: Best on Thu 31/07/2003 21:36:27
I have a problem in my game. I cannot pick up certain object. I set Movecharactertoobject in script and it is working, but now, when I want to pick up the object, the game just show me watches icon and freeze.

Can U help me please?
Title: Re:Problems with picking up the object
Post by: Jimi on Thu 31/07/2003 22:01:49
can you post a script?
Title: Re:Problems with picking up the object
Post by: Best on Thu 31/07/2003 23:23:01
the script is:
// room script file
//MoveCharactertoObject (JACK, 2)
//ObjectOff (2)
//AddInventory (3)
Title: Re:Problems with picking up the object
Post by: Gilbert on Fri 01/08/2003 02:35:26
Is it completely copied from your script? In that case, you should add semicolons to end of each line (and remove those commenting //'s of course for them to work):

// room script file
MoveCharactertoObject (JACK, 2);
ObjectOff (2);
AddInventory (3);
Title: Re:Problems with picking up the object
Post by: TerranRich on Fri 01/08/2003 06:00:04
And make sure it's capitalized as such: MoveCharacterToObject(...);
Title: Re:Problems with picking up the object
Post by: Best on Fri 01/08/2003 09:40:29
No, sorry!

Nothin is working. I added the semicolons, but f I delete this "//" in my script, it will not save the game so I cannot test it. I move character next to the object, than klick to pick it up and it show me just the watches. I can move with the cursor, but the main panel menu is inactive and after a while my character just make a move like he is walking, but without any move from the position he is standing at.
I think this wont work, but thanks anyway...
Title: Re:Problems with picking up the object
Post by: Ishmael on Fri 01/08/2003 13:34:35
Then why dont you tell us what AGS tells you as reason not to save your game? "Nested functions not supported"? "Undifined token"? ;)
Title: Re:Problems with picking up the object
Post by: Best on Fri 01/08/2003 15:08:06
Parse error: unexpected Script
Title: Re:Problems with picking up the object
Post by: Ishmael on Fri 01/08/2003 16:05:46
Post the whole room script; not just the single function... or is that all? if yes, then you've gut a little problem there... there aint any funcitons to run in that case...

[offtopic]You have listened to Bonney M? :)[/offtopic]
Title: Re:Problems with picking up the object
Post by: Best on Fri 01/08/2003 17:28:54
Ok, sorry, Im just t beginner...

The whole script is:

// room script file

//MoveCharacterToObject (JACK, 2)
//AnimateCharacter (JACK, 4, 5, 0);
//ObjectOff (2);
//AddInventory (3);

Mebbe if you will write how you r doin tis´ it will help me...

Ok thanks anyway...
Title: Re:Problems with picking up the object
Post by: Timosity on Sat 02/08/2003 05:51:40
You can't have the comment's // before a line of code, the whole point of them is so you can write anything without it being part of the code.

eg.

// this part of the script is a comment for you so you know what is happening in this part of the script.

You probably need to put the script in a different place, not at the start of the room script.

if you are using a hotspot you need to put the script in the interaction for that hotspot, or if it's an object you need to put it in the interaction for that object.

Hope that helps, if you need more detailed explanations, just ask

~Tim
Title: Re:Problems with picking up the object
Post by: Best on Sat 02/08/2003 10:59:29
Thank you very much, Ill try that.