Hi After a long time i started using 3dgs again. but facing a problem in my script where i want to display the value of a variable(Ex Health) over an entity. Can somebody help me please. Thanx
Ok i got the script to show global variable over entity but what about local variables is there any way you can show local variables. Example there is only one action attached to all enemies and you want to display there health over there head? Any Idea?
Local variables can't be shown in panels for good reasons: They are only valid local and therfore it can neither be guaranteed, that at least any of these local variables exists, nor can be distinguished between multiple instances of the same local variable. So Helghast's suggestion is the way to go.
Always learn from history, to be sure you make the same mistakes again...
This may work: - define a local string (outside the while loop of the enemy) - get the world coordinates of the position you want the text to be shown at - translate the coordinates to screen coordinates using vec_to_screen - inside the while loop, translate the skill to string using str_for_num function - draw the sting using draw_text and the screen coordinates plus the string
Xarthor it works perfect thank you very much. it was almost impossible to show local variables over entities but you solved it in a very easy way But the str_for_num doesn't work it gives error can you give me an small example please.