[ZScript] Ported Action functions

Post your example zscripts/ACS scripts/etc here.

[ZScript] Ported Action functions

Postby Kizoky » Wed Jan 06, 2021 4:34 am

What's the purpose of this?
Maybe you want to study how A_Chase works in GZDoom, or maybe A_LookEx but without having to look up the original source code?

Or maybe you want to create your own A_Chase on top of the original one?

Here is a collection of action functions that aren't exposed to ZScript, but can be ported.
Note: I'm trying my best to retain the way the original code is written along with comments, so it shouldn't be confusing when compared to C++ implementation

A_Chase: https://github.com/Kizoky/CPPtoZScript/ ... _Chase.txt
A_LookEx: https://github.com/Kizoky/CPPtoZScript/ ... LookEx.txt
A_Wander: https://github.com/Kizoky/CPPtoZScript/ ... Wander.txt

Alternatively you can look below for downloading them

Credits: phantombeta for originally porting A_Chase in the first place
You do not have the required permissions to view the files attached to this post.
Last edited by Kizoky on Thu Apr 08, 2021 11:30 pm, edited 5 times in total.
User avatar
Kizoky
I smell like gravity
 
Joined: 14 Nov 2011
Location: Around weirdos, I'm the biggest weirdo among them
Discord: Kizoky#0375
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Ported A_Chase

Postby FranjeGueje » Fri Feb 05, 2021 5:18 am

Thank you, very useful for me.

I am developing a new behavior and I need information about "Chase" and about "SetGoal".
User avatar
FranjeGueje
 
Joined: 05 Feb 2021
Location: Spain
Github ID: FranjeGueje
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [ZScript] Ported A_Chase

Postby Xtyfe » Wed Apr 07, 2021 7:01 am

Ohhh man this is unbelievably useful! How hard would it be to do a port of A_LookEx?
User avatar
Xtyfe
Neque Deos, Neque Dominos
 
Joined: 14 Dec 2007
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Ported A_Chase

Postby Kizoky » Wed Apr 07, 2021 11:06 pm

Xtyfe wrote:Ohhh man this is unbelievably useful! How hard would it be to do a port of A_LookEx?


Depends on if every function in A_LookEx is available (exposed to) in ZScript
From the looks of it it's possible to port it, it's in p_enemy.cpp (at line 1874)

Edit:
I ported A_LookEx, here's a link for it here: https://github.com/Kizoky/CPPtoZScript/ ... LookEx.txt
Hopefully I didn't mess up anything with it
User avatar
Kizoky
I smell like gravity
 
Joined: 14 Nov 2011
Location: Around weirdos, I'm the biggest weirdo among them
Discord: Kizoky#0375
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Ported Action functions

Postby Xtyfe » Thu Apr 08, 2021 2:01 pm

Wow, using redefined functions vs the hacky and probably unsupported method I was using before is so much easier. Thank you for this.
User avatar
Xtyfe
Neque Deos, Neque Dominos
 
Joined: 14 Dec 2007
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Ported Action functions

Postby Xtyfe » Wed Apr 14, 2021 4:57 pm

I finally got a chance to try these out and without making my own modifications, they don't work as-is. When adding them to an actor, they don't seem to work without any arguments set like the regular functions do. For example, when I do set arguments for A_PortedLookEx, it errors out when using "See" for the seestate variable. If I use seestate instead it does work but monsters wont react to seeing me, only hearing me. A_PortedChase does work without arguments but monsters wont attack me.
User avatar
Xtyfe
Neque Deos, Neque Dominos
 
Joined: 14 Dec 2007
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Ported Action functions

Postby Kizoky » Fri Apr 16, 2021 2:19 pm

Xtyfe wrote:I finally got a chance to try these out and without making my own modifications, they don't work as-is. When adding them to an actor, they don't seem to work without any arguments set like the regular functions do. For example, when I do set arguments for A_PortedLookEx, it errors out when using "See" for the seestate variable. If I use seestate instead it does work but monsters wont react to seeing me, only hearing me. A_PortedChase does work without arguments but monsters wont attack me.


Ouch. There must be something that I screwed up accidentally, I'll look into it asap
User avatar
Kizoky
I smell like gravity
 
Joined: 14 Nov 2011
Location: Around weirdos, I'm the biggest weirdo among them
Discord: Kizoky#0375
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests