[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



Download
Source code

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.
Last edited by m8f on Tue Sep 22, 2020 11:06 am, edited 1 time in total.
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit

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
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
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
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit

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.
Last edited by bLUEbYTE on Fri Oct 09, 2020 4:29 pm, edited 1 time in total.
bLUEbYTE
 
Joined: 15 Nov 2019
Location: Australia
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
Graphics Processor: Intel with Vulkan Support

Re: [ZScript] Universal mirrored deaths

Postby eviltechno » Fri Oct 09, 2020 12:22 pm

Any reason why it doesn't run well with the zombiemans in Brutal Doom? The deathpic is always default. I think its the same with the pinkies. Any way to fix it?
eviltechno
 
Joined: 04 Oct 2020

Re: [ZScript] Universal mirrored deaths

Postby m8f » Fri Oct 09, 2020 11:58 pm

I noticed that the death animation starts mirrored, and then flips back to default when a zombieman falls on the ground. It's because in Brutal Doom, at this moment dead bodies become invisible and spawn a new actor, for example
Code: Select allExpand view
TNT1 A 0 A_SpawnItem("DeadZombieman1")
Probably this is to make dead bodies shootable. It's a code design choice of Brutal Doom, I cannot fix it in my mod.

If you want Brutal Doom with mirrored shootable corpses, I can recommend BDLite with Universal Gibs.
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit


Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest