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

Togen

Member
This is a script which causes items to randomly appear around the course. The item limit, rate at which items appear, types of items that can appear (this is separate from the items you can get from boxes!), and some other behaviors can be customized. Additionally, it includes a new mechanic that can be enabled or disabled separately: boxstacking.

During a free race, items other than sneakers will not rain, and items will spawn closer than normal in battle mode.

Tested in singleplayer and 4-player offline multiplayer, both battle and race modes.

Console Variables
ir_mode
"Race" by default.
You can enable the script across both modes, in battle only or race only, or disable it entirely.

ir_traps
Off by default.
If "on", certain items will transform into hazards when rained.

ir_limit
90 by default.
Limits how many rain items are allowed to exist at one time.

ir_limit_spb
2 by default.
Limits how many rain SPBs are allowed to exist at one time.

ir_lifetime
1400 ticks (40 seconds) by default.
Determines the number of ticks before a rained item is destroyed.

ir_delay
13 ticks (~0.37 seconds) by default.
Determines the number of ticks required between each rained item.

ir_startup
70 ticks (2 seconds) by default.
Determines the number of ticks required before item rain begins.

ir_pickups
"Vanilla" by default.
If "none", item boxes will be destroyed. If switched back to any other mode, the destroyed item boxes will not return until the next map. Use "Stack" to enable box stacking!

Console Commands
ir_additem (item ID, trap ID, minimum from rain, maximum from rain, rain rarity, minimum from boxstacking, maximum from boxstacking, boxstacking rarity)
Defines a new rainable item.

ir_preset
Uses one of my presets for rainable items. Descriptions are as follows:
  • none - use this as a basis for custom item rain tables!
  • vanilla - all items will rain, and boxstacking will often fail to yield stacks for powerful items. the default.
  • mint - all items will rain, some items have very annoying trap forms, and boxstacking is consistent.
  • neapolitan - all items will rain with maximum stacks, some items have very annoying trap forms, and boxstacking is POWERFUL.
  • strawberry - speed-boosting items only.
  • chocolate - attack items only.
  • banana - all bananas, all the time.
  • rockyroad - enable traps and Chao Garden fruit will rain down to block your path!
  • superman - enable traps and red, yellow, or blue springs will appear on the course!
  • soap - sinks only.

Mod Support
Item Rain makes some of its variables global to allow other Lua scripts to insert their own item rain definitions. Review the script for a brief explanation of how to use this functionality.
 

Attachments

  • kart0000.png
    kart0000.png
    454.1 KB · Views: 810
  • KL_itemrain-v2.2.lua
    22.1 KB · Views: 292
Last edited:
v1.2 uploaded.

Fixed a typo that would cause pickups to not be destroyed.

Corrected a few hazard entries so that those items would actually spawn their respective "active" versions, including SPBs.

Added a new variable, ir_rarity, which if on, randomly limits which items can spawn every turn based on hardcoded rarity values. Turn it off and all items will have an equal chance of spawning.

Added a new variable, ir_limit_spb, which controls how many SPBs should ever exist at once. This applies to both active and inactive SPBs directly created by Item Rain.
 
v2 uploaded.

Console variables have been massively reduced. This will break compatibility with any existing server configurations that have modified item counts. This was done to improve compatibility with other mods such as friendmod. You now, however, have the option to edit the rainable items through Lua (_G.itemrain), or modify items in ways other than adjusting amounts. Set your own custom traps like exploding Toads, or add whatever weird custom items you've got.

A new feature has been added: box stacking. Box stacking can be used separately from the mod's other functions. When box stacking is enabled, driving into an item set while already carrying an item gives you more of that particular item. This can either be +1 stack, or a random amount based on how many would be rained.
 
There seems to be a resynch problem whenever you try to manually add items you want to rain on a dedicated server on the latest version of this addon.

When a player tries to join the dedicated server with this addon, they get a synch failure constantly.
 
v2.2 uploaded.

ir_rarity and the distinction between the two box-stacking modes have been removed.

ir_resetitems and ir_clearitems removed in favor of ir_preset.

Item amounts can now have a minimum set, rather than just a maximum.

Item amounts from boxes can be adjusted separately from item amounts from rain. Box rarity now determines the odds that you'll get absolutely nothing by driving into an item set: the vanilla settings have a 7/8 chance that trying to get an additional invincibility will not increase your stacks. If you hold onto a good item all race, you might actually never get additional stacks from boxes!

A message now displays before Item Rain begins (based on ir_startup) to indicate if either Item Rain or boxstacking is enabled.

Sinks now have a trap form.

Item angles are now randomized.

Added audio feedback for boxstacking.

Actually made sure to synchronize global item rain stuff upon joining.
 
v2.2 uploaded.

ir_rarity and the distinction between the two box-stacking modes have been removed.

ir_resetitems and ir_clearitems removed in favor of ir_preset.

Item amounts can now have a minimum set, rather than just a maximum.

Item amounts from boxes can be adjusted separately from item amounts from rain. Box rarity now determines the odds that you'll get absolutely nothing by driving into an item set: the vanilla settings have a 7/8 chance that trying to get an additional invincibility will not increase your stacks. If you hold onto a good item all race, you might actually never get additional stacks from boxes!

A message now displays before Item Rain begins (based on ir_startup) to indicate if either Item Rain or boxstacking is enabled.

Sinks now have a trap form.

Item angles are now randomized.

Added audio feedback for boxstacking.

Actually made sure to synchronize global item rain stuff upon joining.
Let's say you wanted to rain mines as hazards; How would one do that with this mod?
 

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

Back
Top