ZScript Discussion

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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.

Re: ZScript Discussion

Postby Major Cooke » Mon Jun 05, 2017 12:33 pm

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.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript Discussion

Postby Illasera » Tue Jun 06, 2017 5:58 am

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.


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.
Thank you.
Illasera
Software Engineer
 
Joined: 11 May 2017

Re: ZScript Discussion

Postby Blue Shadow » Sat Jul 01, 2017 4:49 pm

From here:

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.

I'd like to know the difference between the two, please.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010

Re: ZScript Discussion

Postby Marrub » Sun Jul 02, 2017 2:19 am

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.
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion

Re: ZScript Discussion

Postby Graf Zahl » Sun Jul 02, 2017 4:37 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Major Cooke » Wed Jul 05, 2017 7:14 am

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.


Nope and nope.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript Discussion

Postby Marrub » Wed Jul 05, 2017 3:01 pm

Major Cooke wrote:
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.


Nope and nope.

Okay. Can you explain why EventHandler.Create doesn't exist anymore? It would be quite useful right now.
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion

Re: ZScript Discussion

Postby Marrub » Thu Jul 06, 2017 8:53 am

Nevermind that, apparently MAPINFO ignores unknown properties, so I can use it anyway.
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion

Re: ZScript Discussion

Postby UsernameAK » Thu Jul 06, 2017 9:59 am

How to send a netevent by activating a linedef?
User avatar
UsernameAK
Cat
 
Joined: 15 Jul 2015
Location: Ukraine
Discord: /bin/cat#8891

Re: ZScript Discussion

Postby Graf Zahl » Fri Jul 07, 2017 3:54 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby UsernameAK » Fri Jul 07, 2017 4:27 am

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 allExpand view
Line 25 in file "/tmp/SLADE3/SCRIPTS.acs" ...
/tmp/SLADE3/SCRIPTS.acs:25: Function scriptcall is used but not defined.

Well, how to get this function?
User avatar
UsernameAK
Cat
 
Joined: 15 Jul 2015
Location: Ukraine
Discord: /bin/cat#8891

Re: ZScript Discussion

Postby Gutawer » Fri Jul 07, 2017 4:52 am

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
User avatar
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: ZScript Discussion

Postby Major Cooke » Fri Jul 07, 2017 8:20 am

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)
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript Discussion

Postby UsernameAK » Fri Jul 07, 2017 9:36 am

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 allExpand view
special -210:ScriptCall(5);

I have just wrote this in my code
User avatar
UsernameAK
Cat
 
Joined: 15 Jul 2015
Location: Ukraine
Discord: /bin/cat#8891

Re: ZScript Discussion

Postby UsernameAK » Tue Jul 11, 2017 6:02 am

How to check for ZScript support thru ACS and use a fallback way if it isn't supported?
User avatar
UsernameAK
Cat
 
Joined: 15 Jul 2015
Location: Ukraine
Discord: /bin/cat#8891

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests