Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: andwii on Sat 22/07/2006 23:30:50

Title: how to program your person to go to the second room
Post by: andwii on Sat 22/07/2006 23:30:50
Hi, I just finished the noob tutorial, now i am trying to let my person to go to a new room. I have allready made the rom and set the walkable areas, but how do I get the guy go from the first room the the second room ??? ??? ???


Title: Re: how to program your person to go to the second room
Post by: KristjanMan on Sun 23/07/2006 00:02:53
In your room menu there are yellow lines that you can move :
(http://www.2dadventure.com/ags/yellow_lines3589275643758371.PNG)
then in the interaction screen there are these things :
(http://www.2dadventure.com/ags/interaction132479836587321.PNG)
click one of them and choose :
(http://www.2dadventure.com/ags/room3174627846243572354785263.PNG)
Title: Re: how to program your person to go to the second room
Post by: Mr_Threepwood on Sun 23/07/2006 00:11:12
There are many ways to make your character leave the room, the one Kristjan posted is probably the easiest if you are a beginner.  If you have programming experience you might have an easier time just diving into the script and figuring it out that way (it's very similar to java or c++).   In the script it's just characterScriptName.ChangeRoom(roomnum,x,y)

So for example:

cEgo.ChangeRoom(2,10,50);

Would take the character with the script name "cEgo" to room to at coordinates 10,50.

I find diving into the script gives you more control over your game, but if you're not used to programming do it the easy way, then look at how it's doing it in the script.
Title: Re: how to program your person to go to the second room
Post by: andwii on Sun 23/07/2006 01:40:10
see I dont get what KristjanMan said. I put everything he had into ags. it did not work.

this is what I mean...

this is room 1

(http://i76.photobucket.com/albums/j30/andwii/forms.jpg)

room 2

(http://i76.photobucket.com/albums/j30/andwii/forms2.jpg)

could someone help me in step by step on my issue... ??? ??? ???
Title: Re: how to program your person to go to the second room
Post by: Jonez on Sun 23/07/2006 11:05:20
> click 'interactions'(ctrl I) on room1. (At Room editor > Settings-screen)
> double-click 'Walk off left screen edge' (a pop-up appears)
> Double-click 'Do nothing', another window appears.
> From the pop-up-menu choose 'Player - go to a different room (at specific co-ordinates)
> Change New room number (from 'value') to '2'
> change the X Co-ordinate to the value you want (the player appears to this co-ordinate)
> Do the same with the Y co-ordinate.
(You get the right co-ordinates from the Room Editor > Settings- / Areas- / Objects-screen. The Mouse pos shows the mouses co-ordinates on screen)
Title: Re: how to program your person to go to the second room
Post by: sven on Sun 23/07/2006 14:44:08
If you don't want to let your character walk off the screen edge but rather transport him to another room from somewhere in the middle of the room (if, for example, the first room shows a wall with a doorway in the middle and you want the character to walk through the door to the second room), you would use regions. This is also very easy: in your first room, go to "areas" (where you defined walkable areas etc), and in the selection box in the upper left (where you can select walkable areas, hotspots etc), select "regions". Now, draw a region in front of the door (the same way you created walkable areas). Then click on "interaction", select "player walks onto region", and from there on proceed as Jonez described above.
Title: Re: how to program your person to go to the second room
Post by: andwii on Sun 23/07/2006 16:32:54
thank you  ;D ;D ;D ;D It worked... well 3rd times the charm. ;D thank you...