Resource icon

[Script] Hold Items v1.2a

amperbee

thunderdome denizen
Hey <username>, do you like items?
Would you like to hold more at a time?

This addon allows you to hold more than one item by giving you a stack of empty hold slots!
kart0060.gifkart0061.gifkart0062.gifkart0058.gif
(Original scheme)

Use the CVar kartholdslots to change how many slots can each player have, from 0 to a whooping 50. Or 1 if you just like something like MK8.
With the CVar kartholdretain, you can set whether you want players to be able to retain their held items across maps. (By default it is set to not do that)

Change control schemes, as well as review controls, using the command kartholdcontrol.

You can pick from two different control schemes.

(For reference: The item slot is locked if the item roulette is rolling, an item is being held, you picked up an eggman capsule thing or you are using rocket sneakers.)

Original scheme:
  • Hold Custom 2 while holding an item to store it in the first slot of your stack.
    • Trying to store an item while all slots are full will push your item to the first slot as usual, but will pull the last item from the stack.
  • Hold Custom 2 while having no items to pull the item in the first slot in your stack.
  • Tap Custom 2 to scroll through the items in the stack.
  • If the item slot is locked, you can't push nor pull items. You can still scroll through them, however.

Faster management scheme (new default!):
  • Tap Custom 2 to scroll through items towards the right.
  • Hold Custom 2 to scroll through items towards the left.
  • You cannot scroll through items while your item slot is locked.
  • Perfect scheme if you only have 1 hold slot!

+ indicates additions
@ indicates fixes or changes
- indicates removals
Version 1.2a:
@ Accidentally initialized the wrong variable. Fixed
Version 1.2:
+ New CVar that allows keeping held items across maps
@ Friendship ended with MAPCHANGE, now MAPLOAD is my best friend


Version 1.1:
+ New control scheme (kartholdcontrol 1)
+ Controls remain 5 more seconds after starting the race
@ Fixed part where I forgot to initialize item storage on recently joined players
@ Fixed spectators thinking they need item storage in the HUD


Version 1:
+ Initial release

  • This mod does not respect splitscreen yet: I haven't checked how splitscreen works. Still gotta... figure out how to display extra items.
  • No checks related to the SPB or Shrink items are made. A player can potentially amass a number of these items without restriction.
  • Can potentially desync replays if the control scheme for a player is not the default.

It hasn't been well tested on netgames, so if any problem arises, let me know.
Want to suggest a feature? Also let me know!
 

Attachments

  • KL_HoldItems_v1-2.zip
    4.7 KB · Views: 763
  • KL_HoldItems_v1-2a.zip
    4.7 KB · Views: 1,561
Last edited:
I am not sure it is wisest to have to need to hold the button to take an item out or put it back in, and I'd also rather items automatically fill the empty slots. Right now, it seems a little too slow to execute for a racing game or the battle mode, where you can never be too sure when you'll need your next item if you got 'em.

But as for how it functions, I tried it out and didn't seem to run into problems, but I also have not been able to try it in a big, 8+ player netgame. From what I can tell, it seems to work just fine though! Welcome to releases!
 
v1.1 has been released.

Version 1.1 brings:
+ New control scheme (kartholdcontrol 1) and it's the default too
+ Controls remain 5 more seconds after starting the race
@ Fixed part where I forgot to initialize item storage on recently joined players
@ Fixed spectators thinking they need item storage in the HUD


The new control scheme has been made based on the comment of D00D.
This scheme is now the new default - Pressing Custom 2 will push items towards the stack, with the last item or empty space being sent to the player's item slot.
Holding Custom 2 will cycle items in reverse.
This scheme is perfect if the game has only one hold slot, allowing you to switch between both slots without having to hold down the button.

Also a couple of fixes.

That's about it
 
I knew this game was missing a thing or two. This is something I'd like to have! It brings me back to the Mario Kart 8 Deluxe system... except we get 3 extra slots instead of 1 (.....or MORE. YEET)! Thanks, Rapid! Nice to see this out here.
 
Last edited:
Wouldn't mind having a control scheme that uses custom 1/3 to scroll through the items and having custom 2 to swap your current item with the one currently selected in storage, but other than that, i'll definitely be hosting with this mod from now on. Great work!
 
