Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Ishmael on Tue 02/09/2003 05:10:10

Title: Suggestion: Naming Rooms
Post by: Ishmael on Tue 02/09/2003 05:10:10
I got yet another suggestion for AGS... this one I really would find useful. Searching and reading the changelist gave me no proof of this existing, so....

What if you could name rooms?

(Bad example:)
Like if you have a game with fiver rooms, and you have saved them rooms 1-5. The, you want to make an opening cutscene, and use the numbers 1-3 for it's rooms. This causes that you need to tweak the scritps in every five original rooms. If the rooms would have names, tweaking the scripts wouldn't be needed.

Just thought about it and brought it up....
Title: Re:Suggestion: Naming Rooms
Post by: Gilbert on Tue 02/09/2003 05:27:57
I don't understand, the part about tweaking the scripts... Can you provide more information?

Currently we can have descriptions for rooms in the editor already.
Title: Re:Suggestion: Naming Rooms
Post by: RickJ on Tue 02/09/2003 07:03:12
What TK is taking about something like the followng: Suppose  you had a cutscene consisting of 5 consecutive rooms.  They were all scripted to have wait for 15 seconds and then transition to the next room in the sequence.  Now suppose you decided that you needed to add an additional scene between rooms 2 & 3.  Of course, you could have room 2 jump to room 6 or someother arbituary room number and then have that one jump back to room 3.  Although this is completly workable, TK, for example, would prefer to maintian a linear sequence of rooms.  In this case TK would need to rename his room files accordingly and would also need to edit each of the room scripts.

TK: There is alread a way of doing this.   Do something like the following in the Script Header File.  The prefix is important because it prevent collisions in the name space (i.e. you would never confuse a room name with a sound or music name).

[Script Header]
//======================================
//  Room Definitions
//======================================
#define  rTITLE                           0
#define  rCREDITS                      1
#define  rINTRO                          2
#define  rOUTSIDE_BUILDING    3
#define  rINSIDE_BUILDING       4
#define  rOUTRO                        5

The you would do something like this in each of the room scripts.  

[Room 0 Script]
room_a()
{
  Wait(15);
  NewRoom(rCREDITS);
}

[Room 1 Script]
room_a()
{
  Wait(15);
  NewRoom(rINTRO);
}

Hope this is helpful.  
Title: Re:Suggestion: Naming Rooms
Post by: Ishmael on Tue 02/09/2003 08:56:36
:D Thanks! Just what I meant... I'm not much of a C or C++ scripter, so couldn't come up with  that... :P Well, never is too late to learn more. ;)
Title: Re:Suggestion: Naming Rooms
Post by: Pumaman on Tue 02/09/2003 19:14:22
Yep - bear in mind though that if you change the number of any #defines in the script header, you need to then use the "Rebuild all room files" option on the Game menu in order to ensure that all room scripts are updated with the correct value for the definitions.