X
xxTheFryxx
Guest
I have an object and I need to check to see if it’s been given creation code, otherwise it sets a variable. How can I go about this?
I tried this, but it seems the creation code runs before the create event.The creation code is run after the create event, can't you just set the variable in the create event and overwrite it in the creation code instead?
I’m running 1.4The creation code is definitely run after the create event. If you find some variables are not the way they should be, there may be something else going on (like some code in the room start event or step that changes those values).
You can check the above by adding a show_debug_message in both events and look for the resulting order in the console, if you are unsure.
Can't really help you more than this without the actual code or more details.
It’s 1.4, I mean it would be very nice if the create event came after but on my version it sadly just doesn’t. Is there any workaround?The creation code runs before the Create event in old versions - pre-Studio, if memory serves me right. Any version that's not 5 years old should run the creation code after the Create event.
It’s 1.4, I mean it would be very nice if the create event came after but on my version it sadly just doesn’t. Is there any workaround?
The manual said:http://docs.yoyogames.com/source/dadiospice/001_advanced use/more about rooms/index.html
- Creation Code: This option opens up a code editor where you can add code into the specific instance that you have clicked on. This is a very powerful feature that allows you to further change individual instances of objects and so give several instances different values or variables to change their behaviour. This code is run after the normal create event, but before the room start event (see Using GameMaker: Events for the complete order of events).
I’ll take a look later tonight. ThanksEven in 1.4 the creation code comes after: http://docs.yoyogames.com/source/dadiospice/000_using gamemaker/events/index.html, at least on paper.
As said, it's easy to check if the event order is the problem here by using a show_debug_message