The chronicles of writing complete hacks in UnrealScript.

If it's not ZDoom, it goes here.
User avatar
KynikossDragonn
Posts: 202
Joined: Sat Dec 12, 2020 10:59 am
Twitch ID: kynikossdragonn
Github ID: KynikossDragonn
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)
Location: Independence, KS, USA

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: 3802
Joined: Fri Feb 08, 2008 9:15 am
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

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: 9665
Joined: Sun Jan 04, 2004 5:37 pm
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

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: 202
Joined: Sat Dec 12, 2020 10:59 am
Twitch ID: kynikossdragonn
Github ID: KynikossDragonn
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)
Location: Independence, KS, USA

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.

Return to “Off-Topic”