i am working on a little "fighting engine" and i want to display some information on a gui. e.g. how many damage ego or his oponent makes, do they hit each other or do they miss, ...
the problem is i don't know how to get these information on a gui label.
i have e.g. something like that:
ran_damage=Random(es_damage);
[...]
if(ran_damage==0){ damage=1;}
[...]
and now i want to display the "damage" on a gui label. e.g. "value of damage(here: 1)" damage. but how can i do that.
the same thing i wanted to do with this:
ran_hit=Random(es_hit);
[...]
if(ran_hit==0){ hit=1;} //means the char hits
if(ran_hit==1){ hit=0;} //means the char misses
[...]
here i want to display: if hit=0 -> "hit" , if hit=1 -> "miss" but again i don't know how.
in haven't found something in the manual so please help me. thx
Look for Label.SetText (AGS v. 2.7+) or SetLabelText (v. 2.62-). And repeatedly_execute. In the manual. If you need more help, ask away, but it should be pretty obvious. To put the integer into the string you can use %d with Label.SetText. Not sure if you can with SetLabelText, but if you can't, then look up StrFormat. ;)
I don't know why you would want to repeatedly_execute. Just SetLabelText after randomizing the result.
Oops...yeah, he shouldn't need to repeatedly update the text in that case... :-[
:P :=
thx. now i got used to it. and it is really easy ;D