03.09.2019»»вторник

Cs Go Hud Mods

03.09.2019
    68 - Comments

Shout-out to RedSparr0w for base code and idea! You are the best, man.

How does it work?

If CS:GO had mod support. A little different that the norm on here but There will be more CS:GO Bhop videos out after this one. Enjoy Check out my friend FHMJ from China. He made the animations.

  • Custom CS:GO Huds using GameStateIntegration!.NOTES. Windows task bar must be set to 'Auto-hide' otherwise bottom of the HUD may get cut.
  • Counter-Strike: Global Offensive (CS: GO) will expand upon the team-based action gameplay that it pioneered when it was launched 12 years ago. Add mod Mods Reset.

Basically, CS:GO is streaming data to local app-server, that transformes data and then load it to local webpage.

To-do before running

  • Node.js needs to be installed
  • public/files/cfg/gamestate_integration_observerspectator.cfg needs to be placed in cfg folder in CS:GO location
  • public/files/cfg/observer.cfg needs to be placed in cfg folder in CS:GO location
  • CS:GO needs to run on Fullscreen Windowed (I know people may dislike it, but since it's only for observation, soo..)
  • After running CS:GO and connecting to match (or replaying a demo, you can use this in it too), type to console exec observer.cfg, it makes everything default disappear besides map and killfeed

Configuration

Examples

Video^So this is possible to do with everything below.

Setting up video

How to make it run?

  • Install NodeJS (nodejs.org)
  • Download this repo somewhere
  • Start RUN file (.bat for Windows, .sh for Linux)
  • Run Overlay Exe from here: OVERLAY DOWNLOAD

There are propably milions of bugs and different things, so be prepared.

Admin Panel

After starting the code go to address showing up in terminal/command prompt. You should see Admin Panel divided in three parts - Teams, Players, Create Match and HUDs. In here you can manage data used in HUDs during match ups.

Teams tab

You can here define teams, their name, short names (actually short names are not use anywhere for now), their country flag and logo. Files for teams' logos are being held in public/teams/ and their filename should start from logo-.

Players tab

In Players tab you can define player's real name, displayed name, country flag (can also be set to 'The same as team'), their team and, to identify players, SteamID64.

Create match tab

Here you can set type of match - is this a map of BO2, BO3 or BO5, score for teams and which team it should load to HUD. In case players are on the wrong side (left/right) there is SWAP button to quickly tell the HUD to swap teams' name, logo and flag.Additionaly, if during the match you decide that there is a type in team's or player's information, you can change it (for example on mobile phone, if you allow Node through firewall and you are on the same local network) and then in this tab click the Force Refresh HUD, to make sure all the changes are applied.

Hud

HUDS

This tab shows local HUDs. They are not validated whether or not they actually work, but if any of the files is missing, it will notify you in Warnings column.You can enable/disable each HUD to make it accessible or not. There is also HUD URL information - if you click it, it will redirect you to local webpage, that's serving as a HUD. It is useful if streamer wants to stream HUD separately - for example it can be added in OBS as Browser Source, then you just need to set it to HUD's URL.It might be useful for bigger streaming workspaces, like for setups with different PC dedicated to replays - one server app will manage every HUD on local network, because all HUDs are available all the time, if they are not disabled.

How to create your own HUD

Go to public/huds and copy and paste default folder and rename it to your heart's content - that's how your HUD will display in Admin Panel.template.pug - template of your HUD in PUG, required.style.css - css to your template, reccomended.index.js - engine of your HUD. Look at the default one and at the template to get the idea how it works.

In index.js the most important part is updatePage() function. It is required for any HUD to work, because this function is called when data is coming from CS:GO.

All of main action that will take place on your screen happens in updatePage() function, so when you want to represent some information you will need to write your code within its boundaries.

data argument is being passed to it, and from that we can take actions, such as getting informations about players, map, round phases, etc. Below you will find detailed information about received information :>

data

Methods to obtain different objects:

MethodDescriptionExampleReturned objects
getTeamOne()Information about Team 1 defined in Admin Panelvar teamOne = data.getTeamOne();JSON:{team_name: 'SK Gaming', short_name: 'sk', country_code: 'Brazil', logo: 'logo-1527775279488.png', _id: 'MT3xr6mb37o8Vbe3'}
getTeamTwo()Information about Team 2 defined in Admin Panelvar players = data.getTeamTwo();As above
loadTeam(id) id: StringInformation about team defined in Admin Panel with given idvar players = data.loadTeam('MT3xr6mb37o8Vbe3');As above
getMatchType()Information which matchup type is thisvar matchup = data.getMatchType();String: bo2, bo3 lub bo5
getMatch()Information about match set up in panelvar match = data.getMatch();JSON: {match: 'bo5', team_1: {map_score:1, team:'auto'}, team_2: {map_score:1, team:'MT3xr6mb37o8Vbe3'}}
getPlayers()List of playersvar players = data.getPlayers();(Array of Players)
getCT()CT's informationsvar ct = data.getCT();(Team)
getT()T's informationsvar t = data.getT();(Team)
getObserved()Currently spectated playervar player = data.getObserved();(Player) If you are not spectating anyone, returned Player will have Steam ID 1 and name GOTV
getPlayer(observer_slot) observer_slot: IntPlayer with given observation slot (o-9)var first = data.getPlayer(1);(Player)
phase()Game's current phasevar phase = data.phase();(Phase)
round()Round's informationvar round = data.round();(Round)
map()Map's informationvar map = data.map();(Map)
previously()If anything changed since last update, it will contain the previous valuevar previously = data.previously();(Array) More information about previously() you will find on the bottom

Example:

Objects

Player

Properties

PropertyDescriptionExampleValues
namePlayer's steam namevar name = player.name;//OLOF(String)
real_namePlayer's real name, if set up in panelvar real_name = player.name;//Olof Kajbjer Gustafsson(String)
clanPlayer's current shown clan tagvar clan = player.clan;//fnatic(String) or (NULL)
observer_slotPlayer's spectating numbervar slot = player.observer_slot;//3(int) 0-9
teamPlayer's sidevar team = player.team;//CT(String) CT/T
positionPlayer's current position on mapvar pos = player.position;//-663.10, -198.32, 16.03(String) x, y, z
steamidPlayer's SteamID64var sid = player.steamid;//76561197988627193(String)
teamDataPlayer's personal team information, if set up in panelvar team = player.teamData;(JSON):{team_name: 'SK Gaming', short_name: 'sk', country_code: 'Brazil', logo: 'logo-1527775279488.png', _id: 'MT3xr6mb37o8Vbe3'}

Example:

Methods

MethodDescriptionExampleValues
getWeapons()List of player's weaponsvar weapons = player.getWeapons();(Array of Weapons)
getCurrentWeapon()Player's active weaponvar holding = player.getCurrentWeapon();(Weapon)
getGrenades()Player's grenadesvar grenades = player.getGrenades();(Array of Weapons)
getStats()Player's current statistics (list below)var stats = player.getStats();(Array)

Statistics:

Stat's nameDescriptionExampleValues
healthPlayer's healthvar health = player.getStats().health;(int) 0-100
armorPlayer's kevlarvar armor = player.getStats().armor;(int) 0-100
helmetPlayer's helmetvar helmet = player.getStats().helmet;(bool) True/False
defusekitPlayer's defuse kitvar def = player.getStats().defusekit;(bool) True/False or (NULL)
smokedLevel of being smokedvar flashed = player.getStats().smoked;(int) 0-255 or (NULL)
flashedLevel of being flashedvar flashed = player.getStats().flashed;(int) 0-255
burningLevel of being burnedvar burning = player.getStats().burning;(int) 0-255
moneyPlayer's moneyvar money = player.getStats().money;(int) From 0 and up
round_killsPlayer's kills during roundvar round_kills = player.getStats().round_kills;(int) Usually 0-5
round_killhsPlayer's kills with headshot during roundvar round_killhs = player.getStats().round_killhs;(int) Usually 0-5
equip_valueValue of player's equipmentvar equip_value = player.getStats().equip_value;(int) From 0 and up
killsPlayer's killsvar kills = player.getStats().kills;(int)
assistsPlayer's assistsvar assists = player.getStats().assists;(int)
deathsPlayer's deathsvar deaths = player.getStats().deaths;(int)
mvpsPlayer's MVPsvar mvps = player.getStats().mvps;(int)
scorePlayer's point scorevar points = player.getStats().score;(int)

San andreas weapon location. Example:

Weapon

PropertyDescriptionExampleValues
nameWeapon's asset namevar name = weapon.name;//weapon_awp(String) weapon_..
paintkitWeapon's skin's asset namevar skin = weapon.paintkit;//cu_medusa_awp(String)
typeWeapon's typevar type = weapon.type;(String) Knife/Rifle/SniperRifle/Grenade
stateState of being equipedvar state = weapon.state;(String) holstered/active
ammo_clipAmmo in clipvar clip = weapon.ammo_clip;(int)
ammo_clip_maxMax ammount of ammo in clipvar maxclip = weapon.ammo_clip_max;(int)
ammo_reserveAmmo outside of clipvar res = weapon.ammo_reserve;(int)

Map

PropertyDescriptionExampleValues
nameMap's namevar name = map.name;//de_dust2(String)
modeGame's current modevar mode = map.mode;//competitive(String) competitive/deathmatch/etc..
phaseGame's current phasevar phase = map.phase;(String) warmup/live/intermission/gameover
roundHow many rounds has been played, not which is itvar round = map.round;(int) 0-15
num_matches_to_win_seriesHow many matches needed to win seriesvar need = map.num_matches_to_win_series;(int)
current_spectatorsNumber of current live spectatorsvar spec = map.current_spectators;(int)
souvenirs_totalNumber of dropped souvenirs (majors)var souv = map.souvenirs_total;(int)

Round

PropertyDescriptionExampleValues
phaseRound's phasevar phase = round.phase;(String) freezetime/live/over
win_teamSide who's winvar win_team = round.win_team;(String) CT/T
bombState of bombvar bomb = round.bomb;(String) exploded/defused/planted or (NULL)

Team

PropertyDescriptionExampleValues
scoreTeam's scorevar score_ct = team.score;(int) 0-16 without OTs
nameTeam's namevar name_t = team.name;(String)
flagTeam's flagvar flag_ct = team.flag;(String) ISO 3166 Country Code
timeouts_remainingTeam's remaining timeoutsvar timeouts_t = team.timeouts_remaining;(int)
matches_won_this_seriesMatches won this series by this teamvar won_ct = team.matches_won_this_series;(int)
equip_valueEquipment value of teamvar ct_value = team.equip_value;(int)
team_moneySum of team's players' moneyvar ct_money = team.team_money;(int)

Phase

PropertyDescriptionExampleValues
phaseTeam's scorevar phase = phase.phase;(String) freezetime/live/over/bomb/defuse/paused/timeout_t/timeout_ct
phase_ends_inTeam's namevar time = phase.phase_ends_in;//'8.9'(String) Time (seconds) with decimal

Player object example

Team object example

HUD object example

URLMethodRequest bodyResponse
/api/playersGET{players:[Array of Player objects with unique _id property]} or Status 500
/api/playersPOSTPlayer object{id:String}, specifying new unique _id or Status 500
/api/playersPATCHPlayer object with _id propertyStatus 200 or 500
/api/playersDELETE{userId: String}Status 200 or 500
/api/teamsGET{players: [Array of Player objects with unique _id property]} or Status 500
/api/teamsPOSTFormData object with fields: team_name, short_name, country_code, logo{id:String}, specifying new unique _id or Status 500
/api/teamsPATCHFormData object with fields: team_name, short_name, country_code, logoStatus 200 or 500
/api/teamsDELETE{teamId: String}Status 200 or 500
/api/teams_logoDELETE{teamId: String}Status 200 or 500
/api/hudsGET{players: [Array of HUD objects with unique _id property]} or Status 500
/api/hudsPOST{id: String, enabled: Boolean}Status 200 or 500

Credits

As I mentioned before, RedSparr0w is the man I wouldn't make it without.

Support/Donate

Example

Before Running

  • Windows task bar must be set to 'Auto-hide' otherwise the HUD may get cut off
  • Copy 'gamestate_integration_csgohud.cfg' from cfg folder to your csgo cfg folder 'steamapps/common/Counter-Strike Global Offensive/csgo/cfg/'
  • cfg must be moved prior to launching CS:GO!
  • CS:GO must be running in Fullscreen Windowed!

Notes

  • Hud will be hidden when in menu or console
  • Bomb Timer can be upto 3 seconds off due to CS:GO sending the data after a random delay
  • You will not get a VAC-BAN for using this

Controls

  • CTRL+ALT+Z Choose HUD Menu
  • CTRL+ALT+X Minimize HUD
  • CTRL+ALT+C Close HUD

Install Pre Test/Build

  • you must have Node.js installed
  • run npm install in command prompt in the working directory

Testing

  • npm test or npm start

Build

If Cs Go Hud Mod Support

  • npm run build

Contact

Credits

  • Thanks to https://github.com/Double0negative/CSGO-HUD/commit/a9d5072cf8247c1c7e9e56eb941e2bf003092e8f for the idea and base code.