How to set a default Value for a Function acs

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
GGianpy
Posts: 57
Joined: Wed Mar 11, 2020 3:09 pm
Graphics Processor: Not Listed
Location: Italy

How to set a default Value for a Function acs

Post by GGianpy »

good morning,
i'm trying to set a default variable for a function but i can't.

Code: Select all

function bool Gui_InputCode(int password, int wscript, int lscript=0) // Error here
{
       //Code...
}
tells me this error: Missing ')'
I have already searched in the forum and on the wiki but nobody talks about it.

what did i do wrong?
User avatar
MFG38
Posts: 414
Joined: Sun Apr 14, 2019 8:26 am
Graphics Processor: nVidia (Modern GZDoom)
Location: Finland
Contact:

Re: How to set a default Value for a Function acs

Post by MFG38 »

I don't think default values for arguments can be set that way in ACS.
GGianpy
Posts: 57
Joined: Wed Mar 11, 2020 3:09 pm
Graphics Processor: Not Listed
Location: Italy

Re: How to set a default Value for a Function acs

Post by GGianpy »

Then how is it possible that functions like "HudMessage" can have defualt values?
SanyaWaffles
Posts: 805
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields
Contact:

Re: How to set a default Value for a Function acs

Post by SanyaWaffles »

Because HudMessage is a built in function. Those 99.9% of the time work differently than functions you code yourself.
GGianpy
Posts: 57
Joined: Wed Mar 11, 2020 3:09 pm
Graphics Processor: Not Listed
Location: Italy

Re: How to set a default Value for a Function acs

Post by GGianpy »

ok.
Post Reply

Return to “Scripting”