Displaying a Keyvalue as a message

biskuu

L2: Junior Member
Oct 25, 2014
97
22
Hey guys, I am looking for a way to use something like 'game_text' in order to display on-screen to the player the current value of the 'Strength' Keyvalue of a 'func_breakable'.

Is that at all possible to do? Thanks a lot! :>
 

Egan

aa
Feb 14, 2010
1,375
1,721
The only way I know how to do it is to use multiple logic_compare to compare the health outputted from the func_breakable using its OnHealthChanged output.

OnHealthChanged <float> Fired when the health of this breakable changes, passing the new value of health as a percentage of max health, from [0..1].

So make some logic_compare with values set up as 0.75, 0.50, 0.25, 0.05, etc. Set compare value on each to 1. Use OnHealthChanged on the breakable to fire SetCompareValue on each of these using a wildcard target, then 0.05 afterwards (idk if you can do instantly tbh) fire all of their Compare inputs as well. On each logic_compare output OnGreaterThan is where you can trigger the game_text displays (when its value becomes greater than the compare value).

M5mQo5W.png


AvG7Irm.png