• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM [Solved]GMS engine bug.

S

Salvakiya

Guest
this has been SOLVED!

I seem to have found a bug..

I am creating a UI engine for use with my RPG game. I am trying to make the system work like windows.

the engine is structured like so...

obj salui_controller:
  • every step on mouse left press will search ALL UI elements and finds the one with the lowest depth which also collides with the mouse.
  • it sets the found element to salui_controller.infocus
obj salui_element:
  • this is the parent element which all children inherit from. the create event sets up a list which will contain the id's of all children elements
  • the destroy event for this object will remove its object ID from any parent if it exists then it will cycle through its children destroying them as it moves on. the children should then destroy themselves and their children
obj salui_button(BUGGED?):
  • in the step event this button object will execute a given script with a given argument. these are set in salui_add_button.

In the demo I have there are 3 windows and many buttons. I attach a script to only one button which is meant to be the close button for one of the windows. when I press this button the window and all of its children are destroyed EXCEPT for the button which I used to try and close everything with. This is odd because it is created the same way as all of the others yet it is left out. also it is odd because it does not matter what order I add them to the window... the one executing the script will not be destroyed.

here is my GMZ.
https://www.dropbox.com/s/mzdzgq8qic2k2n0/SalUI5.gmz?dl=0

my hypothesis would have been that if you run script_execute it prevents the calling object from being destroyed while processing that script... However I did try to run all actions off of the salui_controller and that failed to work as well. it is very odd... very odd indeed.

EDIT: I found what the issue was... the issue was that I was iterating over a DS list and modifying it while iterating.
 
Last edited:
Top