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.

How to set a default Value for a Function acs

Postby GGianpy » Sun Oct 18, 2020 3:53 am

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

Code: Select allExpand view
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
GGianpy
 
Joined: 11 Mar 2020
Location: Italy
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Not Listed

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

Postby MFG38 » Sun Oct 18, 2020 4:11 am

I don't think default values for arguments can be set that way in ACS.
User avatar
MFG38
 
Joined: 14 Apr 2019
Location: Finland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

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

Postby GGianpy » Sun Oct 18, 2020 4:30 am

Then how is it possible that functions like "HudMessage" can have defualt values?
User avatar
GGianpy
 
Joined: 11 Mar 2020
Location: Italy
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Not Listed

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

Postby SanyaWaffles » Sun Oct 18, 2020 4:43 am

Because HudMessage is a built in function. Those 99.9% of the time work differently than functions you code yourself.
User avatar
SanyaWaffles
Wouldn't be an epic gamer if I didn't commit a few war crimes.
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby GGianpy » Sun Oct 18, 2020 7:19 am

ok.
User avatar
GGianpy
 
Joined: 11 Mar 2020
Location: Italy
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Not Listed


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests