Another trigger question..

laxperson808

New Member
Reaction score
9
the fastest a wait can wait that ive seen is somewhere around .01? i think. Even with call TriggerSleepAction ( X ) it wont go any faster. Is there a way to get a faster timer? that goes by mabye.. .001? or .0001?
 

laxperson808

New Member
Reaction score
9
nope.. in the end all it does is make the wait = X and the max wait time i geuss is like .01 or .1 ... any other ideas?
 

Ashlebede

New Member
Reaction score
43
Regular waits are somewhere around .27 seconds, depending on your comp's performance. Use a timer instead, or even a trigger with periodic events.

Trigger:
  • Events
    • Time - Every .01 seconds of game time
(Handwritten)

Of course, it can't go a lot under 0.01, but 0.01 is already too low for good performance... it would cause lag in multiplayer games, most likely. .001 would be excessive. If you want WC3 to crash, use an infinite loop, instead. ; )

.01 seconds still occurs 100 times a second. You most definitely do not need something to happen more than 100 times a second. Even 100 times a second is wayyy too much. I usually use .04 or .03 for verrry fast events, such as moving a unit every "frame".

JASS:
function TimerFunc takes nothing returns nothing
    local timer t = GetExpiredTimer()
//same timer as in the other function
endfunction

function Trigger_Actions takes nothing returns nothing
    local timer t = CreateTimer()
    call TimerStart(t,.03,true,function TimerFunc)
//starts the timer as a repeating(true) timer that will execute TimerFunc in .03 seconds
endfunction
 

laxperson808

New Member
Reaction score
9
yea thanks.. i thought of that but i wasn't sure.. k heres another question..
I have a spell that runs through 100% fine and at the end resets ALL varibles needed for it to there start value.. when i cast the spell again it doesnt work..
here are the triggers..
Trigger:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Use melee time of day (for all players)
      • Hashtable - Create a hashtable
      • Set FlameHash = (Last created hashtable)

Trigger:
  • Flame Spiral
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Flame Spiral (Neutral Hostile 1)
    • Actions
      • Set Flame_Spiral_Caster = (Casting unit)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of (Casting unit))
          • Unit - Create 1 Flame Spiral for (Owner of Flame_Spiral_Caster) at Temp_Point facing Default building facing degrees
          • Set Flame_Spiral_Unit[(Integer A)] = (Last created unit)
          • Set Temp_Real[(Integer A)] = (36.00 x (Real((Integer A))))
      • Set Spiral_bool = True
      • Unit - Order Flame_Spiral_Caster to Hold Position

Trigger:
  • Spiral Flames
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • Spiral_bool Equal to True
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of Flame_Spiral_Caster)
          • Set Temp_offset[(Integer A)] = (Temp_Point offset by Temp_Distance[(Integer A)] towards Temp_Real[(Integer A)] degrees)
          • Unit - Move Flame_Spiral_Unit[(Integer A)] instantly to Temp_offset[(Integer A)]
          • Set Temp_Distance[(Integer A)] = (Temp_Distance[(Integer A)] + 5.00)
          • Set Temp_Real[(Integer A)] = (Temp_Real[(Integer A)] + 7.20)
          • Custom script: call RemoveLocation (udg_Temp_Point)
          • Custom script: call RemoveLocation (udg_Temp_offset [GetForLoopIndexA()] )

Trigger:
  • Spiral Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • Spiral_bool Equal to True
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Distance[(Integer A)] Greater than or equal to 750.00
            • Then - Actions
              • Set Spiral_bool = False
              • Set Temp_offset[(Integer A)] = (Position of Flame_Spiral_Unit[(Integer A)])
              • Set Spiral_loop2_bool = True
            • Else - Actions

Trigger:
  • Spiral fin loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • Spiral_loop2_bool Equal to True
    • Actions
      • Set Flame_looop_Count = (Flame_looop_Count + 1)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Temp_offset[(Integer A)] offset by Temp_Real2 towards (Angle from (Position of Flame_Spiral_Unit[(Integer A)]) to (Position of Flame_Spiral_Caster)) degrees)
          • Unit - Create 1 Flame Spiral for (Owner of Flame_Spiral_Caster) at Temp_Point facing Default building facing degrees
          • Hashtable - Save Handle Of(Last created unit) as Flame_looop_Count of (Integer A) in FlameHash
      • Set Temp_Real2 = (Temp_Real2 + 50.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Real2 Greater than or equal to 700.00
        • Then - Actions
          • Set Spiral_loop2_bool = False
          • Set Temp_Group = (Units within 750.00 of (Position of Flame_Spiral_Caster) matching (((Matching unit) belongs to an enemy of (Owner of Flame_Spiral_Caster)) Equal to True))
          • Unit Group - Pick every unit in Temp_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause Flame_Spiral_Caster to damage (Picked unit), dealing 3000.00 damage of attack type Spells and damage type Fire
          • For each (Integer A) from 1 to 10, do (Actions)
            • Loop - Actions
              • For each (Integer B) from 1 to Flame_looop_Count, do (Actions)
                • Loop - Actions
                  • Unit - Kill (Load (Integer B) of (Integer A) in FlameHash)
              • Unit - Kill Flame_Spiral_Unit[(Integer A)]
          • Set spiral_fin_bool = True
        • Else - Actions

Trigger:
  • Spiral fin overall
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
      • spiral_fin_bool Equal to True
    • Actions
      • Set Temp_Real2 = 50.00
      • Set Spiral_bool = False
      • Set Spiral_loop2_bool = False
      • Set spiral_fin_bool = False
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Set Flame_looop_Count = 0
      • Set Flame_Spiral_Caster = No unit
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Temp_Distance[(Integer A)] = 0.00
          • Set Temp_Real[(Integer A)] = 0.00
          • Set Flame_Spiral_Unit[(Integer A)] = No unit
          • Custom script: call RemoveLocation (udg_Temp_offset [GetForLoopIndexA()] )
      • Custom script: call DestroyGroup (udg_Temp_Group)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top