[ZScript] Port of DaZombieKiller's footsteps

Post your example zscripts/ACS scripts/etc here.

[ZScript] Port of DaZombieKiller's footsteps

Postby vsonnier » Mon Jun 24, 2019 11:39 pm

This is a port of DAZombieKiller's Footsteps code in pure Zscript, see here for the original: https://github.com/DaZombieKiller/zk-resources ,or here for it's discussion: viewtopic.php?f=105&t=35388

It uses the same structure as the original for configuration and resources: CVARINFO, LANGUAGE, MENUDEF, SNDINFO + sounds/foutsteps...etc but the code itself is pure Zscript and do not use the GDCC compiler for an ACS/C hybrid.

I wanted initially to re-compile/modify DaZombieKiller Footsteps but never managed to to it properly with the latest GDCC 0.16.1 so I wanted an equivalent in ZScript. The reason DaZombieKiller Footsteps is using GDCC instead of a "simple" ACS compiler is to be able to call C strtok-like functions to parse the configuration and associate textures <==> sounds.
In Zscript however it is easier using String.Split and other string manipulation functions.

So the only remaining problem was to find an equivalent to ACS CheckActorFloorTexture, or rather finding the texture the player was stepping in, in Zscript.

Graf suggested using checking Actor's`floorpic` and it works, so here it is !

The script parses the same configuration data as DaZombieKiller Footsteps and uses the same resource files structure as his, so can be used as a replacement of it's ACS module while keeping the rest of the structure.
Except REMOVE the module from the LOADACS list or you will get twice the footsteps effects :)

(The initial discussion is here : viewtopic.php?f=122&t=65137. I should have started that topic direclty here but it"s too late now so this present topic is essentially a cross-post suggested by the moderators. I won't do that again, promise.)
Attachments
Footsteps3.txt
Port of ZombieKiller's footsteps in Zscript, v3
(4.46 KiB) Downloaded 33 times
vsonnier
 
Joined: 11 Apr 2019
Github ID: vsonnier
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Port of DaZombieKiller's footsteps

Postby Kinsie » Mon Jun 24, 2019 11:43 pm

This is great! Transitioned MetaDoom from the old ACS script to this yesterday. Thanks so much for doing this!
User avatar
Kinsie
A Concept Utterly Obsolete
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: [ZScript] Port of DaZombieKiller's footsteps

Postby vsonnier » Mon Jun 24, 2019 11:53 pm

This is great! Transitioned MetaDoom from the old ACS script to this yesterday. Thanks so much for doing this!


You are welcome :) However, Graf said that Actor's `floorpic` is "not 100% portal-safe" whatever that meant. It worked well enough for me.

Another advantage I didn't mention is that the Zscript version should be quite faster than the ACS one: The configuration is parsed only once, not each time a sound is to be played. Plus, the search for the right texture is only a linear array<int>::Find() among ids, while the ACS checked every single parsed texture by CheckActorFloorTexture until it returned true. And from what I see in GZDoom code, CheckActorFloorTexture is not cheap, checking geometry and such.
vsonnier
 
Joined: 11 Apr 2019
Github ID: vsonnier
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Port of DaZombieKiller's footsteps

Postby The Zombie Killer » Wed Jun 26, 2019 3:45 am

Just for reference, I had already ported the footsteps code to ZScript a while ago, which is available here. I just neglected to post about it on the forums. This version is different to the original though, it uses a custom lump rather than dealing with the LANGUAGE lump. EDIT: It should also be noted that my version is a bit less "plug and play" than this one, so if you're looking for something that you can just drop into your project, you'll most likely want to go with the version in this thread instead of the one I just linked.
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795


Return to Script Library

Who is online

Users browsing this forum: No registered users and 2 guests