>keep item at the end of any match
>spectate during the stage roulette
>join back when the roulette starts
>this
attachment.php
 

Attachments

  • kart0015.gif
    kart0015.gif
    2.1 MB · Views: 6,674
whoops fixed

Version 1.2:
+ New CVar that allows keeping held items across maps
@ I forgot to change that MapChange hook to MapLoad in first place so that's done
@ By extension, fixed bug where you could keep an item across maps




Also I found a Kart bug with MapChange where players that went into spectator during the map roulette phase aren't iterated anymore during MapChange. I think that has been reported just now

I have also removed all previous versions from the OP.
 
Last edited:
Mega and Eggbox Kamikazee statuses should lock swapping items, but don't.

Megas just block the overlapped item due to the cancel function, and Eggboxes not only trigger the early kamikazee, but will drop the overlapped item.

Also, SPB, and any other item that only N amount of are usually allowed to spawn can be duped further by keeping them in reserve slots. (I presume it also applies to Shrink), I doubt this is intended. Perhaps look into making it so that the item system checks players' reserve items for items that only N amount should be able to spawn?


(Eggbox not properly locking slot)

GSKRzY6.gif

(Mega not properly locking slot)


zorhB0e.gif

(1P duping SPB)

4lWlikK.gif


(2P duping Shrink)
Also, some UI polish suggestions:
- Invincible currently doesn't animate. Items with such frames should probably be rendered accordingly in reserve.
- Perhaps mimic the way the small item slot appears in 3P/4P splitscreen for the reserve slots, even if only for having it set to double slots?
- Clientside variable to reduce and/or disable the control reminder.
 
Last edited:
Mega and Eggbox Kamikazee statuses should lock swapping items, but don't.
Weird, I could swear I made checks for that.

Also, SPB, and any other item that only N amount of are usually allowed to spawn can be duped further by keeping them in reserve slots. (I presume it also applies to Shrink) [...]
I won't do anything about it, and I'll write it down as a known issue - I really don't feel like reinventing the wheel and figuring out what item to give to a player if it isn't a [item that there can be only one instance of]. The item roulette is already messy enough, don't want to touch it or give items in an unbalanced manner.

Invincible currently doesn't animate. Items with such frames should probably be rendered accordingly in reserve.
Perhaps mimic the way the small item slot appears in 3P/4P splitscreen for the reserve slots, even if only for having it set to double slots?
I'll look into them later.

Clientside variable to reduce and/or disable the control reminder.
I can crop it down to "run a command for help", but I won't disable the control help.




With that said, I've encountered an interesting issue related to changing the control scheme and replays, so I wrote that down in known issues.
 
Last edited:
I won't do anything about it, and I'll write it down as a known issue - I really don't feel like reinventing the wheel and figuring out what item to give to a player if it isn't a [item that there can be only one instance of]. The item roulette is already messy enough, don't want to touch it or give items in an unbalanced manner.
An alternate solution I thought of would be to lock the item slot when those two are equipped to prevent the glitch from happening in the first place.
Being a band-aid fix, I wouldn't expect it to be a default, though. This suggested fix feels more to me like something that'd be intended for stricter server owners that despise glitch abuse.

I can crop it down to "run a command for help", but I won't disable the control help.
Fair enough - short of turning it into a manual command, perhaps the help message could be rigged to only show up once per session, instead of repeating every single match?


Update: Rockets still lock the item slot as intended, the bug only affects Mega and Eggbox Kamikazee.


Update 2: In MP, you can hear other players switching their items.
 
Last edited:
2 quick questions before I add this to my server. 1. Is there a way to atomically switch to the item in your other slot after the item in your main slot is used? 2. Does the next item box your get fill your other slot if there is an item in your main slot?
 
Last edited:
Why (and how) did you send the same thing four times with several minutes of difference?

2 quick questions
For both, it's a negative answer. It's all manual.
The item doesn't switch automatically (maybe you want to pick something up after you used your item?), and you simply can't pick up a new item regardless of how many empty side slots you have.
 
Last edited:
Are you still working on it? I want to use this addon and I play in splitscreen mode most of the time and since this addon doesn't have splitscreen support, this addon is completely useless for me.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top