The chronicles of writing complete hacks in UnrealScript.

If it's not ZDoom, it goes here.

The chronicles of writing complete hacks in UnrealScript.

Postby KynikossDragonn » Wed Feb 03, 2021 9:27 pm

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
KynikossDragonn
『霧雨魔理沙のペットドラゴン』
 
Joined: 12 Dec 2020
Location: Independence, KS, USA
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)

Re: The chronicles of writing complete hacks in UnrealScript

Postby Marisa Kirisame » Thu Feb 04, 2021 3:37 am

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
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: The chronicles of writing complete hacks in UnrealScript

Postby Matt » Fri Feb 05, 2021 6:18 pm

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
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: The chronicles of writing complete hacks in UnrealScript

Postby KynikossDragonn » Fri Feb 05, 2021 8:21 pm

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.
User avatar
KynikossDragonn
『霧雨魔理沙のペットドラゴン』
 
Joined: 12 Dec 2020
Location: Independence, KS, USA
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)


Return to Off-Topic

Who is online

Users browsing this forum: No registered users and 0 guests