Of course you cannot use Actor.GetCVar from an Event handler without specifying the actor in which context to use it.
So 'players[0].mo.GetCVar(...)' would be the proper way to read a CVar from player 1's context.
And for static CVARs you do not need any function at all, you can just use their name as a global read-only variable.
ZScript Documentation
Moderators: GZDoom Developers, Raze Developers
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
-
- Posts: 7402
- Joined: Fri Oct 22, 2004 9:22 am
- Graphics Processor: nVidia with Vulkan support
- Location: MAP33
Re: ZScript Documentation
Thanks for this, cleans things up a little bit.Graf Zahl wrote:Of course you cannot use Actor.GetCVar from an Event handler without specifying the actor in which context to use it.
So 'players[0].mo.GetCVar(...)' would be the proper way to read a CVar from player 1's context.
And for static CVARs you do not need any function at all, you can just use their name as a global read-only variable.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
I made this page in the effort to help programmers who are transitioning into using ZScript become a bit more familiar with its syntax, but it probably needs more work done.
-
-
- Posts: 17465
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: ZScript Documentation
Curious... if multi-return is a LUA feature, how did ZDoom do multi-returns in C++ before?
-
- Posts: 469
- Joined: Sat Apr 16, 2016 6:01 am
- Preferred Pronouns: She/Her
Re: ZScript Documentation
Assuming you're talking about in the C++ source, it just wouldn't have, as C++ doesn't have that feature. Can be replicated easily with something like an std::tuple, though.
-
-
- Posts: 17934
- Joined: Fri Jul 06, 2007 3:22 pm
Re: ZScript Documentation
Please keep wiki style in mind when creating pages. Capitalize only things that actually need to be capitalized.
Tutorial On How To Make A Door -- wrong! don't do that! stop doing that!
Universal Doom Map Format -- caps okay because it's the proper name of a standard
A_FireMissile -- caps okay because function names use CamelCase
Tutorial On How To Make A Door -- wrong! don't do that! stop doing that!
Universal Doom Map Format -- caps okay because it's the proper name of a standard
A_FireMissile -- caps okay because function names use CamelCase
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
Sorry. Bad habit. I was raised in a setting where if it has a title, It Must Have a Capital Except for Certain Words. As in, they put a drill to the back of my head. Almost.
...private schools I swear...
...private schools I swear...
-
- Posts: 83
- Joined: Wed Jul 15, 2015 5:26 am
- Location: Ukraine
Re: ZScript Documentation
I think there's need for JavaDoc-like documentation generator for ZScript.
-
- Posts: 7402
- Joined: Fri Oct 22, 2004 9:22 am
- Graphics Processor: nVidia with Vulkan support
- Location: MAP33
Re: ZScript Documentation
DPJudas was toying with something like this in a QZDoom branch back in February in the mainline ZScript Discussion thread. I haven't heard head or tail of it since, so I don't suspect it ever reached a point where it could be rolled into a release build.UsernameAK wrote:I think there's need for JavaDoc-like documentation generator for ZScript.
Pity, it'd come in very handy, both for the mainline engine itself and for modders to document their work and welcome additional content to be bolted onto theirs, ala Reelism's makeshift mod system or Brutal Doom's endless forks.
-
-
- Posts: 3134
- Joined: Sat May 28, 2016 1:01 pm
Re: ZScript Documentation
That would be this branch: refdocs
I didn't really try to finish it because it felt like I got a combination of shrugs and "yeah you go code that" feedback. As I didn't need ZScript documentation myself I figured that there's better things to spend my time on.
In any case, the code is there if anyone wants to pick up after where I stopped.
I didn't really try to finish it because it felt like I got a combination of shrugs and "yeah you go code that" feedback. As I didn't need ZScript documentation myself I figured that there's better things to spend my time on.
In any case, the code is there if anyone wants to pick up after where I stopped.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Documentation
...So this is where this thread was relocated to.