How to move from one room to another

Started by Deax Strife, Wed 28/12/2005 13:04:01

Previous topic - Next topic

Deax Strife

I can't seem to find any articles or tutorials who can tell me how to do that.

Can any of you?  ???

DoorKnobHandle

Quote from: Manual
ChangeRoom
(Formerly known as NewRoom, which is now obsolete)
(Formerly known as NewRoomEx, which is now obsolete)
(Formerly known as NewRoomNPC, which is now obsolete)

Character.ChangeRoom(int room_number, optional int x, optional int y)

Changes the room that the character is in.
If you call this on the player character, then the current room is unloaded from memory and ROOMx.CRM is loaded instead, where X is room_number.

IMPORTANT: This command does not change the room immediately; instead, it will perform the actual room change once your script function has finished (This is to avoid problems with unloading the script while it is still running). This means that you should not use any other commands which rely on the new room (object positionings, and so on) after this command within the same function.

If you call this on a non-player character, then they are instantly transported to the new room number.

Optionally, you can include an X and Y co-ordinate (you must include either both or neither). If you do so, then the character will also be moved to the specified co-ordinates in the new room.

Example:

character[EGO].ChangeRoom(4, 100, 50);

will move the player character to room 4 and also place him at coordinates 100,50. This will also mean that the game moves into room 4.

Deax Strife

Thanks, i'll use that, but is there any way of changing rooms without using script?

petazzo

You can use the Action editor and select Player - Go to a different room. Please, read the tutorial. The basics are explained in it. http://www.adventuregamestudio.co.uk/acintro.htm
I never forget a face, but in your case I'll be glad to make an exception.
(Groucho Marx)

SMF spam blocked by CleanTalk