ZScript: Randomized monster skins

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
EmperorGrieferus
Posts: 134
Joined: Wed May 31, 2017 5:39 am

ZScript: Randomized monster skins

Post by EmperorGrieferus »

So, I'm currently transferring my Smooth Doom fork to ZScript, and I wonder how to translate this script to ZScript or, at least, make new script with the same functionality.
Attachments
Variants.txt
(4.71 KiB) Downloaded 16 times
ZzZombo
Posts: 317
Joined: Mon Jul 16, 2012 2:02 am

Re: ZScript: Randomized monster skins

Post by ZzZombo »

I'd been working on a skin system, a generic skin system for all non-player actors. It worked by overriding the sprite to be rendered of an actor with a different one, you define your skin as a separate actor with the desired look, and as long as your state sequences matched in total length the ones of the reskinned actor, the script would almost seamlessly transfer the visual aspects of the source actor to the target one. This was actually inspired by "Smooth Doom" because I didn't like the way it changed the monsters, for example, causing them to move faster due to more calls to `A_Chase` within the same time frame. With my skin system in play the monster would still execute the same sequence of states but the skin would animate more states within the same sequence, causing it to animate smoother w/o any changes to the original monster.

It's not finished yet, there is some inherent jank to it, and there is an issue with accurately tracking all possible state changes within a completely arbitrary actor so that the skin and the actor won't go out of sync, but as a prototype it worked for most of the vanilla actors I tried it on IIRC.
EmperorGrieferus
Posts: 134
Joined: Wed May 31, 2017 5:39 am

Re: ZScript: Randomized monster skins

Post by EmperorGrieferus »

The only problem why zombiemen in SD are faster is because A_Chase is called every 3 tics instead of 4. Also, wouldn't it be easier to just spawn variants of monster that are just actors that inherit from their main variant?
EmperorGrieferus
Posts: 134
Joined: Wed May 31, 2017 5:39 am

Re: ZScript: Randomized monster skins

Post by EmperorGrieferus »

Okay, I'll rephrase my question: is it possible to make RandomSpawner CVar-dependant?
ZzZombo
Posts: 317
Joined: Mon Jul 16, 2012 2:02 am

Re: ZScript: Randomized monster skins

Post by ZzZombo »

EmperorGrieferus wrote: Mon Aug 26, 2024 6:31 am Also, wouldn't it be easier to just spawn variants of monster that are just actors that inherit from their main variant?
Nope. In certain cases it's not possible to make "too smooth" animations w/o altering the behavior of the actor if you go with subclassing and even if it is, rearranging all the codepointers around is a bitch.
EmperorGrieferus
Posts: 134
Joined: Wed May 31, 2017 5:39 am

Re: ZScript: Randomized monster skins

Post by EmperorGrieferus »

ZzZombo wrote: Mon Aug 26, 2024 9:33 am
EmperorGrieferus wrote: Mon Aug 26, 2024 6:31 am Also, wouldn't it be easier to just spawn variants of monster that are just actors that inherit from their main variant?
Nope. In certain cases it's not possible to make "too smooth" animations w/o altering the behavior of the actor if you go with subclassing and even if it is, rearranging all the codepointers around is a bitch.
Isn't something that scares me.
Post Reply

Return to “Scripting”