Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: guybrush on Fri 24/06/2005 18:38:14

Title: Moving NPC to a different room with specific coordinates
Post by: guybrush on Fri 24/06/2005 18:38:14
So, this is my problem;
I've got one FBI car and player character in room 8. So, i've made it all look like player goes in the car. And now, there's room 9, and in that room, that car should appear without player(he's in the car, right?). I did put "Hide player character" in room 9, and car appears in that room(used "move NPC to a diffrent room") , but he's not where it should be. I guess AGS randomly puts it in the middle of the room, but that's not where I want it. So, basicly, I need put NPC to a different room with specific coordinates.
Thanks on your help!
Title: Re: Moving NPC to a different room with specific coordinates
Post by: strazer on Fri 24/06/2005 19:37:40
I think there's no interaction editor action for moving NPCs to specific coordinates, only the player character. So you have to use script:

Instead of "Move NPC to a different room", choose the "Run script" action, click the "Edit script..." button and enter:

For AGS v2.62:

  NewRoomNPC(FBICAR, 9, 20, 110); // or whatever coordinates you want


For AGS v2.7:

  cFbicar.ChangeRoom(9, 20, 110);
Title: Re: Moving NPC to a different room with specific coordinates
Post by: guybrush on Sun 26/06/2005 11:41:23
Thanks a lot! It works. No more questions.