Closed GameDevTosh closed 2 months ago
Upon further testing, if we add these new functions:
///@desc Has 1 optional arguments, but 15 non-optional.
function abc5(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p=16)
{
return a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
}
///@desc Has 1 optional arguments, but 16 non-optional.
function abc6(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q=17)
{
return a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q;
}
And test them, the first will pass, but not the second:
var value5 = abc5(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
show_debug_message($"Function abc5 passed with: {value5}"); //passes
var value6 = abc6(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
show_debug_message($"Function abc6 passed with: {value6}"); //fails
So it seems to be an issue with setting optional arguments after the 16 limit.
Fixed in 2024.10
verified as of IDE v2024.1100.0.625 Runtime v2024.1100.0.651
Description
With the removal of the argument limit from https://github.com/YoYoGames/GameMaker-Bugs/issues/6473 and the fix to feather with https://github.com/YoYoGames/GameMaker-Bugs/issues/6873, we now have an issue where using optional arguments after a certain number of arguments (assuming the old 16 limit) will cause gamemaker to throw this error:
############################################################################################ ERROR in action number 1 of Create Event for object Object1: Pop :: Execution Error - Variable set failed argument16 - read only variable? at gml_Script_abc3 (line 14) - function abc3(a,b,c,d,e,f,g,h,i,j,k,l=12,m=13,n=14,o=15,p=16,q=17,r=18,s=19,t=20,u=21,v=22,w=23,x=24,y=25,z=26) ############################################################################################ gml_Script_abc3 (line 14) gml_Object_Object1_Create_0 (line 7) - var value3 = abc3(1,2,3,4,5,6,7,8,9,10,11);
This happens in latest Beta 5.
Steps To Reproduce
Given these four functions:
If we call them all, only abc ever executes:
The rest error out with the error above.
Which version of GameMaker are you reporting this issue for?
IDE v2024.800.0.609 Runtime v2024.800.0.633
Which operating system(s) are you seeing the problem on?
Windows 10.0.19045.0
Which platform(s) are you seeing the problem on?
Windows
a6a5f03b-acf5-443f-88e9-3e3a8b06a270