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!)
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
That's pretty much the easiest way to debug, by printing out the variable. Here's a page you can use to convert from many types to a string for printing if needed.
-
- Posts: 20
- Joined: Thu May 11, 2017 7:22 am
Re: ZScript Discussion
Well i guess i will have to deal with it with that method, not exactly what i had in mind but if there are no other ways, that will do.Major Cooke wrote:That's pretty much the easiest way to debug, by printing out the variable. Here's a page you can use to convert from many types to a string for printing if needed.
Thank you.
-
- Posts: 5027
- Joined: Sun Nov 14, 2010 12:59 am
Re: ZScript Discussion
From here:
I'd like to know the difference between the two, please.Graf Zahl wrote:No. Do not move Tick to DoEffect. The code must still be called from the player's Tick() function. The calling semantics, even though similar, are not identical.
-
-
- Posts: 1198
- Joined: Tue Feb 26, 2013 2:48 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Arch Linux
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: ZScript Discussion
Is there any way to add an event handler without MAPINFO? I can't add such a thing because it needs to work in earlier versions where ZScript (and thus event handlers) didn't exist.
There is an EventHandler.Create function mentioned in a comment, but no such function actually exists.
There is an EventHandler.Create function mentioned in a comment, but no such function actually exists.
-
- Lead GZDoom+Raze Developer
- Posts: 49177
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Blue Shadow wrote: I'd like to know the difference between the two, please.
DoEffect is called from the owner's Tick function to ensure that all is done in a defined order. If you do some bookkeeping in there it may get mixed with other DoEffect functions by real inventory items so that the actual state of the player may only be partially affected by them when your function gets called.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Nope and nope.Marrub wrote:Is there any way to add an event handler without MAPINFO? I can't add such a thing because it needs to work in earlier versions where ZScript (and thus event handlers) didn't exist.
There is an EventHandler.Create function mentioned in a comment, but no such function actually exists.
-
-
- Posts: 1198
- Joined: Tue Feb 26, 2013 2:48 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Arch Linux
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: ZScript Discussion
Okay. Can you explain why EventHandler.Create doesn't exist anymore? It would be quite useful right now.Major Cooke wrote:Nope and nope.Marrub wrote:Is there any way to add an event handler without MAPINFO? I can't add such a thing because it needs to work in earlier versions where ZScript (and thus event handlers) didn't exist.
There is an EventHandler.Create function mentioned in a comment, but no such function actually exists.
-
-
- Posts: 1198
- Joined: Tue Feb 26, 2013 2:48 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Arch Linux
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: ZScript Discussion
Nevermind that, apparently MAPINFO ignores unknown properties, so I can use it anyway.
-
- Posts: 83
- Joined: Wed Jul 15, 2015 5:26 am
- Location: Ukraine
Re: ZScript Discussion
How to send a netevent by activating a linedef?
-
- Lead GZDoom+Raze Developer
- Posts: 49177
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
At the moment you cannot define any direct interactions between a linedef trigger and ZScript so you have to go through ACS and call a custom ZScript function through there.
-
- Posts: 83
- Joined: Wed Jul 15, 2015 5:26 am
- Location: Ukraine
Re: ZScript Discussion
Graf Zahl wrote:At the moment you cannot define any direct interactions between a linedef trigger and ZScript so you have to go through ACS and call a custom ZScript function through there.
Code: Select all
Line 25 in file "/tmp/SLADE3/SCRIPTS.acs" ...
/tmp/SLADE3/SCRIPTS.acs:25: Function scriptcall is used but not defined.
-
- Posts: 469
- Joined: Sat Apr 16, 2016 6:01 am
- Preferred Pronouns: She/Her
Re: ZScript Discussion
You'll need an ACS compiler that's up-to-date enough to support it. I'd recommend gdcc-acc, it comes with multiple benefits over normal acc: viewtopic.php?f=44&t=32078
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Graf, is it safe to introduce our own STAT_ numbers for thinkers? (I.e. using 7 for a stat number) Also, is there a set range for thinkers where the Tick function is not automatically called, besides 1 through 6 (STAT_INFO to STAT_STATIC)
-
- Posts: 83
- Joined: Wed Jul 15, 2015 5:26 am
- Location: Ukraine
Re: ZScript Discussion
Gutawer wrote:You'll need an ACS compiler that's up-to-date enough to support it. I'd recommend gdcc-acc, it comes with multiple benefits over normal acc: viewtopic.php?f=44&t=32078
Code: Select all
special -210:ScriptCall(5);
-
- Posts: 83
- Joined: Wed Jul 15, 2015 5:26 am
- Location: Ukraine
Re: ZScript Discussion
How to check for ZScript support thru ACS and use a fallback way if it isn't supported?