• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Help in Calculation

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
Hello Hivers!

I need help in calculating gradual growth of the damage.

This is the trigger I currently have:
  • Telekinesis Loop
    • Events
      • Time - Every 0.03 seconds of game time
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • -------- ================================================ --------
      • For each (Integer T_Loop) from 1 to T_MaxIndex, do (Actions)
        • Loop - Actions
          • -------- ================================================ --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • T_Time[T_Loop] Greater than or equal to 99.00
              • (Ordered unit) Equal to T_TrigUnit[T_Loop]
            • Then - Actions
            • Else - Actions
              • -------- ================================================ --------
              • Set T_Time[T_Loop] = (T_Time[T_Loop] + 0.03)
              • Set T_MaxDamage[T_Loop] = (((Real(T_SpellLvl[TF_Loop])) x 1000.00) / 33.30)
              • -------- ================================================ --------
      • -------- ================================================ --------
The spell can be channeled up to 3 seconds. During that channel, the damage increases up to "((Real(T_SpellLvl[TF_Loop])) x 1000.00)", so up to 1000, 2000, 3000, 4000, 5000 if casted all 3 seconds. What should I do to make it how do I say... grow properly, equal to the amount of duration channeled, up to "((Real(T_SpellLvl[TF_Loop])) x 1000.00)"? By what should I divide that number?

Tell me if you didn't understand it, I'll try to explain better.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
Divide it by 33.3. If an event fires every 0.03 seconds, it fires ~33.3 times more often than a 1.00 event. (1.00/0.03 = ~33.3).

Edit: I'm a bit confused by the presented trigger, I assume it's not the whole trigger. Reading your post again, it seems you want to increase the damage periodically. Since you want to increase it 5 times within 3 seconds, it means you should increase it every 0.6 seconds (3/5 = 0.6). So the same applies by what I wrote before, but instead of diving number 1.00 by 0.03, you should divide 0.6 by 0.03, which is exactly 20. So divide it by 20 I guess?
 
Level 18
Joined
May 11, 2012
Messages
2,103
Don't be mislead by that "Time". I use that for something else.
I want the damage to properly grow gradually from 0 to the 1000*level of the spell.

I'm not sure how should I perform the calculation.

I do not want to have limit on how many times to increase it during 3 seconds. I want it to increase every 0.03 second up to maximum amount. Maybe I should divide it, maybe subtract from, the problem is, I do not know xD

I have updated the trigger, and this is whole trigger for now.
 
Level 6
Joined
Oct 31, 2014
Messages
170
Can you actualy use the channeling time in a trigger ?
If you stop channeling... the spell doesn't launch at all so ...
 
Level 18
Joined
May 11, 2012
Messages
2,103
Oh I forgot about this thread of mine lol.
Anyway, Chaosy, I will try that. =)

Molaf, what do mean? Am I not using the channeling time in a trigger?
And it would be rather simple to do it like that. I want it abit advanced. =)
 
Status
Not open for further replies.
Top