ZScript Discussion
Moderator: GZDoom Developers
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
The draw functions are not tested yet. I'll need them for the menu which will also be used to test their functionality. But I needed this stuff somewhat operational to start.
If you want to see how they are used, check the C++ source.
If you want to see how they are used, check the C++ source.
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
TAG_DONE is not exported, and using it without TAG_DONE causes an exception.
Why is TAG_DONE needed in ZScript anyway, if you can tell the argument count directly?
Anyway, passing 0 as TAG_DONE works for now.
Why is TAG_DONE needed in ZScript anyway, if you can tell the argument count directly?
Anyway, passing 0 as TAG_DONE works for now.
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Turns out the only way to draw them right now is with powerup's DrawPowerup function...
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
ZZYZX wrote:TAG_DONE is not exported, and using it without TAG_DONE causes an exception.
Why is TAG_DONE needed in ZScript anyway, if you can tell the argument count directly?
Anyway, passing 0 as TAG_DONE works for now.
Like I said, it hasn't been tested yet. I want this to work without TAG_DONE, because a VM function knows the amount of parameters it gets. There's probably some other issues present, too.
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
Pretty sure if you hack around with named function arguments (I remember there's such thing?) it's probably possible to omit using tags altogether. Just a random idea. I personally don't feel like extending varargs to named arguments if anything :)
P.S. http://pastebin.com/RUKRBCSh
Produces results like http://i.imgur.com/lOXhXOx.png
Going to randomly use this while streaming on twitch :P
(also whoever is interested can take an example of calling DrawText from there, for people unfamiliar with how text rendering has always worked internally)
(ignore the class, what you need is inside the RenderOverlay function. with current GZDoom's codebase, you can override DrawPowerup method in Inventory or Powerup subclasses)
P.S. http://pastebin.com/RUKRBCSh
Produces results like http://i.imgur.com/lOXhXOx.png
Going to randomly use this while streaming on twitch :P
(also whoever is interested can take an example of calling DrawText from there, for people unfamiliar with how text rendering has always worked internally)
(ignore the class, what you need is inside the RenderOverlay function. with current GZDoom's codebase, you can override DrawPowerup method in Inventory or Powerup subclasses)
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Just a quick warning: The dynamic array code I just committed is not finished yet! While I verified that the code generator is doing what is needed, the backend for the arrays does not exist yet, they will leak memory and may even crash!
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
I'll hold off until you give the all-clear.
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: ZScript Discussion
I see that you are setting the screen's virtual width and height twice to achieve different text sizes? Will this be the only way or will there be a more convenient way to simply specify the size of the text?ZZYZX wrote: (also whoever is interested can take an example of calling DrawText from there, for people unfamiliar with how text rendering has always worked internally)
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
GZDoom does it that way.Nash wrote:I see that you are setting the screen's virtual width and height twice to achieve different text sizes? Will this be the only way or will there be a more convenient way to simply specify the size of the text?ZZYZX wrote: (also whoever is interested can take an example of calling DrawText from there, for people unfamiliar with how text rendering has always worked internally)
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Nash wrote:I see that you are setting the screen's virtual width and height twice to achieve different text sizes? Will this be the only way or will there be a more convenient way to simply specify the size of the text?ZZYZX wrote: (also whoever is interested can take an example of calling DrawText from there, for people unfamiliar with how text rendering has always worked internally)
DrawTexture and DrawText are low level functions. This is what sits at the very bottom of all 2D rendering in the game and makes no assumptions whatsoever. It requires explicit specification of any option you need.
For higher level output it is normal to wrap this into helper functions that do the necessary bookkeeping.
-
- Posts: 7
- Joined: Sat Dec 10, 2016 9:31 am
Re: ZScript Discussion
Saw in one posts the use of the "player" and "playeringame" arrays. Are them builtin?
-
-
- Posts: 10773
- Joined: Sun Jul 20, 2003 12:15 pm
Re: ZScript Discussion
Yep, those are built-in globals.
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
Once the event system is in I could write a proper library-like wrapper for the drawing functions and contribute that to the ZScript library, with SetHudSize, and overall more ACS-like interface.
I don't think this should belong to the core library anyway.
ALSO: I heard there's some way to create a class instance using new or smth.
How do I make a class that's not possible to 'new'?
I don't think this should belong to the core library anyway.
ALSO: I heard there's some way to create a class instance using new or smth.
How do I make a class that's not possible to 'new'?
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
So out of curiosity, Graf, what will the type system overhauling amount to besides memory reduction?
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Maintainability.. That thing was crashing so often during development that I just got tired.
I'll never understand why Randi cooked up a system where the type descriptors for the garbage collected objects are themselves garbage collected, with some circular dependencies. I've got it now to a state where all the backing data is guaranteed to not to be touched by the GC ever, so that a complete takedown will no longer resuit in random crashes if I just happen to change the wrong thing.
This was because making the menu items objects caused some random GC related crashes but the over 9000 objects that got allocated during script compilation made it impossible to find what was wrong.
I'll never understand why Randi cooked up a system where the type descriptors for the garbage collected objects are themselves garbage collected, with some circular dependencies. I've got it now to a state where all the backing data is guaranteed to not to be touched by the GC ever, so that a complete takedown will no longer resuit in random crashes if I just happen to change the wrong thing.
This was because making the menu items objects caused some random GC related crashes but the over 9000 objects that got allocated during script compilation made it impossible to find what was wrong.