Hello,
I'd like to ask a few questions about how AGS handles the game's rooms, objects, and their logic status.
1. Is there only one room accessible in script at a time?
I mean, that you can't access objects from rooms other than the current one.
I saw a trick in the forums, that you can use a global variable to hide an object from another room, but you have to test that variable when the room is entered, and change the object visibility then.
2. Does the status of a room gets preserved by the engine, so the next time you enter it, you find it's objects as you left them last time? So if you hide an object, or change it's view, leave the room and then come back, the object is still hidden? I saw a Reset function in the docs, and it saids it can be used to reset room's objects to their initial state.
3. What about room scripts? Are they loaded when the game starts, and the variables, declared at the beginning of the room script, are preserved during the game?
4. What does the engine loads when a room is changed, and what does it unload when the room is exit from?
Since it has to keep some info about that room (like objects status), does it load only the graphic sprites from that room? Does the engine use to cache them for faster room loading? What happens if you have a game with lots of rooms with lot of graphic content. Will the game have a very long loading time at the beginning, or will it have long loading times when room changes?
5. If ChangeRoom function changes the room after the script returns, how can you implement cutscenes where you get to see what happens in another rooms, then back to the current one for more talking? Do you have to use a global variable to tell the room it's in a cutscene mode, so when it loads to do some specific stuff and then change back to the previous room, where the player was supposed to be?
Well that's it for now. Please drop a few YES or NO to the questions if you know how this stuff works, and if you want to give more details, it would be appreciated.
Thanks!
I'd like to ask a few questions about how AGS handles the game's rooms, objects, and their logic status.
1. Is there only one room accessible in script at a time?
I mean, that you can't access objects from rooms other than the current one.
I saw a trick in the forums, that you can use a global variable to hide an object from another room, but you have to test that variable when the room is entered, and change the object visibility then.
2. Does the status of a room gets preserved by the engine, so the next time you enter it, you find it's objects as you left them last time? So if you hide an object, or change it's view, leave the room and then come back, the object is still hidden? I saw a Reset function in the docs, and it saids it can be used to reset room's objects to their initial state.
3. What about room scripts? Are they loaded when the game starts, and the variables, declared at the beginning of the room script, are preserved during the game?
4. What does the engine loads when a room is changed, and what does it unload when the room is exit from?
Since it has to keep some info about that room (like objects status), does it load only the graphic sprites from that room? Does the engine use to cache them for faster room loading? What happens if you have a game with lots of rooms with lot of graphic content. Will the game have a very long loading time at the beginning, or will it have long loading times when room changes?
5. If ChangeRoom function changes the room after the script returns, how can you implement cutscenes where you get to see what happens in another rooms, then back to the current one for more talking? Do you have to use a global variable to tell the room it's in a cutscene mode, so when it loads to do some specific stuff and then change back to the previous room, where the player was supposed to be?
Well that's it for now. Please drop a few YES or NO to the questions if you know how this stuff works, and if you want to give more details, it would be appreciated.
Thanks!