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

SOLVED Script @param not showing

flyinian

Member
Both scripts are exactly the same. The only difference is the numer "11" added at the end of the script name in the first example.

// Why does this work:
GML:
/// @function Scr_Zone_Var11(_Enum,_Index,_Name,_Security_Level,_Owner_Enum,_Owner_Index,_Owner_Name,_Owner_Level)
/// @description 4534
/// @param Enum
/// @param Index
/// @param Name
/// @param Security_Level
/// @param Owner_Enum
/// @param Owner_Index
/// @param Owner_Name
/// @param Owner_Level

function Scr_Zone_Var11(argument0,argument1,argument2,argument3,argument4,argument5,argument6,argument7)
{
    _Enum = argument0;
    _Index = argument1;
    _Name = argument2;
    _Security_level = argument3;
    _Owner_Enum = argument4;
    _Owner_Index = argument5;
    _Owner_Name = argument6;
    _Owner_Level = argument7;

};


// but this doesn't work:
GML:
/// @function Scr_Zone_Var(_Enum,_Index,_Name,_Security_Level,_Owner_Enum,_Owner_Index,_Owner_Name,_Owner_Level)
/// @description 4534
/// @param Enum
/// @param Index
/// @param Name
/// @param Security_Level
/// @param Owner_Enum
/// @param Owner_Index
/// @param Owner_Name
/// @param Owner_Level

function Scr_Zone_Var(argument0,argument1,argument2,argument3,argument4,argument5,argument6,argument7)
{
    _Enum = argument0;
    _Index = argument1;
    _Name = argument2;
    _Security_level = argument3;
    _Owner_Enum = argument4;
    _Owner_Index = argument5;
    _Owner_Name = argument6;
    _Owner_Level = argument7;

};
// I'm referring to the parameters showing
Here are screenshots:
1627227425099.png
1627227420657.png
 

chamaeleon

Member
Don't use argumentN as actual arguments in your function definition. Now that you have proper functions at your disposal, just use the names you wish your arguments to have in the argument list, and you don't need to have names locally defined for them inside the function.

Edit: Not to be confused with names used to assign struct variables in a constructor of course, which will still need to be there in order for them to become members of the struct, but the names in the parameter list should still not be argumentN.
 

flyinian

Member
Don't use argumentN as actual arguments in your function definition. Now that you have proper functions at your disposal, just use the names you wish your arguments to have in the argument list, and you don't need to have names locally defined for them inside the function.

Edit: Not to be confused with names used to assign struct variables in a constructor of course, which will still need to be there in order for them to become members of the struct, but the names in the parameter list should still not be argumentN.
Like This?:

GML:
/// @function Scr_Zone_Var(Enum,Index,Name,Security_Level,Owner_Enum,Owner_Index,Owner_Name,Owner_Level)
/// @description  I'm a description
/// @param Enum
/// @param Index
/// @param Name
/// @param Security_Level
/// @param Owner_Enum
/// @param Owner_Index
/// @param Owner_Name
/// @param Owner_Level

function Scr_Zone_Var(_Enum,_Index,_Name,_Security_level,_Owner_Enum,_Owner_Index,_Owner_Name,_Owner_Level)
{
    

};
 

chamaeleon

Member
Like This?:
Yes, just like that. Then you can proceed to use those named arguments in your function. Use argument[N] in the function body when you need to refer to additional optional arguments provided in the function call after all named arguments.
 

flyinian

Member
Yes, just like that. Then you can proceed to use those named arguments in your function. Use argument[N] in the function body when you need to refer to additional optional arguments provided in the function call after all named arguments.
So, if this is correct. Why is it that the @Param don't show for the script? For example: If I add "11" to Scr_Zone_Var so it'll be Scr_Zone_Var11 the @param shows for the script.

GML:
/// @function Scr_Zone_Var(Enum,Index,Name,Security_Level,Owner_Enum,Owner_Index,Owner_Name,Owner_Level);
/// @description Im a description
/// @param Enum
/// @param Index
/// @param Name
/// @param Security_Level
/// @param Owner_Enum
/// @param Owner_Index
/// @param Owner_Name
/// @param Owner_Level

function Scr_Zone_Var(_Enum,_Index,_Name,_Security_level,_Owner_Enum,_Owner_Index,_Owner_Name,_Owner_Level)
{
    _Enum = noone;
    _Index = noone;
    _Name = "";
    _Security_level = 1;
    _Owner_Enum = noone;
    _Owner_Index = noone;
    _Owner_Name = ""
    _Owner_Level = 1;
};
Thanks for the help.
 

chamaeleon

Member
Parameter names are showing up for me after copy pasting your code, with or without using the @param (if no @param, whatever I used as a function variable name is displayed).
 

flyinian

Member
Parameter names are showing up for me after copy pasting your code, with or without using the @param (if no @param, whatever I used as a function variable name is displayed).
That's lovely. I guess my IDE is broken up the wazoo.

Thanks for the help. I appreciate it.

Edit: A restart of the IDE fixed it. Again, Thanks for the help.
 

Vusur

Member
I copy&pasted all three versions. All three show the parameters.
IDE 2.3.3.576
Runtime 2.3.3.437

From the look, you were testing stuff? Because scr_zone_var and scr_zone_var11 is something, when I duplicate stuff and so on. There might be a name clash internal. Try cleaning the project (broom icon or ctrl+F7) and/or export/import your project.

Edit: Welp, I was to slow. :)
 

flyinian

Member
I copy&pasted all three versions. All three show the parameters.
IDE 2.3.3.576
Runtime 2.3.3.437

From the look, you were testing stuff? Because scr_zone_var and scr_zone_var11 is something, when I duplicate stuff and so on. There might be a name clash internal. Try cleaning the project (broom icon or ctrl+F7) and/or export/import your project.
The "11" wasn't from duplication and I was testing. I manually placed it in there. A simple IDE restart fixed it. Now sure of the cause. Restarting the IDE also fixed other issues that I've been having. Thanks for the reply.
 
Top