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: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Menus will eventually be moved to scripts, but at least will be expandable with scripts. I actually think I am doing that next because I made no progress with the status bar stuff so far and the menus appear to be something that's a lot less time consuming.
But if I move them, nothing about the event dispatching will change.
But if I move them, nothing about the event dispatching will change.
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
I was actually referring to the fact that if menus are implemented as EventHandlers, then they are simply static handlers with high order, which means it's possible to put something above that order.
Although that indeed sounds like a hack, because the proper way (as I'm seeing it, correct me if I'm wrong) is that there should be something like class BaseMenu : StaticEventHandler, which would have virtual methods for displaying/processing certain menus, so that we could somehow actually replace the main menu with something else (say, Doom3-like main menu with buttons lined up in the bottom as opposed to having a list with M_SKULL).
And then that thing could be added to EventHandlers for the menu system to pick it up and display if present, and otherwise use the regular BaseMenu.
Although that indeed sounds like a hack, because the proper way (as I'm seeing it, correct me if I'm wrong) is that there should be something like class BaseMenu : StaticEventHandler, which would have virtual methods for displaying/processing certain menus, so that we could somehow actually replace the main menu with something else (say, Doom3-like main menu with buttons lined up in the bottom as opposed to having a list with M_SKULL).
And then that thing could be added to EventHandlers for the menu system to pick it up and display if present, and otherwise use the regular BaseMenu.
Last edited by ZZYZX on Fri Feb 03, 2017 6:17 am, edited 1 time in total.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
I won't change how they receive events, the entire method with M_Responder is too deeply ingrained in how Doom works and changing it to something different may cause unwanted regressions.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Which is why in D4D I rely on KEYCONF aliases to do this instead.ZZYZX wrote:You can eat an event by returning true in the event handler.
Handlers' order (set by Order field) determines what handlers get to processing first. If one of them eats the event, it won't get lower.
Now the problem is that the handlers are processed after console and menu, so I don't think you currently can prevent the menu from appearing altogether.
If they can be made flexible and update real time instead of upon GAME start-up, that would be huge.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Graf, quick question about SpecialMissileHit...
Return value of -1 means it explodes.
Return value of 1 means it passes through.
Return value of 0 means what?
Return value of -1 means it explodes.
Return value of 1 means it passes through.
Return value of 0 means what?
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
Code: Select all
switch (tm.thing->SpecialMissileHit(thing))
{
case 0: return false;
case 1: return true;
default: break;
}
-
- Posts: 469
- Joined: Sat Apr 16, 2016 6:01 am
- Preferred Pronouns: She/Her
Re: ZScript Discussion
I want to create a function which takes an array (of any size) as one of its arguments - I noticed that a function will not complain about
being an invalid variable type (obviously has other errors, which is why I'm here, heh), and if I move that line outside of a function definition, it just complains about dynamic arrays not being implemented yet - does this mean I should just wait to be able to do this or is there some current way to do it?
Code: Select all
array<string> excludes
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
There is no current way to do it. The feature simply hasn't been implemented yet and it misses to report that for function parameters.
-
- Posts: 469
- Joined: Sat Apr 16, 2016 6:01 am
- Preferred Pronouns: She/Her
Re: ZScript Discussion
Alright, thank you. I will wait then
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
If I'm looking at the changelogs correctly, is this the basic stuff needed in order to proceed with menus and/or sbarinfo?
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Discussion
Menus.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Graf, do you plan on introducing some form of scaling or alpha setting ability with the DrawText(ure) and DrawChar?
I ask because ACS can do both with HUDMessage.
I ask because ACS can do both with HUDMessage.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
They already can do everything the internal functions can do. Keep in mind that this is the absolute lowest level of the 2D drawer interface which is being used for everything, including HUD messages. For the time being, due to lack of documentation youll have to sift through the tags yourself, though.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Also, how can we use these draw function? This is something we're going to need an example of that I'd like to make for everyone.
Last edited by Major Cooke on Sun Feb 05, 2017 10:25 am, edited 1 time in total.
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
There's this DrawPowerup function that can be used as an entrypoint for drawing things on the screen, but it'd be way more correct if Graf pulled my branch and gave us RenderOverlay