[ZScript] Universal mirrored deaths

Post your example zscripts/ACS scripts/etc here.

[ZScript] Universal mirrored deaths

Postby m8f » Mon Oct 14, 2019 10:38 am



GitHub

Features

- 50% chance of death animation being mirrored horizontally.
- raising animations are flipped too.
- works with any game and mod (hopefully).
- blacklist to exclude specific monsters from mirroring.
- bonus feature: alternating mirroring (controlled by df_alternate CVar).

Can be included in mods, or used as an addon by itself.

This mod is a part of m8f's toolbox.
User avatar
m8f
the dreamer
 
 
 
Joined: 29 Dec 2017
Discord: m8f#0629
Github ID: mmaulwurff

Re: [ZScript] Universal mirrored deaths

Postby bLUEbYTE » Thu Dec 26, 2019 1:15 am

I love non-intrusive mini mods like this that add variety.
bLUEbYTE
 
Joined: 15 Nov 2019
Location: Australia
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel with Vulkan Support

Re: [ZScript] Universal mirrored deaths

Postby bLUEbYTE » Sat Dec 28, 2019 10:53 pm

Hi m8f,
I added this into my Universal Entropy mod. Two questions;

Why did you need to blacklist chaingunguy and cyberdemon from being flipped? In my testing flipped bodies for these look just fine.

Why not go further and flip the sprites on Spawn, to create left/right handed variants? As far as I can tell, the projectiles do not originate from the arms anyway. For example, Cyberdemon's rockets seem to fly off his belly.
bLUEbYTE
 
Joined: 15 Nov 2019
Location: Australia
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel with Vulkan Support

Re: [ZScript] Universal mirrored deaths

Postby m8f » Sat Dec 28, 2019 11:36 pm

Because these monsters are asymmetric, and it will look wrong if the monster weapon flips to the other hand on death animation.

About flipping monsters from the start - I simply didn't think about that.
User avatar
m8f
the dreamer
 
 
 
Joined: 29 Dec 2017
Discord: m8f#0629
Github ID: mmaulwurff

Re: [ZScript] Universal mirrored deaths

Postby bLUEbYTE » Sun Dec 29, 2019 12:10 am

m8f wrote:Because these monsters are asymmetric, and it will look wrong if the monster weapon flips to the other hand on death animation.

About flipping monsters from the start - I simply didn't think about that.


I replaced all the code in death-flip with this:
Code: Select allExpand view
         // Flip
         let flip = random(0, 1);
         if (flip == 1)
         {
            a.A_SetScale(-a.Scale.X, a.Scale.Y);
         }


All looking good to me, including chaingunner death animations, and they do come back with the correct orientation if revived. I guess the engine doesn't clear the actor's sprite scaling values when it becomes a corpse, rendering all the Inventory stuff unnecessary. But if I'm missing something here, let me know.

I've attached my latest mod (with the said code simplification) and a testing map I made, in case you want to test it yourself.
Attachments
MONSTEST.wad
(43.05 KiB) Downloaded 16 times
UniversalEntropy.pk3
(14.01 KiB) Downloaded 22 times
bLUEbYTE
 
Joined: 15 Nov 2019
Location: Australia
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel with Vulkan Support

Re: [ZScript] Universal mirrored deaths

Postby 3saster » Sun Dec 29, 2019 1:10 am

bLUEbYTE wrote:All looking good to me, including chaingunner death animations, and they do come back with the correct orientation if revived. I guess the engine doesn't clear the actor's sprite scaling values when it becomes a corpse, rendering all the Inventory stuff unnecessary. But if I'm missing something here, let me know.


The issue would be if the monster's behaviour is related to its sprite. Consider a Cyberdemon that has been modified to shoot a rocket from its arm instead of its chest. If you mirror it on spawn, then when it fires, its animation will not match its behaviour anymore. If you could mirror EVERYTHING about the actor, including the behaviours, then this would be good, but I'm not sure that's actually possible in a generic way.
User avatar
3saster
 
Joined: 11 May 2018
Location: Canada

Re: [ZScript] Universal mirrored deaths

Postby bLUEbYTE » Sun Dec 29, 2019 6:31 am

Well, forget what I said above regarding my super simple 3-line flip code working fine... It doesn't. Although admittedly it looks pretty funny, it causes the monsters to moonwalk :lol: .

So I'm back to using m8f's full code in my mod. Lesson learned.
bLUEbYTE
 
Joined: 15 Nov 2019
Location: Australia
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel with Vulkan Support


Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest