ZScript Documentation

Handy guides on how to do things, written by users for users.

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.
User avatar
Kinsie
Posts: 7333
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33

Re: ZScript Documentation

Post by Kinsie »

Major Cooke wrote:As for the zscript pages missing the wiki category, well, I'm not the sharpest tool in the shed for that kind of thing. Perhaps someone can help me out with that?
It's pretty easy for what you have right now. Just add [[Category:ZScript]] to the bottom of each of the pages you want in the category. Then open up the new Category:ZScript page and add something like this to it:

Code: Select all

This category is for articles related to the [[ZScript]] content definition and scripting language.
[[Category:Editing concepts]][[Category:Features]]
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: ZScript Documentation

Post by Xaser »

Currently adding categories for the ZScript pages thus far. I'm modeling it after the ones used in DECORATE, so hopefully it's all kosher.

[EDIT] Well, I got it mostly done. The wiki decided that I was adding categories to pages too quickly and is now throttling my edit attempts. :x

[DOUBLE-EDIT] Apparently 10 minutes is not enough time to wait. I'm still getting "Action Throttled", and I'm afraid this is going to turn into yet another "your account no longer works" situation.

I wish there was a randi-alarm we could pull. How the blazes am I supposed to contribute anything if the wiki keeps rejecting my edits?
Gez
 
 
Posts: 17685
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZScript Documentation

Post by Gez »

You need to make a mod out of this. Xaser's Wikid Adventures.


I have no idea what user rights you'd need in order not to get this message. There's no documentation about it that I could find.
User avatar
Xaser
 
 
Posts: 10771
Joined: Sun Jul 20, 2003 12:15 pm

Re: ZScript Documentation

Post by Xaser »

If I had the free time to do so, I'd totally make that mod and use it as a vehicle to serve up ZScript documentation,just to take the piss. :P


I'm kinda curious if there's something fuggy going on which is causing stuff to get stuck in the cache (e.g. login attempts, timeouts, whatnot; would explain the earlier shenanigans). I'll wait a few hours before retrying an edit just to make sure the throttling timeout isn't set to something silly like an hour or something.
User avatar
Major Cooke
Posts: 8089
Joined: Sun Jan 28, 2007 3:55 pm

Re: ZScript Documentation

Post by Major Cooke »

And win the next mockaward. :P

I haven't had any issues doing anything myself though. Odd.
D2JK
Posts: 537
Joined: Sat Aug 30, 2014 8:21 am

Re: ZScript Documentation

Post by D2JK »

I vaguely remember someone posting a ZScript code snippet like this:

Code: Select all

Actor Test = A_SpawnItemEx("Shotgun");
In this form it gives me an error, but if this sort of thing is supposed to work, what would the fixed version look like?
User avatar
Major Cooke
Posts: 8089
Joined: Sun Jan 28, 2007 3:55 pm

Re: ZScript Documentation

Post by Major Cooke »

If you really want it to work like that, you can use SXF_IS<TARGET/MASTER/TRACER>.

Or you use the Spawn command itself, instead of A_SpawnItemEx.
D2JK
Posts: 537
Joined: Sat Aug 30, 2014 8:21 am

Re: ZScript Documentation

Post by D2JK »

I was intending to test if I could eventually spawn multiple actors, and control their properties immediately after spawning them. If I use the flags you mentioned, the calling actor should only have a single actor in the specified pointer field.

What's the difference if I use the Spawn - command? Would it allow the code above to work?

I'll try to look for the post in which the code was originally mentioned, I think it might have been somewhere in the ZScript discussion thread.
User avatar
Major Cooke
Posts: 8089
Joined: Sun Jan 28, 2007 3:55 pm

Re: ZScript Documentation

Post by Major Cooke »

Spawn() returns the actor to the pointer. But it does nothing more than spawn the actor as that pointer. You will have to transfer over everything else yourself, and I should note that through the Spawn() method, you cannot transfer blood color!

Blood color is read-only. A_SpawnItemEx is the only function set up to change that.
User avatar
Major Cooke
Posts: 8089
Joined: Sun Jan 28, 2007 3:55 pm

Re: ZScript Documentation

Post by Major Cooke »

I just spent some time editing in the virtual functions for thinker and actor.
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: ZScript Documentation

Post by Enjay »

Don't suppose there is any word of anyone planning to create a DECORATE to ZScript conversion program of any sort is there? There doesn't seem to be anything too complicated in the conversion process but if someone has a few thousand lines of DECORATE code to convert, it would be tedious and time consuming.
User avatar
Major Cooke
Posts: 8089
Joined: Sun Jan 28, 2007 3:55 pm

Re: ZScript Documentation

Post by Major Cooke »

Welcome to my world. Now you know how I felt converting D4D. :P

Also a 1:1 conversion is impossible I'm afraid. You might be able to get away with something that encapsulates properties and what not into having "" around the value, but with the inclusion of the Default { } block, and the fact people could include vars at any location in DECORATE, I don't see that happening. And that's just one reason... There's plenty more.

Want some advice for making things easier? Replace the replaceable first. Use keywords to help you out. 'Whole word' options are a wonderful thing at some points. I.e. when searching for x, y and z to turn into pos.x etc.
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: ZScript Documentation

Post by Enjay »

Thanks for the advice. Shame it's not a simple 1:1, or even simple enough to have most of it done and an error list/list of items to be fixed generated.

Out of interest, is (G)ZDoom doing a conversion internally or does it still support DECORATE as is?
User avatar
Major Cooke
Posts: 8089
Joined: Sun Jan 28, 2007 3:55 pm

Re: ZScript Documentation

Post by Major Cooke »

It was built with the ability to handle Decorate functions.

See here.
Gez
 
 
Posts: 17685
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZScript Documentation

Post by Gez »

A few things:
  1. DECORATE and ZScript have the same backend. Once it's compiled there is no difference for the engine whether something was coded in DECORATE or ZScript.
  2. There's no need to convert stuff just for the purpose of having converted it. Only convert what you need to convert.
  3. DECORATE will remain forever supported.

Return to “Tutorials”