SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Kart Releases & Mods > Kart Miscellaneous

Thread Tools
Hitfeed (kl_hitfeed_v2.pk3) Details »»
Hitfeed (kl_hitfeed_v2.pk3)
Version: 1.0, by Snu (YEAAHHHHHHHHH) Snu is offline
Developer Last Online: Jul 2020

Category: Version: SRB2 Kart Rating: (4 votes - 4.60 average)
Released: 08-14-2019 Last Update: Never Favourites: 8

Just a mod that gives you a general idea of the chaos going on within races!
The hitfeed displays every hit registered between players, just like in FPS games, such as TF2 or Overwatch to name some good examples. Messages related to you in netgames are even highlighted a different colour!

Aside from that, what you see is what you get, it's non-intrusive, nice addition to have!
... although another main highlight of this mod is the amount of customization you can do with how it's displayed! You can change a lot of things about the hitfeed, such as name character limits, message limits and an even change the way hitmessages are displayed. (Icons, Names, or even Icons + Names!)

A full list of commands and what they do can be found here:
Spoiler: Commands
hitfeed: Toggles hitfeed. Defaults to On.
hf_displaymode: Changes the hitmessage displaymode. 1 = Names, 2 = Icons, 3 = Icons + Names. Defaults to 1.
hf_charlimit: Limits characters in a hitmessage name. Defaults to 21.
hf_messagelimit: Limits the number of hitmessages. Defaults to 4.
hf_backdrop: Toggles hitmessage backdrops. Defaults to On.
hf_highlightcolor: Changes the highlight colour. Defaults to White.
hf_colorednames: Toggles hitmessage coloured names. Defaults to On.

Included in the zip is a cfg, hitfeed.cfg. Place this inside your root kart folder, and it'll be loaded whenever you join a server that has hitfeed added, like autoexec.cfg and kartexec.cfg. It contains all the commands hitfeed has set to their default values, so you can easily customize hitfeed to your liking! (Even if you don't have any preferences, it's highly recommended you have this in your folder anyways to prevent a huge pause the game will do trying to find it.)

Additionally, there's custom mod support for hitfeed, allowing you to send your own messages, override the locations and even override some parameters relating to how base mod hitmessages appear! If you're interested in supporting your mods, I'll go into detail in the spoiler below;
Spoiler: Hitfeed Modding
Sending custom messages:
Of course, you'll need to make sure you have the graphics ready in your wad/pk3. Once you have them ready, when you want to display a message on the hitfeed it's as simple as calling this function in the script;

HF_SendHitMessage(table_t source, table_t victim, patch_t patch, int color):
source and victim are set up as like tables, containing the values for them; {{string name, int color}, {patch_t icon, int color}, player_t player}. name is the string of the name you want to display for them. icon is the icon you want to display for them. color is the color you want the respective fields to be displayed as. player is just used to determine if the hitmessage is relative to a certain player or not, and can be omitted. If a source or victim does not need to exist for your hitmessage, set all fields to nil.
patch is the graphic for the hitmessage you want to display.
color is the color you want the hitmessage graphic to be, and can be omitted.
All these fields (minus the player set in the source/victim) are really customizable, so go wild!

When calling the function, it's good to check if hitfeed is added, so it'd look something like this;
if (hitfeed) then HF_SendHitMessage(table_t source, table_t victim, patch_t patch, int color) end
For animated icons, you need to define the animated icon inside the check, like so;
if (hitfeed)
	if not HF_animIcon[animated patch] then HF_animIcon[animated patch] = {frames, tics} end
	HF_SendHitMessage(table_t source, table_t victim, patch_t patch, int color)
animated patch is the animated patch you're defining.
frames is how many frames there are in the animation.
tics is how many tics each frame lasts for.
An example of an animated patch definition is this;
HF_animIcon["K_HMINV"] = {6, 3}
When this patch is used, it will cycle through patches K_HMINV1 - K_HMINV6, staying on each frame for 6 tics.

