ZScript Documentation

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Re: ZScript Documentation

Postby Kinsie » Thu Dec 08, 2016 9:03 am

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 allExpand view
This category is for articles related to the [[ZScript]] content definition and scripting language.
[[Category:Editing concepts]][[Category:Features]]
User avatar
Kinsie
Dog Days
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: ZScript Documentation

Postby Xaser » Thu Dec 08, 2016 10:38 am

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?
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: ZScript Documentation

Postby Gez » Thu Dec 08, 2016 12:36 pm

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

Re: ZScript Documentation

Postby Xaser » Thu Dec 08, 2016 12:42 pm

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
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: ZScript Documentation

Postby Major Cooke » Thu Dec 08, 2016 3:34 pm

And win the next mockaward. :P

I haven't had any issues doing anything myself though. Odd.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Documentation

Postby D2JK » Fri Dec 09, 2016 8:26 am

I vaguely remember someone posting a ZScript code snippet like this:
Code: Select allExpand view
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?
D2JK
 
Joined: 30 Aug 2014

Re: ZScript Documentation

Postby Major Cooke » Fri Dec 09, 2016 8:27 am

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.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Documentation

Postby D2JK » Fri Dec 09, 2016 8:35 am

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.
D2JK
 
Joined: 30 Aug 2014

Re: ZScript Documentation

Postby Major Cooke » Fri Dec 09, 2016 8:46 am

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
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Documentation

Postby Major Cooke » Sun Dec 11, 2016 3:36 pm

I just spent some time editing in the virtual functions for thinker and actor.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Documentation

Postby Enjay » Sun Dec 11, 2016 4:10 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: ZScript Documentation

Postby Major Cooke » Sun Dec 11, 2016 4:14 pm

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
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Documentation

Postby Enjay » Sun Dec 11, 2016 4:21 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: ZScript Documentation

Postby Major Cooke » Sun Dec 11, 2016 4:24 pm

It was built with the ability to handle Decorate functions.

See here.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Documentation

Postby Gez » Sun Dec 11, 2016 4:32 pm

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

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests