Hello,
I made an ENTER script that gives the player a reward crate of goodies and equip if he manages to kill all the monsters in a map.
I'd like to make it an optional feature, and since making a menu option that gives a token item only works if it's done after loading a map, I figured that CVARS are my best bet for this purpose. I've never played around with Cvars much, so I'm a little lost on how I should do this in a "clean" way. Any advices?
[SOLVED]Switchable menu option for a script
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!)
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!)
[SOLVED]Switchable menu option for a script
Last edited by Grey-Wolf on Fri Jan 17, 2020 12:22 pm, edited 1 time in total.
Re: Switchable menu option for a script
Might I ask what exactly do you mean by the "clean" way?
As for how to do it, let's start with a CVARINFO; that's where all the CVARs will be stored.
As for the menu option, MENUDEF is the way to do it.
Now, I had problems with MENUDEF the first time I tried it, so I'll post an example below:
Hope this helps.
As for how to do it, let's start with a CVARINFO; that's where all the CVARs will be stored.
As for the menu option, MENUDEF is the way to do it.
Now, I had problems with MENUDEF the first time I tried it, so I'll post an example below:
Spoiler:And in the ACS script, you will want to have this check:
Code: Select all
If(GetCVar("cvar_name")==1){insert code here}
Re: Switchable menu option for a script
"Clean" as in "without weird hacks and coded as a gentleman would", lol.Jarewill wrote:Might I ask what exactly do you mean by the "clean" way?
It did, thank you very much!Grey-Wolf wrote:Hope this helps.