Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: CapinLaughing on Mon 29/10/2012 20:15:50

Title: How do u get hte player to move rooms in game
Post by: CapinLaughing on Mon 29/10/2012 20:15:50
Hey i am 13 years old and just got AGS because i want to be a game devopler when i am older but i can't get my guy to change rooms in  game
Title: Re: How do u get hte player to move rooms in game
Post by: Slasher on Mon 29/10/2012 20:40:06
Hi

when you want the player to change rooms just add

Example
Code (AGS) Select
player.ChangeRoom(2, 91, 272);

player would be the character who is your main player ie cEgo.

In Brackets:
2 is room number you want player to go to (could use any room), 91 (x) is distance from left and 272 (y) is distance from top where you want the player to appear in next room.

Take things very slowly and start to read the manual / search these forums / ask questions and learn from there.

Aim for basics first.

Good luck


Title: Re: How do u get hte player to move rooms in game
Post by: CapinLaughing on Tue 30/10/2012 19:26:32
do i put that in globle script of the room script
Title: Re: How do u get hte player to move rooms in game
Post by: Crimson Wizard on Tue 30/10/2012 19:47:39
Quote from: CapinLaughing on Tue 30/10/2012 19:26:32
do i put that in globle script of the room script
You put that at the point where your player should change the room. That doesn't matter what kind of script it is.

For example, if you want to make player change the room when crossing room's right edge, add a "Walks off right edge" event handler (the function will be called "room_LeaveRight" by default) and put player.ChangeRoom command there.

Event handlers, as well as basic information on scripting, are covered in AGS tutorial (you'll find one in Editor's manual), which I'd recommend for you to complete first, if you haven't done that already.