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

Script related crash after 2.3.5 release

Markusaw

Member
The 2.3.5 runtime update broke my scripts. I am getting the error: Pop :: Execution Error - Variable set failed mainTitle - read only variable?
at gml_Script_event (line 92) - other.eventBox.mainTitle = name;

I rolled back the runtime to 2.3.4 and everything worked perfectly so I am positive it's the update that broke them. It affected multiple of my projects too, not just one. Just wondering if anyone else has experienced something similar after the 2.3.5 update, maybe you found a way to use it without having to roll back and stay on the old runtime.

EDIT: It also seems to always be related to scripts somehow.
 

Nidoking

Member
It would help to see the actual script and where you're calling the function, and also where you're defining the mainTitle variable.
 

bongface

Member
i have the same problem with the 2.3.5 version. rolled back to 2.3.4 and everything is working again. have you found a solution in the meantime?
 

Nidoking

Member
They don't even seem to have found the problem. Perhaps you, in their place, could post something tangible for anyone to look at and possibly provide answers?
 

bongface

Member
GML:
// Step Event
particleObject.x = x;
particleObject.y = y;
GML:
// Destroy Event
instance_destroy(particleObject);
This works with 2.3.4 without any problem. After switching to 2.3.5 I got this:

GML:
___________________________________________
############################################################################################
ERROR in
action number 1
of  Step Event0
for object oAttackIceHoming:

Pop :: Execution Error - Variable set failed x - read only variable?
at gml_Object_oAttackIceHoming_Step_0 (line 18) - particleObject.x = x;
############################################################################################
gml_Object_oAttackIceHoming_Step_0 (line 18)
I was able to fix the error by changing the code to the following:

GML:
// Step Event
if(variable_instance_exists(id, "particleObject")) {
    particleObject.x = x;
    particleObject.y = y;
}
GML:
// Destroy Event
instance_destroy(particleObject);
It looks like the 2.3.5 runtime is still executing the step event even though the destroy event has been executed.
So I think at runtime 2.3.5 the destroy event will be handled differently.
 
Last edited:

gnysek

Member
fixed for you:
GML:
// Step Event
if (instance_exists(particleObject)) {
    particleObject.x = x;
    particleObject.y = y;
}
 

knightshaft

Member
So I think at runtime 2.3.5 the destroy event will be handled differently.
I had issues with code being handled differently going from 2.2 to 2.3, and then again to 2.3.5 but had a complete denile from YoYo that anything different was going on. It was my coding that caused the issues both times so it seems that the later versions of GMS2 are less tolerant of poor coding :D
 

Yal

šŸ§ *penguin noises*
GMC Elder
I've ran into two things that can cause this:
  • Trying to change the value of a function argument (they're read-only now)
  • Accessing a variable in a destroyed instance (they're removed immediately upon instance_destroy() now instead of at the end of the step)
 

bongface

Member
I had issues with code being handled differently going from 2.2 to 2.3, and then again to 2.3.5 but had a complete denile from YoYo that anything different was going on. It was my coding that caused the issues both times so it seems that the later versions of GMS2 are less tolerant of poor coding :D
I totally agree with you. It was just bad code :D
 

Stra

Member
Same here. I used to write lazy code in places, for example checking if an element in an array exists simply by doing
GML:
if a[i]
Doesn't work anymore, errors all around, had to rewrite the code in many places (by first checking if i is greater than the length of the array).

Personally I like more stringent coding rules, I only did it that way because GML allowed it/it simply worked.
 

Nidoking

Member
And that's why I keep pushing for better coding habits and not doing things just "because it works". Okay, it works now, but I hope you like rewriting your entire game every time GMS updates and brings a bit more sanity to GML, while I just update the runtime, recompile, and carry on with what I was doing.
 
Top