• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Custom Scoreboard - Another Interaction Example

scary ghost

Grizzled Veteran
Sep 13, 2010
899
316
California
Here's another cool thing you can do with Interactions: make custom scoreboards. The benefit of doing it this way is the user can choose which scoreboard he wants to use rather than having the default one overwritten. For this example, I have created two custom scoreboards: one details cash and deaths, and the other with time played.

I can choose to use one...
http://i46.tinypic.com/300bq09.jpg[url]http://i46.tinypic.com/300bq09.jpg[/URL]

Or the other...
http://i49.tinypic.com/bvo60.jpg[url]http://i49.tinypic.com/bvo60.jpg[/URL]

Or both...
http://i47.tinypic.com/iglyf5.jpg[url]http://i47.tinypic.com/iglyf5.jpg[/URL]

Or hell, lets use the default one as well.
http://i45.tinypic.com/c5ic4.jpg[url]http://i45.tinypic.com/c5ic4.jpg[/URL]

And I can bind buttons to use different scoreboards.
http://i49.tinypic.com/se7fqd.jpg[url]http://i49.tinypic.com/se7fqd.jpg[/URL]

Of course there are downsides to drawing scoreboards through interactions. One is interactions are client side, that is you only information that is replicated to clients. Also, users will need to have the .int file in the system folder before launching KF, otherwise the custom keybinds will not show up. There will also be a lot of copying and pasting from the Scoreboard class, as opposed to simply inheriting from it. You would also need to modify the code to use replicated variables.

Download
https://dl.dropbox.com/u/16251678/HUDScoreboard.zip[url]https://dl.dropbox.com/u/16251678/HUDScoreboard.zip[/URL]

Source
https://github.com/scaryghost/HUDScoreboard[url]https://github.com/scaryghost/HUDScoreboard[/URL]
 
Excellent work as always SG, I'll look to incorporating that into my custom server, (default with cash but no kills but switchable to show kills)

Slight OT Question, I haven't gotten around to checking (and modding the scoreboard myself) but is a players weapon they are currently holding replicated (i'd of thought so so coz clients need to know what other weapons people are holding at anytime to draw the correct model but i havent looked into it)

Was just wondering if i could build off that and make a scoreboard also show the current weapon someone is holding.
 
Upvote 0
Nice one. If you've got time, the official wiki could do with a tutorial like this.
Yeah, I'll put it up under the Coding section.

is there any way to force the client to download the int-file?
Not that I know of. But with workshop integration, you could advertise to clients about subscribing to get the mod downloaded beforehand.
 
Upvote 0