how to program your person to go to the second room

Started by andwii, Sat 22/07/2006 23:30:50

Previous topic - Next topic

andwii

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 ??? ??? ???



KristjanMan

In your room menu there are yellow lines that you can move :

then in the interaction screen there are these things :

click one of them and choose :
- They are all from AGS coloringball

Mr_Threepwood

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.
I am a mighty pirate

andwii

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



room 2



could someone help me in step by step on my issue... ??? ??? ???

Jonez

> 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)

sven

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.

andwii

thank you  ;D ;D ;D ;D It worked... well 3rd times the charm. ;D thank you...

SMF spam blocked by CleanTalk