Hi,
I was wondering if there was a way to query the room edges the player is about to enter?
For example, say the player is currently in RoomA. The player walks over an exit region in RoomA to go to RoomB, but before that player actually goes to RoomB, I'd like to save RoomB's edges from within RoomA as global variables so I can use them in a custom changeroom function.
Is this possible somehow?
No. There's no way to get anything from another room, because AGS only loads one room at a time.
Aww crap.
Ok, well on another note, how can we loop through all the current room's hotspots and disable only the ones that have a certain text property value (GetTextProperty("Exit") == "Left")?
Quote from: Knox on Sun 29/06/2014 23:40:15
Ok, well on another note, how can we loop through all the current room's hotspots and disable only the ones that have a certain text property value (GetTextProperty("Exit") == "Left")?
#define MAX_HOTSPOTS 50
<...>
int i = 0;
while (i < MAX_HOTSPOTS)
{
if (hotspot[i].GetTextProperty("Exit") == "Left")
{
hotspot[i].Enabled = false;
}
i++;
}
Wow, that works great. Thanks! :smiley:
Quote from: Knox on Sun 29/06/2014 22:10:17
I was wondering if there was a way to query the room edges the player is about to enter?
If you don't have too many rooms, you could create a struct to hold edge position and then an array, populating it with the proper values during game_start. You'd have to enter the values manually, but if you plan to use that custom function of yours a lot, it could be worth the effort.
Basically:
struct RoomEdges
{
int top,
int left,
int bottom,
int right,
};
RoomEdges[SIZE] edges;
Not a NICE way of doing it, but a workaround.
Hi Ghost,
Im not too sure how many rooms I will eventually have, but there is already quite a few. I plan on using it for pretty much all the rooms...I like the workaround though, pretty clever. Entering the values manually shouldn't be too much of a hassle.
Thanks!