Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: nuksies on Thu 14/02/2008 19:06:21

Title: Changing Rooms
Post by: nuksies on Thu 14/02/2008 19:06:21
How do you script a room change if the character clicks a hotspot or walks on a hotspot or goes over the edge.

I've just started using AGS and i have no clue so sorry if its REALLY obvious!!!
Title: Re: Changing Rooms
Post by: GarageGothic on Thu 14/02/2008 19:19:40
Did you even check the manual? The function you need is Character.ChangeRoom(int room_number, optional int x, optional int y)
Title: Re: Changing Rooms
Post by: nuksies on Thu 14/02/2008 22:42:37
told you it would be a REALLY obvious answer but i search everywhere on the internet for it
Thanks a lot
Title: Re: Changing Rooms
Post by: Khris on Fri 15/02/2008 03:02:48
Don't search the internet but open the help file (by pressing F1). Then start with the tutorial.
Title: Re: Changing Rooms
Post by: Dualnames on Fri 15/02/2008 08:35:13
Select that hotspot you want and open interactions. Right click on player stands on hotspot and select new run script function then add the line:
NewRoomEx(2,150,150);

//2 is the where  the character will go to and 150 150 is x,y coordinates.
Title: Re: Changing Rooms
Post by: Khris on Fri 15/02/2008 11:25:24
That's old code, which is obsolete since 2.7. Using "stand on hotspot" is also obsolete, it's better to use regions.
Title: Re: Changing Rooms
Post by: .M.M. on Fri 15/02/2008 15:05:24
And there is no interaction editor in AGS 3.0, also.
Title: Re: Changing Rooms
Post by: Dualnames on Sat 16/02/2008 21:29:57
Okay, forgot that obsolete thing... Good job pointing out. I assumed you were using AGS 2.72
Title: Re: Changing Rooms
Post by: BOYD1981 on Sat 16/02/2008 22:09:35
one thing worth remembering about using regions to change rooms is that you want to set the co-ords a few pixels to the outside of the region, i made that mistake a long time ago and my character just kept moving between the rooms and there was nothing i could do to stop it.