The chronicles of writing complete hacks in UnrealScript.

If it's not ZDoom, it goes here.
Post Reply
User avatar
KynikossDragonn
Posts: 272
Joined: Sat Dec 12, 2020 10:59 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Void Linux
Graphics Processor: Intel (Modern GZDoom)
Location: Independence, KS, USA
Contact:

The chronicles of writing complete hacks in UnrealScript.

Post by KynikossDragonn »

I just really need to share this.

So for context, I'm making a Mutator for Unreal Tournament (1999) that changes all the blood sprites to be STY_Modulated based, in addition, prevent the triggering of decap death animations, remove gibs, and make all Carcasses completely impervious to being gibbed.

This so far has required me to make four different classes just to accomplish such a simple (to a end user) task.


The most important code is shared here: (Spoiler tags because I don't want to clutter the post)
Spoiler:
Spoiler:
Spoiler:
It seems it'd be way easier to get away with doing this kind of thing in GZDoom's ZScript, isn't it?
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: The chronicles of writing complete hacks in UnrealScript

Post by Marisa the Magician »

I can guarantee you that ZScript is infinitely more flexible than that. Why else do you think I dropped off UT modding entirely?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: The chronicles of writing complete hacks in UnrealScript

Post by Matt »

No spoons to actually try to decipher all this but at first glance it looks kinda like a bunch of old ACS code one might've recently replaced with a DamageMobj override a quarter the length.
User avatar
KynikossDragonn
Posts: 272
Joined: Sat Dec 12, 2020 10:59 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Void Linux
Graphics Processor: Intel (Modern GZDoom)
Location: Independence, KS, USA
Contact:

Re: The chronicles of writing complete hacks in UnrealScript

Post by KynikossDragonn »

Marisa Kirisame wrote:I can guarantee you that ZScript is infinitely more flexible than that. Why else do you think I dropped off UT modding entirely?
I know, dear... but old habits die hard and I'm a big dumb dragon.
Matt wrote:No spoons to actually try to decipher all this but at first glance it looks kinda like a bunch of old ACS code one might've recently replaced with a DamageMobj override a quarter the length.
Well, I can probably start by explaining what several parent classes in Unreal Engine that I'm using does.

Mutator is a actor class that, when added into the level, allows independent handling of IsRelevant (called in Actor PreBeginPlay) among other things, to change stuff irrespective of what the GameInfo is.

SpawnNotify is a actor class that quite literally gets a native event call whenever Spawn happens, as the Actor is being created. This is the only way to modify actors that are bGameRelevant (which makes Actor's ignore IsRelevant by bypassing that if statement entirely in PreBeginPlay), and because it's a native event call, it happens on both the client AND server, thus whatever you change or do in there, is guaranteed to be consistent on both server and every client in the server.

SpawnNotify is the only way to change the apperance of things like Decal or Effects classes or even just completely remove them from play entirely.

"PreventDeath" in UT99's Mutator class is called from Pawn.Died() very, very early into that functions execution cycle, if ANY PreventDeath returns a true value, the rest of the Died function is ignored. So, I abuse that to, in the next engine tick, kill who got killed with "Decapitated" damage type with a damage type belonging to the current weapon or otherwise defaults to just 'shot' to prevent triggering a beheaded death animation. I have to also copy code from DeathMatchPlus to handle the "Head shot!" announcer message properly even though the resultant death does not happen with the "Decapitated" damage type.

I'm also making sure HitLocation is never high above a actor because that also triggers decap death animations regardless of damage types.
Post Reply

Return to “Off-Topic”