Skip to content

SPR2_DKRT: A new SPR2 which allows character WADs to define a unique kart explosion husk

TL;DR Character WADs can now optionally define DKRT graphic lumps to replace the kart husk mobj graphics with that of the ones defined in the character WAD. The caveat is that I've had to store some data in mobj's cvmem member variable because the number of frames in a character WADs DKRT graphics lump could not be easily accessed for the lifetime of the husk mobj after the player mobj had re-spawned and become a new mobj Resolved as of commit 43a2f90f . Additionally, the kart husk mobj's spritescale() inversely proportions to the kart husk mobj's scale such that despite the kart mobj being 50% bigger than FRACUNIT the kart mobj renders as though it were the same size as FRACUNIT.

The goal of this branch is to allow character WADs to define graphic lumps with the DKRT prefix. When defined, the sprites used for the kart explosion husk that spawns upon a player's death will be substituted for graphic lumps in the player's character WAD with the DKRT prefix. To accommodate this, the kart mobj's skin and sprite will be set to the player's skin and SPR2_DKRT respectively ONLY in the scenario that the character WAD the player is using has defined DKRT graphic lumps. Existing character WADs without DKRT graphic lumps are designed to be totally unaffected by changes in this branch.

Demonstration:

SLADE_DX1oqlYF1N

demovid_A

ringracers_user-defined-death-kart-frame_vRakTZBqqL

The only thing I feel the need to warn Kart Krew of before accepting this merge request is that I had to cache the number of frames in a character WADs DKRT graphic lump definitions into the cvmem member variable of mobj. I was going to (reasonably) cache this value to a new member variable that actually represented the purpose of itself properly but code comments suggest to me that new members in mobj is a big hassle with potential for breaking changes in save games and lua support. Code comments ALSO tell me that I'm not supposed to use cvmem at all and that it is saved for SOC stuff but then a user in the #hardcode channel of the Kart Krew Discord suggested that this code comment is outdated and I also noticed that cvmem is tampered with in several places of the source code already. Resolved as of commit 43a2f90f

This merge request was made in response to comments on a previous merge request that I couldn't tend to at the time (my apologies, I was on vacation pretty much right after the last merge request). One user suggested that they would be more comfortable accepting the concept of that merge request into the master branch if I were to rework it such that: A) Gameplay was unaffected B) Existing character WADs wouldn't have to all start defining DKRT graphic lumps

Following commit af16e3f9 both point A and point B have been satisfied. Point A before this commit was previously UNsatisfied due to the kart husk scale() changing if DKRT graphic lumps were defined for a skin however that scaling has now been delegated to spritescale() where only the rendering of the kart husk will be affected by the scaling.

Anyway, thanks to the Kart Krew Discord for their help whilst developing this branch and hopefully you guys like what I did!

Edited by Spring Thing

Merge request reports