ZScript Documentation

Discuss all aspects of editing for ZDoom.
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.

Re: ZScript Documentation

Postby Graf Zahl » Tue Jun 20, 2017 4:15 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Documentation

Postby Kinsie » Tue Jun 20, 2017 3:40 pm

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.
Thanks for this, cleans things up a little bit.
User avatar
Kinsie
No Less Vile...
 
Joined: 22 Oct 2004
Location: In The Cold

Re: ZScript Documentation

Postby Major Cooke » Sun Jul 16, 2017 2:11 pm

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.
User avatar
Major Cooke
Slow yet powerful ZScript modder.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript Documentation

Postby Nash » Sun Jul 16, 2017 7:57 pm

Curious... if multi-return is a LUA feature, how did ZDoom do multi-returns in C++ before?
User avatar
Nash
Nash Muhandes [Audio Engineer | Game Designer | Scripting]
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: ZScript Documentation

Postby Gutawer » Mon Jul 17, 2017 7:00 am

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.
User avatar
Gutawer
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: ZScript Documentation

Postby Gez » Mon Jul 17, 2017 9:57 am

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
Gez
 
Joined: 06 Jul 2007

Re: ZScript Documentation

Postby Major Cooke » Fri Jul 21, 2017 4:29 pm

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...
User avatar
Major Cooke
Slow yet powerful ZScript modder.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript Documentation

Postby UsernameAK » Tue Jul 25, 2017 2:43 pm

I think there's need for JavaDoc-like documentation generator for ZScript.
UsernameAK
 
Joined: 15 Jul 2015
Location: Ukraine

Previous

Return to Editing

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], mikolah, wildweasel, Yandex [Bot] and 3 guests