Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 24/08/2003 18:13:11

Title: Moving an NPC to a room with X,Y values
Post by: on Sun 24/08/2003 18:13:11
I want to move an NPC to a room, so I use the "Move NPC To a Different Room" interaction, but, of course, it moves the NPC into the middle of the room instead the area I want it in. How do I set the x and y values? (Sorry if this was covered in a tutorial, manual, etc., but I looked and couldn't find it. I may have overlooked it.)

--42
Title: Re:Moving an NPC to a room with X,Y values
Post by: Archangel (aka SoupDragon) on Sun 24/08/2003 18:43:26
Oh dear oh dear oh dear. I suggest you look just a teensey bit harder :)
Title: Re:Moving an NPC to a room with X,Y values
Post by: on Sun 24/08/2003 18:56:57
Right-o!
Title: Re:Moving an NPC to a room with X,Y values
Post by: on Sun 24/08/2003 20:30:30
Nope, can't find it. And before you ask, yes, I am an idiot.
Title: Re:Moving an NPC to a room with X,Y values
Post by: Archangel (aka SoupDragon) on Sun 24/08/2003 20:39:21
Ok, use this code:

character[CHARID].room = a;
character[CHARID].x = b;
character[CHARID].y = c;

To be fair, that is in a kindof poorly documented part of the help file. Look up "character[], variables" in the index.

If you're moving the player character, then of course you'd use NewRoomEx().