- Joined
- May 16, 2020
- Messages
- 660
Hi guys,
I want to use Modulo within a loop to only trigger a function at certain intervals. However, the game refuses to give me 0, if for example I divide 0.25 / 0.25 --> rest = 0. As such the "IF Equal to 0.00" part never runs. Any idea what is wrong?
Here the trigger and in-game screenshot:
I want to use Modulo within a loop to only trigger a function at certain intervals. However, the game refuses to give me 0, if for example I divide 0.25 / 0.25 --> rest = 0. As such the "IF Equal to 0.00" part never runs. Any idea what is wrong?
Here the trigger and in-game screenshot:
-
Life Drain Cast Loop
-
Events
-
Time - LD_Timer expires
-
-
Conditions
-
Actions
-
For each (Integer LD_Integer) from 1 to LD_Index, do (Actions)
-
Loop - Actions
-
Set VariableSet LD_Counter[LD_Integer] = (LD_Counter[LD_Integer] + 0.05)
-
Game - Display to (All players) the text: (String((LD_Counter[LD_Integer] mod 0.25)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(LD_Counter[LD_Integer] mod 0.25) Equal to 0.00
-
-
Then - Actions
-
Game - Display to (All players) the text: Damage
-
Unit - Cause LD_Caster[LD_Integer] to damage LD_Target[LD_Integer], dealing LD_Drained_HP[LD_Integer] damage of attack type Spells and damage type Magic
-
Unit - Set life of LD_Caster[LD_Integer] to ((Life of LD_Caster[LD_Integer]) + LD_Drained_HP[LD_Integer])
-
-
Else - Actions
-
-
XXX
-
-
-
-

Last edited: