Page 3 of 9
Re: ZScript Documentation
Posted: Thu Dec 08, 2016 9:03 am
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]]
Re: ZScript Documentation
Posted: Thu Dec 08, 2016 10:38 am
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.
[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?
Re: ZScript Documentation
Posted: Thu Dec 08, 2016 12:36 pm
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.
Re: ZScript Documentation
Posted: Thu Dec 08, 2016 12:42 pm
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.
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.
Re: ZScript Documentation
Posted: Thu Dec 08, 2016 3:34 pm
by Major Cooke
And win the next mockaward.
I haven't had any issues doing anything myself though. Odd.
Re: ZScript Documentation
Posted: Fri Dec 09, 2016 8:26 am
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?
Re: ZScript Documentation
Posted: Fri Dec 09, 2016 8:27 am
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.
Re: ZScript Documentation
Posted: Fri Dec 09, 2016 8:35 am
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.
Re: ZScript Documentation
Posted: Fri Dec 09, 2016 8:46 am
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.
Re: ZScript Documentation
Posted: Sun Dec 11, 2016 3:36 pm
by Major Cooke
I just spent some time editing in the
virtual functions for thinker and actor.
Re: ZScript Documentation
Posted: Sun Dec 11, 2016 4:10 pm
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.
Re: ZScript Documentation
Posted: Sun Dec 11, 2016 4:14 pm
by Major Cooke
Welcome to my world. Now you know how I felt converting D4D.
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.
Re: ZScript Documentation
Posted: Sun Dec 11, 2016 4:21 pm
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?
Re: ZScript Documentation
Posted: Sun Dec 11, 2016 4:24 pm
by Major Cooke
It was built with the ability to handle Decorate functions.
See here.
Re: ZScript Documentation
Posted: Sun Dec 11, 2016 4:32 pm
by Gez
A few things:
- 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.
- There's no need to convert stuff just for the purpose of having converted it. Only convert what you need to convert.
- DECORATE will remain forever supported.