# GMLscripts.com

Discuss and collaborate on GML scripts

You are not logged in.

## #1 2010-07-15 12:11:33

flexaplex
Member
Registered: 2008-12-11
Posts: 72

### Object Creation Execution Order Bug

Just a little bug to watch out for with those relying on execution order. To reproduce:

RUN 1:

1. Create a new blank file
2. Create an object, add the creation code: global.t0 = 0;
3. Create another object, add the creation code: global.t1 = global.t0;
4. Create a room and place Object0 then Object1 in the room
5. Set the depth of Object1 to 99
6. Run the game

RESULT: NO ERROR WILL BE SHOWN

RUN 2:

1. Now delete both objects from the room
2. Then place them back in the room in the same order, ie object0 then object1
3. Run the game again

RESULT: AN ERROR IS NOW SHOWN

It appears that in RUN 1 the game is bugged, executing the 2 objects in the incorrect order (thus making the error to show), however when you delete and replace the objects in the room even though the resultant file is exactly the same the error is removed. Just uploading and re-downloading the file again will remove the bug also which is why I cannot provide an example file for this.

I have known about this bug for years, I only just remembered about it so I thought I would just post it for interest.

Last edited by flexaplex (2010-07-15 12:13:01)

Offline