Object scripting? (object[1].IgnoreWalkbehinds = 1;)

Started by RoboPenguin, Sat 30/07/2005 13:07:42

Previous topic - Next topic

RoboPenguin

I found how to make objects ignore walkbehinds in the manual, but I'm having a bit of trouble putting it into the script.

I think the problem is that I'm not putting the line in the right place. I looked for any info in the manual but couldnt find any. When I try to run the game, I get the 'unexpected object' error.

So, my question is, where in the room script (if it's even in the room script) do I put the object[1].IgnoreWalkbehinds = 1; line?

strazer

Quote from: strazer on Wed 13/07/2005 20:58:27
The room script contains script for every event in this room. If you don't put the command in a function, how should AGS know when to execute it?

You first have to create the event function with the interaction editor.
Press the  "i" button, select when your command should be executed ("Player enters screen (before fadein)" for example), add a "Run script" action and press the "Edit script..." button. A window opens where you can put your command. Close and save.

Now press the "{}" button again and you will see that your command is encapsulated by the event function.
The "{}" button exists so you can quickly see and edit every script in this room and don't have to use the interaction editor every time to access the scripts.

RoboPenguin

Aha, thanks. Didn't realise it needed to know when to do that sort of stuff.

SMF spam blocked by CleanTalk