System: Is global variable 'dmg' Greater or equal 100000
MouseKeyboard: On key 1 pressed
This what I have. It doesn't, it still displays the full value.
However, if I do it like this:
It will work, but the first text will say "0", then it will show the value as "123K".
I need to get it to work without showing the "0" first.
Just change the event order.
[quote:2id0okz0] MouseKeyboard: On key 1 pressed
I did that too, and it first thing that comes put is "0" instead of the actual number.
Opps, you need to set the text again in the second event. You could also make the second event a sub event of the first.
[quote:t8cck72c] MouseKeyboard: On key 1 pressed
System: Create object dmgText on layer 1 at (eneTest.X-20, eneTest.Y)
-> dmgText: Set text to global('dmg')
-> System: Set global variable 'dmg' toClamp(floor((1+random(0.225))*(global('ATK') *1.0 - eneTest ('DEF')*3))+1, 0,99999999999)
-> System: Set global variable 'dmg' to str(Int(global('dmg')/1000))&"K"
Still not working. It sets the number to the value "dmg" while the text is still visible instead of setting it at the point of creation. I've updated the cap so can see what I mean.
Okay, I fixed it sort of, by adding it under the press one event.
Maybe I could use a loop to call the damage function.
I'll have to do this forever event.
Develop games in your browser. Powerful, performant & highly capable.
[s:339p1xu4]I'm trying to get this function to work.
However, it's not working. I'm trying to get it so that I don't have to add that create damage event for every single hit and for every single enemy.[/s:339p1xu4]
Nevermind, I had it spawn a layer that wasn't even created yet.=P