Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Kinoko on Tue 27/01/2004 04:59:21

Title: Actions after NewRoomEx
Post by: Kinoko on Tue 27/01/2004 04:59:21
I've got most of my intro sequence going now, but I have one minor problem. I'd like to change the room at one point, after having previously taken the player character and another character out of room 1 and into room 2. I can get everything displayed as I want, and all the characters at the right coordinates by using character[].room and NewRoomEx in the local script for room 1.

I then want to DisplaySpeech and use some animation in room 2, but I can't seem to make the script respond. The intro stops as soon as the new room is loaded.

I basically have a blank script for room 2. What lines of code do I use in the room 2 script to allow me to start scripting actions?
Title: Re:Actions after NewRoomEx
Post by: Ishmael on Tue 27/01/2004 08:13:02
You should script the room 2 events (the speecha and animation) in the room 2 "Player enters screen (after fadein)", I think. This way, by splitting the script into their corresponding rooms, I write multi-room cutscenes. Another way is to use globalints and the global rep_ex, but that might get a bit confusing...
Title: Re:Actions after NewRoomEx
Post by: Kinoko on Tue 27/01/2004 12:52:25
This is what I have in my room 2 script:

// room script file
function room_a() {
 // script for room: Walk off left screen edge
}

function room_b() {
 // script for room: Player enters screen (before fadein)
}

function room_c() {
// script for room: Player enters screen (after fadein)

DisplaySpeech (JULIO, "Thankyou ladies and gentlemen");

}



It seems pretty basic enough and yet as soon as the second room is loaded, the script stops and it returns control to the player. Like I said before, the character positions for this room are  written in the room 1 script with the newroom lines.

For the knowledge of scripting I have so far, it seems like it should be working but I can't understand why the script won't continue with the DisplaySpeech function I have on this room script. As soon as the room loads, I just get control of the cursor and nothing else happens.

Does anyone have any ideas on this?
Thanks so far, TK.
Title: Re:Actions after NewRoomEx
Post by: Ishmael on Tue 27/01/2004 13:01:05
It that is what you have set, through Room Interactions -> [Interaction] -> Run Script, and typed in the scripts, it should work...

Try putting StartCutscene(x); in the Player enters screen (before fadein) interaction of the first room, and EndCutscene(); after the displayspeech line in the second line... Consult the manual in Game/Global -> StartCutscene(); for the x values, thus I cannot remember then right now...
Title: Re:Actions after NewRoomEx
Post by: Kinoko on Tue 27/01/2004 13:16:00
(Thanks for the quick reply!)

OK, I think we hit something there - proof of my ignorance!

I did not know these things also had to be set in Room Interactions, I now see the light, I feel like an idiot, and everything works like a charm. THANKYOU.