Resource icon

[Open Assets] Ashnal's Utilities/Fixes v8

I made sure my file(s) follow the Submissions Guidelines
  1. Yes
Very simple set of fixes/enhancements.

Mobjscale Thrown Items Fix:
kart0134.gif

Most who play Kart v1.3 regularly know that on certain maps, that use the map object scale feature (like SD2 Balloon Panic pictured above), forward item throw arcs are not properly set. This gif above shows the fixed arc. Note that this code was simply ported to Lua from the source code fix posted to Kart's next branch by Lat https://git.do.srb2.org/KartKrew/Kart-Public/-/commit/17d45fc790bee442b6c4df24ff725589c90a4628 for use with v1.3. It will no longer be necessary if/when Kart v1.4 (or v2) is released.


Item Source Preservation Fix:
kart0136.gif

In vanilla Kart, items keep track of who threw them. This doesn't matter much for vanilla gameplay, but becomes relevant when you have mods such as Hitfeed or HPmod which use the source information to create the hit messages, or attribute kill healing. If a player dies after they've used a persistent item, that reference will be lost, causing those mods to not function properly.

For the scenario above, you can see that I've placed a mine down, and you can tell it is mine due to its silver center light (mines' centers and explosions are colored according to the source player's skincolor if you didn't know). In vanilla, this center light would turn red when it lost its reference to my kart. But with this mod, it stays silver, demonstrating the preservation of the source reference.


Globalize:

This is a purely performance oriented enhancement that cannot be show in a gif well.

When a Lua script uses a global constant, such as say, MFE_UNDERWATER, the game goes through a long list of string comparisons to resolve the value. It incurs a performance penalty for mods that use constants like these very frequently without optimizing. This script helps optimize other scripts by moving all hardcode defined constants into the global Lua registry via rawset, which will be checked first before the slow string lookup code is used.

In non-programmer speak, the game uses poorly performing code in some circumstances for some types of mod scripts. This mod makes those mods perform better and should improve performance for people with low end systems when playing in servers that use a lot of mods that do not implement a specific optimization.

In super simple TLDR: may help heavily modded games have higher fps.

CVAR
au_leveltimeoptimize <on/off>

Now has a CVAR which you can turn on for a slight bit more gain, but only if you've loaded this addon as the very first thing. It might cause game desyncs if you enable it without being loaded first, and it defaults off.


Spectate Enhancements:

Adds 3 new console commands:

viewrandom
Spectates a random racer

viewlast
Spectates the racer in last place
(For those unaware, you can already spectate by position number with the "view #3" command, however the last place number changes depending on the amount of players and gamemode)

viewname <partial name>
Spectates the first player it finds with a name that contains the string you entered. Unlike the existing functionality in the "view" command, this is insensitive to case and can find players based on partial names.
For example, let's say you want to spectate Ashnal. You can type in "viewname ash" and it will work.

There is also an autoswitch function. It will automatically spectate a random player on race start, so that no interaction is required to spectate someone when a race starts. It will also automatically switch to whomever is in last place when a racer gets exploded mid-race, which happens if playing with Elimination or HPmod addons. There is also an autoswitch to spectate anyone who draws a sink, so you don't miss those epic sink snipes/misses.

This depends on consoleplayer.lua written by James R, which is included, and originates from Hostmod.


Bumpspark nerf:

This is an adjustment I've run on my server and given out to other public servers as well. I'm releasing it now for anyone to use if they wish. This will only work if KartMP (kmp) is loaded and its bumpspark option is enabled. When bumping a wall with a spark charge higher than blue, this adjustment will force kmp to reduce your charge to a blue spark, rather than retaining blues and rainbows. This keeps the spirit of allowing players who bump walls to recover with blues easily, but does not allow free rainbows while bonking spirals.

CVAR
au_bumpsparknerf <on/off>

kart0221.gif



Landing Quake:

This is a really old script of mine that I polished for release. Originally inspired by Lat's Wipezones and the thud karts make when landing in that addon, this also add landing sounds for karts landing. There are two three levels, the first being no sound at all for light/smooth landings, the second being a subtle sound for medium landings, and the third being a big thud for hard landings.

CVARS
au_landingquake <on/off>
This is a clientside option and can be turned on/off individually by players based on their preference, defaults to the value of au_landingquake_server.

au_landingquake_server <on/off>
This specifies the server default for au_landingquake, its initial value when someone joins the server. Defaults off.

au_landingquake_small <momz in fu/t>
The amount of vertical momentum you must exceed to trigger the medium landing sound effect. Lower momentum will have no sound.

au_landingquake_large <momz in fu/t>
The amount of vertical momentum you must exceed to trigger the hard landing sound effect and screenshake.


Acrobatics Meter Adjust:

This allows you to adjust how fast the Acrobatics trick meter moves when being chased by the SPB, and also while not. I use it as an alternative to SPB lock, since SPB lock is a bit unfun for frontrunners. This makes SPB running with Acrobatics harder and is more in line with the SPB's design. The default values are tuned for this when you just turn it on, but you can play with the values if you'd like.

This requires the Angular's Acrobatics addon to be loaded and active.

CVARS
au_ac_adjust <on/off>
Toggles this feature on and off

The following cvars are number based and deal with the Acrobatics meter, which has a value range of 0 to 400, and a default gain of 10 and default loss of 5. These add/subtract from that.

au_ac_extragain <number between -9 and 400>
Default 0. Per tic amount to add when the meter rises at all times.

au_ac_extraloss <number between -4 and 400>
Default 0. Per tic amount to subtract from the meter when it is falling.

au_ac_extraspbgain <number between -9 and 400>
Default 15. Per tic amount to add when the meter is rising, when being chased by the SPB.

au_ac_extraspbloss <number between -4 and 400>
Default 10. Per tic amount to subtract when the meter is falling, when being chased by the SPB.

kart0223.gif



Map Rotate:

Designed mostly for dedicated servers, this will cause the server to change maps every 15 minutes when there are no players in the game. It will also restart the current map when a player joins if the server is empty.

CVAR
au_maprotate <on/off>
Defaults on. Turns this feature on and off.


Encore Rotate:

This is my own take on rotating encore mode. It has separate chances for turning encore on and turning it off, which differentiates it from Hostmod. This allows for Encore to persist over multiple maps if the dice roll that way. Don't use this at the same time as Hostmod's Encore feature.

CVARS
au_encorerotate <on/off>
Default off. Turns this feature on and off.

au_encorechance <% chance from 0 to 100>
Default 25. How likely the server is to switch "kartencore on" at the end of a race when it is off.

au_encorerevertchance <% chance from 0 to 100>
Default 75. How likely the server is to switch "kartencore off" at the end of a race when it is on.
Author
Ashnal
Downloads
1,518
Views
6,080
Extension type
pk3
File size
39 KB
MD5 Hash
f5b358036467e908b5f6823933687c85
First release
Last update
Rating
3.33 star(s) 3 ratings

Share this resource

Latest updates

  1. v8

    Minor addition, small script that cleans the hostmod scoreboard of duplicate change entries
  2. v7

    More fixes Fixes MapRotate when SPBAttack isn't loaded. Fixes leveltimeoptimize to behave...
  3. v6

    Last one today I promise More fixes for GlobalizeHarder Fixes for MapRotate New feature for...

Latest reviews

This looks pretty good, but since it doesn't seem to work for me, I'll have to give it one star.
Upvote 0
The MobJScale fix makes some typically annoying maps playable and more consistent, thank you for doing god's work.
Upvote 0
Welcome to releases!
Upvote 0
Back
Top