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

Creating Objects in order

RandomzZz

Member
hello everyone, im wondering how to create objects in an certain order. so for example, i always want my camera(obj_camera) to be the first thing to be created, i tried using the room Start event, but this doesnt work.
 

Slyddar

Member
The room has an "Instance Creation Order" button under the properties of the room down the bottom left. You can drag the instances that are being created in the room, into the order you want them to be created.
 

Roldy

Member
Some things to keep in mind.

  • Even though you can control the initial creation order of instances they may change their ordering in some situations:
    • Persistent instances when changing rooms will append to the end of the instance list
    • Deactivated, activated instances may change their order in the instance list
    • Instance created during runtime, not in the room editor, are appended to the end of the instance list
    • There may be other times instances change their processing order
  • Consider the above conditions and if you are feeling clever you can actually use those to order/reorder instances
  • Again, consider that instance may change their ordering through undocumented behavior and ignore creation order:
    • Consider not trying to order specific instances instead utilize the ordered events to organize what code happens when
      • Begin Step, Step, End Step -
        • Decide what operations need to happen before others
        • Then order those operations within your objects accordingly
        • Use a spread sheet and document what operations can occur in which event
      • Begin Draw, Draw, End Draw
        • As above if you need to order certain operations be sure to familiarize yourself with these events
    • Similar to the other's suggestion; use a control object to process your instances
      • If there is a specific operation that must happen in a specified per instance order then:
        • Put your instance IDs in an order list and have the controller object process each one
        • This allows you to ignore 'creation order' and simply order you instances manually
 
Last edited:
Top