GM Version: 2.3.0.529+
Target Platform: All
Download: N/A
Links: N/A
Summary:
How to Fix old scripts for Gms 2.3
TL;DR Make them functions by adding function (script name) as the first line and enclosing all the code in curly brackets { }
GMS 2.3 should automatically do this for you but in the case it didn't or you don't quite understand.
I hope this helped clear some things up and helps those who are having issues. Looking forward to the new things made in GMS 2.3!
Tutorial:
So you have updated to gms 2.3, the ide runs your project is converted, you've fixed issues, but your scripts are trashed because now they are ran at runtime and saved globally.
Heres a work around i've found so far.
BEFORE 2.3
Your scripts could only hold one function, or act as a bunch of code that can be called by an instance.
After 2.3
So because the scripts are now ran at runtime and values are saved globally this will run at the start of the game and show a big 11. Then run again when the object calls it. For this example this isn't to bad, but imagine if this is a save system, or bigger code!
BIG ERROR TIMES!
THE FIX FOR 2.3!
make the old script a function named the same as the script. The Compatibility converter should automatically do this but in case it didn't here's the solution.
Essentially that's What you've been doing all along before 2.3! Instead The script acted as only one function and you'd call it as such. "applesaregone()"
by adding function to the start you've made the IDE realize that everything between those curly brackets is a single function, this is still ran and read at runtime but will not be activated until called by the function using an isntance.
I hope this helped clear some things up and helps those who are having issues. Looking forward to the new things made in GMS 2.3!
@matharoo Made a great video on this explaining it a lot better then I can
Target Platform: All
Download: N/A
Links: N/A
Summary:
How to Fix old scripts for Gms 2.3
TL;DR Make them functions by adding function (script name) as the first line and enclosing all the code in curly brackets { }
GMS 2.3 should automatically do this for you but in the case it didn't or you don't quite understand.
I hope this helped clear some things up and helps those who are having issues. Looking forward to the new things made in GMS 2.3!
Tutorial:
So you have updated to gms 2.3, the ide runs your project is converted, you've fixed issues, but your scripts are trashed because now they are ran at runtime and saved globally.
Heres a work around i've found so far.
BEFORE 2.3
Your scripts could only hold one function, or act as a bunch of code that can be called by an instance.
After 2.3
So because the scripts are now ran at runtime and values are saved globally this will run at the start of the game and show a big 11. Then run again when the object calls it. For this example this isn't to bad, but imagine if this is a save system, or bigger code!
BIG ERROR TIMES!
THE FIX FOR 2.3!
make the old script a function named the same as the script. The Compatibility converter should automatically do this but in case it didn't here's the solution.
Essentially that's What you've been doing all along before 2.3! Instead The script acted as only one function and you'd call it as such. "applesaregone()"
by adding function to the start you've made the IDE realize that everything between those curly brackets is a single function, this is still ran and read at runtime but will not be activated until called by the function using an isntance.
I hope this helped clear some things up and helps those who are having issues. Looking forward to the new things made in GMS 2.3!
@matharoo Made a great video on this explaining it a lot better then I can
Last edited: