• 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!

SOLVED Can I organize Instance Creation Order???

I

Ivan_da_fe

Guest
Hi, guys I have a doubt.
In my project I have some instances that Need to be Created First.
They contain Global Vars, or just behaviors that other instances will need somehow.
I have around three of these, but the most important(and most needed) is obj_controller, containing very important variables.

So my Question is this:
Is there a way to tell game maker Which Instances I want to Prioritize Creation For?

Basically, some sort of list to tell Game Maker, this instance will be created first, then this one, and so on... so it won't create more instances 'till the main ones already exist.
I'm aware maybe a list is not possible, but at least prioritize one above all will be enough.

Any help will be appreciated and thanks for reading.


EDIT: I had didn't check the post until now, I already put the method to work and it seems to work perfectly, I also got some smart suggestions.
Grateful for the help.
 
Last edited by a moderator:
Yes, you can drag the object names around in the room editor, if you click on the layer they are on and then check the layer properties window. Drag them to the top and they will be created first.
 

DaveInDev

Member
To be more precise, this list is in a subwindow called "instance creation order" (use the Room menu to display it), I'm not sure that the order of the " layer properties window " has an influence on the creation order.
 

kburkhart84

Firehammer Games
As the people above said, you can do this the way they said.

I personally prefer to put those objects into an "initialization" room, and make my game start in that room. Then, after like 10 steps in that room(which lets the engine fully initialize, there are a couple things that don't work the first couple steps, don't remember what they all are though), I go to the real first room, which would be splash screens, main menu...whatever.
 

DaveInDev

Member
I personally prefer to put those objects into an "initialization" room, and make my game start in that room. Then, after like 10 steps in that room(which lets the engine fully initialize, there are a couple things that don't work the first couple steps, don't remember what they all are though), I go to the real first room, which would be splash screens, main menu...whatever.
I saw that's what people do, so I do the same, but is there a way not to see this small black init room during 150ms ? It's not nice as a start. Any way to make a room invisible ?
 

kburkhart84

Firehammer Games
I saw that's what people do, so I do the same, but is there a way not to see this small black init room during 150ms ? It's not nice as a start. Any way to make a room invisible ?
I've never known of anything, though you could simply put some graphic or similar if you really wanted to. What I like is to have the next room(splash screen type thing) also have the same black background, just with the logo in the middle, etc... if you do some animation of the splash screen/intro thing, like having it fade in, or tween in from the side, or whatever, you don't notice the 150ms of pure black before it, rather it looks like it was done on purpose if anybody actually catches it.
 

DaveInDev

Member
I've never known of anything, though you could simply put some graphic or similar if you really wanted to. What I like is to have the next room(splash screen type thing) also have the same black background, just with the logo in the middle, etc... if you do some animation of the splash screen/intro thing, like having it fade in, or tween in from the side, or whatever, you don't notice the 150ms of pure black before it, rather it looks like it was done on purpose if anybody actually catches it.
Ok, I did it the wrong way, because my init room has a small fixed size, and my second room is the one which resizes itself to automatically fit an adapted portion of the display (I don't want to start with a small window on large screens, nor a too big window on smaller displays). Both of your rooms already have the correct same size.
 

TheouAegis

Member
Then move your code which resizes the window to the init room. Or if you don't have anything in that room that resizes the window already, then just move your init code to that room.
 
I'm not sure that the order of the " layer properties window " has an influence on the creation order.
It does have an influence on the order instances execute their code in, but it might only be layer specific. What you pointed out is the more correct way of doing it.
 
I

Ivan_da_fe

Guest
As the people above said, you can do this the way they said.

I personally prefer to put those objects into an "initialization" room, and make my game start in that room. Then, after like 10 steps in that room(which lets the engine fully initialize, there are a couple things that don't work the first couple steps, don't remember what they all are though), I go to the real first room, which would be splash screens, main menu...whatever.
That's an smart trick, I'm not sure what time of problems it could give in other projects, but for mine I think I can easily figure out a work around.
Thanks a lot for the help.
 
Top