Moving NPC to a different room with specific coordinates

Started by guybrush, Fri 24/06/2005 18:38:14

Previous topic - Next topic

guybrush

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!
SPY FUNCTION-- My first game
C O M I N G   S O O N !

strazer

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:
Code: ags

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


For AGS v2.7:
Code: ags

  cFbicar.ChangeRoom(9, 20, 110);

guybrush

SPY FUNCTION-- My first game
C O M I N G   S O O N !

SMF spam blocked by CleanTalk