Points to take:
- New value should go in MH's replication - it's a bool preferable bDrawMonsterHealth for prevent any confusion with "int" and "float" - please RESPECT old coding convention;
- MH has a deal which can be taken as sample bUseLives - is automated set by Mod if Lives > 0;
- controller will have bUsingHealthDrawing as a config in MH.ini not HUd ini not other place;
- PostBeginPlay will use in controller GameReplicationInfo...bDrawMonsterHealth = bUsingHealthDrawing;
Pretty much simple as long as WE have a sample about bUseTeamColor but... that one has bugs in old HUD - it goes too fast and player doesn't have things ready as I could figure It needs "if (Gri != None) bUseTeamColor = Gri.bUseTeamSkins" or such it would be better to have a bit of delay, you can do the same things with other bool values probably initialized first second from timer in HUD - to draw or not MonsterHealth - condition coming from GRI which is set by controller. Controller is running in server because... Level.Game is located in server and all that game config is in Server. Now you can decide if you want to have health on HUD or not.
Hint: To not mess up like Shrimp, use logs
Code: Select all
log("GameReplication has bDrawMonsterHealth > "@Gri.bDrawMonsterHealth);
defining MonsterReplicationInfoX(GamReplicationinfo) as being GRI for shorter writing and the rest. In this way youl'll see if code gets called properly and not by guessing. If do works, remove logs and recompile it clean.
The second deal is a simple HUD modification in BaseMutator or even controller (is delayed a bit here) BaseMutator with PostBeginPlay is executed first... Here you can address bUseDrawHealth loading HUD accordingly and having 2 different HUD types, 1 with health 2 without health - no bool needed in replication and neither in HUD just... 2 completely different things, let's say the second HUD will have function with drawing removed out.