Page 3 of 3

Re: ZScript Language Documentation (WIP)

PostPosted: Sun Nov 25, 2018 1:51 pm
by Marrub
Player701 wrote:
Marrub wrote:Thanks, rewrote the description. Apparently I wrote the description before I knew what PClass was, so now it actually tells you properly what it does.

Thank you too. A minor correction, though: right now it is not required to mark the returned value as transient, though I wish it were. Apparently, it is not that easy to implement because it's difficult to tell what objects are supposed to be serialized (and would thus need to enforce this rule) and what aren't. I would definitely recommend marking these fields transient, though - makes the code easier to understand.

The document refers to what the user must do to not cause erroneous behaviour, so the current wording is correct.

Re: ZScript Language Documentation (WIP)

PostPosted: Sun Dec 30, 2018 4:03 pm
by Marrub
Updated existing documentation for 3.7.0 including the new flagdef keyword, finished documentation for TexMan, State and Font, and documented Screen.DrawTexture & Screen.VirtualToRealCoords. I also have split the files so as to make it easier to read.

Re: ZScript Language Documentation (WIP)

PostPosted: Sun Dec 30, 2018 4:52 pm
by Major Cooke
Masterful stuff man. This is exceptionally handy. Well done!

Re: ZScript Language Documentation (WIP)

PostPosted: Mon Dec 31, 2018 8:43 am
by Marrub
Major Cooke wrote:Masterful stuff man. This is exceptionally handy. Well done!

Thanks. If there's anything you need documented feel free to suggest or make a pull request.

Re: ZScript Language Documentation (WIP)

PostPosted: Sat Feb 02, 2019 4:40 pm
by Major Cooke
Dynamic Arrays: Whenever changing the size of one, it's important to immediately initialize anything new, unless it was Push()'d. I just tested it: trying to check the new stuff after doing a Reserve crashes GZDoom. Best to record the old size and, after the array grows bigger, fill it with default values - in particular, object arrays with nulls. Otherwise GZDoom looks into an empty container and just dies.

Perhaps that should be added as a warning on the dynamic array page?

Re: ZScript Language Documentation (WIP)

PostPosted: Sat Feb 02, 2019 8:21 pm
by Marrub
Major Cooke wrote:Dynamic Arrays: Whenever changing the size of one, it's important to immediately initialize anything new, unless it was Push()'d. I just tested it: trying to check the new stuff after doing a Reserve crashes GZDoom. Best to record the old size and, after the array grows bigger, fill it with default values - in particular, object arrays with nulls. Otherwise GZDoom looks into an empty container and just dies.

Perhaps that should be added as a warning on the dynamic array page?

I've expanded the description to clarify how it works more exactly.

Re: ZScript Language Documentation (WIP)

PostPosted: Mon Feb 11, 2019 1:57 pm
by Major Cooke
Documentation wrote:Adds amount new empty-constructed objects at the end of the array, increasing Size and calling Grow if necessary. Value types are initialized to zero and reference types to null.


If you do a reserve on an object array in ZScript and then try null checking inside it without manual initialization, it will crash. Might be something to do with a difference between an internal null and ZScript null?

Whatever the case, it must be manually initialized or it will kill the game.

Re: ZScript Language Documentation (WIP)

PostPosted: Tue Feb 12, 2019 1:30 am
by Marrub
Major Cooke wrote:
Documentation wrote:Adds amount new empty-constructed objects at the end of the array, increasing Size and calling Grow if necessary. Value types are initialized to zero and reference types to null.


If you do a reserve on an object array in ZScript and then try null checking inside it without manual initialization, it will crash. Might be something to do with a difference between an internal null and ZScript null?

Whatever the case, it must be manually initialized or it will kill the game.

This sounds like an engine bug, which shouldn't be documented. I suggest reporting it. (If it isn't a bug, I'll add clarification.)

Re: ZScript Language Documentation (WIP)

PostPosted: Mon Jun 24, 2019 11:59 pm
by Josko
So still not finished eh? You still working on it? ^^

Re: ZScript Language Documentation (WIP)

PostPosted: Tue Jun 25, 2019 2:26 am
by Marrub
Josko wrote:So still not finished eh? You still working on it? ^^

Not at the moment, I have other projects taking priority, and lots of real-life stuff going on.

Re: ZScript Language Documentation (WIP)

PostPosted: Tue Jun 25, 2019 2:50 am
by Josko
Alright, understandable :)

But how far on is this documentation? How much " Complete " is it? :P

Re: ZScript Language Documentation (WIP)

PostPosted: Tue Jun 25, 2019 2:53 am
by Marrub
Josko wrote:Alright, understandable :)

But how far on is this documentation? How much " Complete " is it? :P

It depends on what you need it for. Some parts of the documentation are very complete, whereas others are quite lacking and ridden with to-do markers.