Fav's Kart Luas For Empty Karts And Gibs That Has A Really Long Title

[Open Assets] Fav's Kart Luas For Empty Karts And Gibs That Has A Really Long Title 1

This content may be freely modified and/or maintained by anyone.

FAVman33

◼ I'm Fun ◼
2024 Collaborator 2023 Collaborator
FAVman33 submitted a new resource:

Fav's Kart Luas For Empty Karts And Gibs That Has A Really Long Title - Shoutout to those peeps out there with custom karts!!

Alternatively, you could call it FKLFEKAGTHARLT. So let's call this "Fav's Kart Luas" Instead!
This here is a collection of Lua files to help customize a character's kart upon their untimely demise. Here's the rundown!
View attachment 152144
View attachment 152145
NOTE: THIS SCRIPT MAY BECOME OBSOLETE BY THE TIME 2.4 ROLLS AROUND. Do keep this in mind if you plan to only have the leftover...​

Read more about this resource...
 
Hi, I have a friend who is working on an update to their character pack and wants to use this to make one of the characters not leave behind an empty kart or create gibs if they explode/lose the race. Neither of us know a lot about coding (I know enough to alter existing things, but I don't know anything about writing new code), and we can't seem to get either scripts to apply to the character. We're not sure what we're doing wrong (we've changed the assigned character values from "sonic" or "tails" to the internal name of the character we're using, changed the name of "SPR_" to point to the new (blank) gibs, and we even tried setting the nullifier to "true", but nothing changes.)

Could you please help us out?
 
Hi, I have a friend who is working on an update to their character pack and wants to use this to make one of the characters not leave behind an empty kart or create gibs if they explode/lose the race. Neither of us know a lot about coding (I know enough to alter existing things, but I don't know anything about writing new code), and we can't seem to get either scripts to apply to the character. We're not sure what we're doing wrong (we've changed the assigned character values from "sonic" or "tails" to the internal name of the character we're using, changed the name of "SPR_" to point to the new (blank) gibs, and we even tried setting the nullifier to "true", but nothing changes.)

Could you please help us out?
Sure thing! To use the lua files, here's a set of instructions to help out:
1. In the PK3 file for your character pack (assuming you're using a PK3), create a folder named "Lua".
1745596898220.png


2. Insert the "CustomGibsThinker" lua file into the Lua folder. Then, create a new lua file, or copy over the example lua file from the example PK3 provided.
1745597000270.png

3. Inside the lua file that is NOT the custom gibs thinker, edit the file to use the custom gibs functions based off of the skin. A copy-paste from the example PK3 you downloaded should do the trick.

Considering what you guys are trying to do however, you can save on freeslotting altogether by using the in-game SPR "SPR_NULL" and state "S_NULL", which will even help remove the kart for you! Here's what that'd look like all together, if your skin name was something like "frank":
The Omega Hideifier 3000:
// We toss everything in a ThinkFrame so we can let the CustomGibsThinker.lua load first!
local ScriptLoaded = false
addHook("ThinkFrame", function()
    if not(ScriptLoaded)
    and CUSTOM_GIBS then
        ScriptLoaded = true

        CUSTOM_GIBS["frank"] = {
            [SPR_DIEA] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- tires
            [SPR_DIEB] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- pipeframe bars
            [SPR_DIEC] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- pedal tip
            [SPR_DIED] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- right pedal
            [SPR_DIEE] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- steering wheel
            [SPR_DIEG] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- left pedal
            [SPR_DIEH] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- strut
            [SPR_DIEI] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- wheel axle bar
            [SPR_DIEJ] = {sprite = SPR_NULL, frame = A, nullifier = true}, -- screw
            [SPR_DIEK] = {sprite = SPR_NULL, frame = A, nullifier = true} -- N. Gin
        }
    end
end)

addHook("MobjThinker", function(kart)
    if kart and kart.valid and kart.target and kart.target.valid
        if kart.state == S_KART_LEFTOVER_NOTIRES and (kart.target.skin == "frank") then
            kart.state = S_NULL
        end
    end
end, MT_KART_LEFTOVER)
To explain the code a bit: SPR_NULL is essentially an in-game sprite prefix used for when needing to make something invisible. Since we're already setting the nullifier value to true, we can fill in the sprite section with only SPR_NULL to free up on freeslotting. What S_NULL does however, is get rid of the object completely, which is often used for objects when they need to be removed. This state is what the nullifier value uses for the gibs to make them disappear!
Bear in mind, it's not the BEST idea to be getting rid of the empty kart. It's intended to be used as an obstacle for the other racers, which also gets affected by the exploded skin's weight. But hey, I'm not stopping you lmao

4. Give it a test! If there are still problems, let me know through Discord, and I can try to lend a hand further!
ringracers0087.gif
 
Back
Top