Overriding The Hitfeed locations:
Overriding the hitfeed location is really simple, as you just need to use this function;

HF_OverrideLocation(int xpos, int ypos, int snapflags, int split):
xpos is the x position after being overridden.
ypos is the y position after being overridden.
snapflags are the snapflags the hitfeed will use, corresponding to a direction. (TopLeft = 1, Left = 2, BottomLeft = 3, Top = 4, Middle = 5, Bottom = 6, TopRight = 7, Right = 8, BottomRight = 9)
split is what hitfeed location you want to override. (2 = 2p splitscreen, 3 = 3p/4p splitscreen, anything else = non-splitscreen)
Anything not defined, or set to nil, wont be overridden.

You can clear any override you have defined using this function;
HF_ClearOverride(int split):
split defines what override you want to clear, with the same values as the parameter in the previous function.
Any override you have defined will also be cleared on MapLoad, so keep that in mind.

Overriding base mod hitmessages:
Finally, overriding base mod hitmessages. This is really simple, as there are 2 variables you can give to objects that will override the base mod's corresponding hitmessage fields;
mo.hf_overrideicon will override the icon of any base mod hitmessage caused by that object.
mo.hf_overridenamecolor will override the name color of any object that is sent in a base mod hit message, useful for team colours.
Just be sure to reset these to nil when you are done with them, otherwise it will keep overriding until you do.

Aaaand that's all there is to hitfeed modding! Like with any of my mods with custom mod support, any additional questions you may have can be DM'd to me here on the MB, or to me directly on Discord!

Spoiler: Known Bugs
  • There are cases where an SPB or Eggbox explosion produces a Mine icon, there's nothing I can do about this for now.
  • There's a rare clash where if you hit someone with a thunder shield while invincible, it will display an invincibility icon instead of the thunder shield icon. This is due to how thunder shield hits are detected, there's nothing I can do about this to my knowledge.

Thanks to:

Lat': Coding assistance and replay support.

Spoiler: Changelog
  • General Changes:
    • Lots of the code was rewritten to be optimized, again!
      • This should reduce a lot of the very noticeable lag issues that was caused by having v1.1 added to a server.
    • The hf_minimalmode command has been scrapped, and a new command has been introduced in its place, hf_displaymode, allowing you to change how the hitfeed displays messages! It has 3 modes;
      • 1: Names only, the default setting.
      • 2: Icons only, what hf_minimalmode used to look like.
      • 3: Names + Icons, combines the previous 2 modes!
    • Names are now coloured based on a player's skincolor!
      • This can also be disabled with the newly added command, hf_colorednames.
    • Hitmessage backdrops can now be toggled with the newly added command, hf_backdrops, if you prefer them off.
    • 3P/4P splitscreen games no longer force minimal mode, or in v2's case hf_displaymode 2.
  • Bugfixes:
    • Hitmessage limits set with hf_messagelimit should now properly update when set with the command.
    • Hitfeed should now be compatible with interpolation builds of kart, if you use those.
    • Due to the rewrite, any issues with animated icons should be fixed.
  • Modding Changes:
  • Unfortunately, due to the rewrite. Any mods that supported v1.1 are incompatible with v2, and will require updating. It was either keep compatibility by keeping spaghetti code or rewrite it.
    • All you should need to update is the HM_SendHitMessage parameters and the offsets of your graphics, though.
  • The HF_SendHitMessage function is now a lot more customizable with the source and victim parameters, as you're no longer limited to just players.
  • Objects can now have 2 variables set to override certain base mod fields;
    • mo.hf_overrideicon: Can be set to override the icon they'll use in base mod hitmessages.
    • mo.hf_overridenamecolor: Can be set to override the color they'll use in base mod hitmessages.
  • The modding spoiler has been updated again. Alongside the changes listed here being accounted for, I've updated the entirety of the spoiler to be more concise and understandable.
  • General Changes:
    • Lots of the code was rewritten/optimized.
    • The hf_xpos, hf_ypos and hf_snapflags commands were scrapped, since there's really no reason to change the default location of the hitfeed manually.
      • However, since these commands were scrapped this means there are now definitive locations for the hitfeed in splitscreen!
    • Hyudoro item steals now produce a message in the hitfeed.
    • Shrink now produces a message in the hitfeed.
    • The default message limit was lowered from 5 to 4.
    • The icon for pancakes was resized a little.
  • Bugfixes:
    • The hitfeed should no longer flicker when playing with local splitscreen players.
    • Animated icons no longer animate faster in splitscreen.
  • Modding changes:
    • You can now control where the hitfeed will appear with a new function: HF_OverrideLocation(int xpos, int ypos, int snapflags, int split).
      • Additionally, you can clear any override you have set to restore it to the default location with another new function: HF_ClearOverride(int split)
      • Without using this function though, the hitfeed will return to its default location on mapload.
    • Lots of stuff was exposed for use, such as the table containing all the hitmessages for the hitfeed to display.
    • You can now choose to display a hitmessage without source or victim with the HF_SendHitMessage function.
    • The modding spoiler has been updated to accommodate for all these changes.
  • Initial release.

