NPC move [Solved]

Started by limeyman1992, Mon 28/06/2010 13:48:01

Previous topic - Next topic

limeyman1992

After a non-player character exchanges dialog with the player, I want him to leave the room. Please could someone tell me the script needed and where it needs to be posted?

barefoot

#1
Hi

Simply add this to your Room script after the talking:


Code: ags

cEgo.ChangeRoom(30,100,240);


Change cEgo to the NPC name. Move him to Room 30 at 100x and 240y coordinates or wherever room and coordinates you want..

If you are using a Dialog Option then you must indent the text after the Option that applies(that is a space before adding above script)

-barefoot-
I May Not Be Perfect but I Have A Big Heart ..

Khris

Placing this in the room script won't work since a dialog isn't run until the very end of a function and therefore the NPC will leave the room before the dialog starts.
But, as barefoot mentions, you can use standard scripting inside dialog scripts if you put a blank space before the command.

SMF spam blocked by CleanTalk