Closed Mart-User closed 3 years ago
L4D2 netprops dump
The heuristics seem straightforward enough; I've written up a basic implementation here that reports the correct offset / element count / element stride: https://github.com/nosoop/sourcemod/tree/legacy-array-props
The main issue I'm seeing is that there isn't currently a way to retrieve both This should be completely feasible with SendProp*
instances matching that name, as each stores important details that the other does not. Not without more invasive modifications to SourceMod, anyways.SendProp::GetArrayProp()
.
I really enjoyed working on this one, thanks for the feature req @MartLegion!
Environment
Description
In L4D2, there is a feature called EMS (Extended Mutation System) that allows us to use some available huds (15 in total) to draw things on the screen. The netprops related to this are on CTerrorGameRules, but one of them ("m_szScriptedHUDStringSet") seems to be a string array.
Currently the "GameRules_SetPropString" function doesn't support passing an element (from array) in its parameters, unlike the others (e.g: GameRules_SetProp, GameRules_SetPropFloat)
https://sourcemod.dev/#/sdktools_gamerules/function.GameRules_SetPropString https://sm.alliedmods.net/new-api/sdktools_gamerules/GameRules_SetPropString
I'm not sure but maybe having this implementation also on GameRules_SetPropString, I could use the element parameter to set the text from the HUD [1-15].
Currently, the only way that I achieved that was by setting
Seems that at every strlen of 128 the text goes to the next hud, but the engine has a limit of networking a strlen of 512. If I pass a higher value, the game crashes. (also, probably is the reason that in the core, the buffer is limited to strlen of 512) So, I can only set the text of 4 huds in the best scenario.
This is all the info that I got:
It all started here https://forums.alliedmods.net/showpost.php?p=2725233&postcount=14, where is mentioned that the EMS system has some netprops related to the GameRules, then I did several tests.
I was able to set most of the netprops to their specific huds but the text.
From a discord talk, according to asherkin:
Some info from netprop dump:
Which probably on SM would look like that:
Some info found by asherkin:
Some valve wiki related to the EMS: https://developer.valvesoftware.com/wiki/L4D2_EMS/Appendix:_HUD