• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker How to get the number of instances in a different room

RifleFire

Member
Hi Everyone,
I am trying to get the number of instances in a room that is not the current room. I am using an array of rooms and say my player is in room[1,2] but i want to display the number of instances in room [2,3]. How can i do this? Thank you all for any help you can give me...
RF
 

TheouAegis

Member
You can't. Have a global array set to the default number of instances in each room. Then as instances are created or destroyed in a room, modify that room's data in the array.
 

RifleFire

Member
Humm, so there is no function or built-in variable that can do this for me? For example, the built-in variable Instance_Count can't somehow work outside of the current room to give me an instance count of an adjacent room?
 

Simon Gust

Member
Anything in another room isn't loaded to RAM, there is no way you would be able to get that information without hard-saving the instance count to a variable or predetermine it beforehand.
 
Top