With that all out of the way, I hope you enjoy hitfeed as much as I did making it, happy karting and battling! (Hitfeed is WAY more useful in battle, try it out!)

Download Now

File Type: zip (16.9 KB, 611 views)


Click image for larger version

Name:	kart0578.gif
Views:	4180
Size:	4.24 MB
ID:	21186   Click image for larger version

Name:	kart0640.gif
Views:	4112
Size:	6.81 MB
ID:	21187   Click image for larger version

Name:	kart0649.gif
Views:	4076
Size:	7.33 MB
ID:	21188  

Supporters / CoAuthors

Show Your Support

  • This addon may not be copied, reproduced or published elsewhere without the author's permission.

Old 08-14-2019   #2
Probably Responsible
D00D64's Avatar

Welcome to releases!
D00D64 is offline   Reply With Quote
Old 08-17-2019   #3
Snu's Avatar

Wouldn't be a initial release from me without an update shortly after said release!

This update includes a couple of changes, such as new hitfeed messages for Hyudoro item steals and Shrink, splitscreen locations for the hitfeed and additions for modders!

A full changelog is available in the original post.
<Iceman404> SnowTH, the worst player ever 2014
<SnowTH> Woop
<SnowTH> I'm so proud
Snu is offline   Reply With Quote
Old 11-14-2019   #4
Oh, THAT Youtuber...
SSG3's Avatar

Idk if this could be related or not, but I'm trying to add Hitfeed support to RTD. For some reason, the 6th graphic in the animation is only being displayed for a single tic before going back to the first one (duration is set to TICRATE/4 ala a quarter of a second)

Could you look into this problem? Thanks in advance!
<Lat'> people thought moonjump and chaos control were OP
<Lat'> screw jump is the new meta
SSG3 is offline   Reply With Quote
Old 05-26-2020   #5
Snu's Avatar

Just a few months off from being a full year, but this long overdue update for Hitfeed is now live!

The entire script for drawing hitmessages has been rewritten and there have been optimizations across the board, getting rid of the very noticeable lag that Hitfeed caused in for clients. Alongside that, 3 new commands for customization has been added, including a brand new display method for the Hitfeed! Moddability for custom mods has also been improved and expanded upon. (Although any mods that supported Hitfeed will need to be updated)
I've also included hitfeed.cfg in the zip attached to the original post, containing all the default values for commands. I'd advise putting this in your root kart folder to minimize long lag spikes when you join a server with hitfeed added.

As usual, the full changelog is available to be read in the original post.
<Iceman404> SnowTH, the worst player ever 2014
<SnowTH> Woop
<SnowTH> I'm so proud

Last edited by Snu; 05-26-2020 at 11:55 AM. Reason: hitfeed.cfg
Snu is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:15 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.