Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 25/01/2004 12:02:42

Title: Change room + dialog
Post by: on Sun 25/01/2004 12:02:42
Hi,

I want to give a character an object and then we must start a dialog and after that change the room in specific coördinates.
So : -interact with character
                 -use inventory on character
                       -?conditional if inventory was used (number)
                                  -game (run dialog) (number)
                                  -player-Go to a different room at spec. coörd.

When I do this, the player changes coördinates BEFORE the dialog is started, i want to change the coördinates AFTER the room has changed.

Please help!
-Hendelman-
Title: Re:Change room + dialog
Post by: Scorpiorus on Sun 25/01/2004 12:43:52
Yeah, that is because the dialog is always started last. Remove player-Go to a different room action and put a run-script command in the dialog script when it's about to finish:
...
ego: now we go into another room!
run-script 1
stop

now place the next script code into the main global script:

function dialog_request(int value) {

if (value == 1) {

NewRoomEx(GetPlayerCharacter(), NEW_X_COORDINATE, NEW_Y_COORDINATE);
}

}

replace  NEW_X_COORDINATE and NEW_Y_COORDINATE with the actual values

~Cheers
Title: Re:Change room + dialog
Post by: on Sun 25/01/2004 19:05:28
 ;)

Where do I add the room number and or name.?

Thanx by the way!
Title: New room?
Post by: on Sun 25/01/2004 19:15:16
Hi,

}  
function dialog_request(int value) {

if (value == 1) {

NewRoomEx(GetPlayerCharacter(),50,175);
}
}

I got this code now, but where do i put in the new room ?
It's room 3!
Title: Re:New room?
Post by: strazer on Sun 25/01/2004 19:19:30
::) Why don't you just look in the manual, that what it's for:

NewRoomEx (int room_number, int x, int y)

And no need to open a new thread for that!
Title: Re:Change room + dialog
Post by: Scorpiorus on Sun 25/01/2004 21:51:09
Ah, yeah good point, it should be: :)
...
NewRoomEx(NEW_ROOM, NEW_X_COORDINATE, NEW_Y_COORDINATE);
...

~Cheers