• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Small question

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
Hi, I was just curious. Is there a way to do wave effect spells without doing TSA (Trigger Sleep Action(s))?? Like for instance, calling down a meteor strike 10 x with a 1 second interval? Without using a new trigger with the event: periodic timer.

+rep for the help.
 
Hashtables! Go find a tutorial. The basics are just that you can bind variables to the specific timer; using the function GetHandleId(timergoeshere), you can get a unique integer representing your timer. A hashtable saves things based on two keys,s o you could use that integer as one of the keys and use the other key as representing the variable you want to save.

If you use Jass, use locals.

By using timers? What.
 
EDIT: Damn, I somehow missed the "no periodic trigger" part :D

Here's one such spell I did a while back. It's basically a customizeable blizzard-like spell.

I use the key "wait" as the timer. In the first trigger, it loops from 1 to 3 for example. It creates units and saves the loop number as the wait. For wave 1 it saves 1 second, for wave 2 it saves 2 seconds and so on. Then in the second trigger, I load the wait time and reduce it by one second. If the wait is zero, then the wave appears and starts bombarding the ground.

I hope this helps.


  • Chaos Rain
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chaos Rain
    • Actions
      • Set Temp_Unit_1 = (Triggering unit)
      • Set Temp_Loc_1 = (Target point of ability being cast)
      • -------- -------------------- --------
      • Set Temp_Integer_1 = (Level of (Ability being cast) for Temp_Unit_1)
      • Set Temp_Real_1 = (CR_Damage + (CR_Damag_Bonus x (Real(Temp_Integer_1))))
      • -------- Offset from landing position based on angle --------
      • Set Temp_Real_2 = ((Tan(CR_Angle)) x CR_Height)
      • -------- How many loops it will take to reach ground --------
      • Set Temp_Real_3 = ((Square root(((Power(Temp_Real_1, 2.00)) + (Power(CR_Height, 2.00))))) / CR_Speed)
      • Set Temp_Real_4 = (Random angle)
      • -------- -------------------- --------
      • For each (Integer B) from 1 to CR_Waves[Temp_Integer_1], do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to CR_Amount, do (Actions)
            • Loop - Actions
              • -------- -------------------- --------
              • Set Temp_Real_5 = (Random angle)
              • Set Temp_Loc_2 = (Temp_Loc_1 offset by (Random real number between 32.00 and (CR_AoE[Temp_Integer_1] / 2.00)) towards Temp_Real_5 degrees)
              • Set Temp_Loc_3 = (Temp_Loc_2 offset by Temp_Real_2 towards Temp_Real_4 degrees)
              • -------- -------------------- --------
              • Unit - Create 1 CR_Dummy for Neutral Passive at Temp_Loc_3 facing (Random angle) degrees
              • -------- -------------------- --------
              • Set Temp_Unit_2 = (Last created unit)
              • -------- -------------------- --------
              • Animation - Change Temp_Unit_2 flying height to CR_Height at 0.00
              • -------- -------------------- --------
              • Custom script: call UnitAddAbility(udg_Temp_Unit_2, 'Aloc')
              • -------- -------------------- --------
              • Unit Group - Add Temp_Unit_2 to CR_Group
              • -------- -------------------- --------
              • Hashtable - Save Temp_Real_1 as (Key damage) of (Key (Last created unit)) in CR_Hash
              • Hashtable - Save Temp_Real_3 as (Key loops_total) of (Key (Last created unit)) in CR_Hash
              • Hashtable - Save (Temp_Real_2 / Temp_Real_3) as (Key move) of (Key (Last created unit)) in CR_Hash
              • Hashtable - Save (Angle from Temp_Loc_3 to Temp_Loc_2) as (Key angle) of (Key (Last created unit)) in CR_Hash
              • Hashtable - Save ((Real((Integer B))) - 1.00) as (Key wait) of (Key (Last created unit)) in CR_Hash
              • Hashtable - Save Handle OfTemp_Unit_1 as (Key caster) of (Key (Last created unit)) in CR_Hash
              • -------- -------------------- --------
              • Custom script: call RemoveLocation(udg_Temp_Loc_2)
              • Custom script: call RemoveLocation(udg_Temp_Loc_3)
      • -------- -------------------- --------
      • Trigger - Turn on Chaos Rain Move <gen>
      • -------- -------------------- --------
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
  • Chaos Rain Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CR_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit_1 = (Picked unit)
          • Set Temp_Unit_2 = (Load (Key caster) of (Key (Picked unit)) in CR_Hash)
          • -------- -------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of Temp_Unit_2) Equal to (Order(blizzard))
              • (Current flying height of Temp_Unit_1) Greater than or equal to CR_Speed
            • Then - Actions
              • Set Temp_Real_2 = (Load (Key wait) of (Key (Picked unit)) from CR_Hash)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Real_2 Greater than or equal to 0.00
                • Then - Actions
                  • Hashtable - Save (Temp_Real_2 - 0.03) as (Key wait) of (Key (Picked unit)) in CR_Hash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Temp_Real_2 - 0.03) Less than or equal to 0.00
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the origin of Temp_Unit_1 using Abilities\Weapons\DemonHunterMissile\DemonHunterMissile.mdl
                      • Hashtable - Save Handle Of(Last created special effect) as (Key eff1) of (Key (Picked unit)) in CR_Hash
                      • Special Effect - Create a special effect attached to the origin of Temp_Unit_1 using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
                      • Hashtable - Save Handle Of(Last created special effect) as (Key eff2) of (Key (Picked unit)) in CR_Hash
                    • Else - Actions
                • Else - Actions
                  • Set Temp_Loc_1 = (Position of Temp_Unit_1)
                  • -------- -------------------- --------
                  • Set Temp_Loc_2 = (Temp_Loc_1 offset by (Load (Key move) of (Key (Picked unit)) from CR_Hash) towards (Load (Key angle) of (Key (Picked unit)) from CR_Hash) degrees)
                  • -------- -------------------- --------
                  • Unit - Move Temp_Unit_1 instantly to Temp_Loc_2
                  • -------- -------------------- --------
                  • Animation - Change Temp_Unit_1 flying height to ((Current flying height of Temp_Unit_1) - (CR_Height / (Load (Key loops_total) of (Key (Picked unit)) from CR_Hash))) at 0.00
                  • -------- -------------------- --------
                  • Custom script: call RemoveLocation(udg_Temp_Loc_1)
                  • Custom script: call RemoveLocation(udg_Temp_Loc_2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current flying height of Temp_Unit_1) Less than 20.00
                • Then - Actions
                  • Set Temp_Loc_1 = (Position of Temp_Unit_1)
                  • Set Temp_Group_1 = (Units within CR_Damage_Radius of Temp_Loc_1)
                  • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
                    • Loop - Actions
                      • Unit - Cause Temp_Unit_2 to damage (Picked unit), dealing (Load (Key damage) of (Key (Picked unit)) from CR_Hash) damage of attack type Chaos and damage type Normal
                  • Special Effect - Create a special effect at Temp_Loc_1 using Abilities\Weapons\Mortar\MortarMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • -------- -------------------- --------
                  • Custom script: call DestroyGroup(udg_Temp_Group_1)
                  • Custom script: call RemoveLocation(udg_Temp_Loc_1)
                • Else - Actions
              • Special Effect - Destroy (Load (Key eff1) of (Key (Picked unit)) in CR_Hash)
              • Special Effect - Destroy (Load (Key eff2) of (Key (Picked unit)) in CR_Hash)
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in CR_Hash
              • -------- -------------------- --------
              • Unit - Add a 1.00 second Generic expiration timer to Temp_Unit_1
              • -------- -------------------- --------
              • Unit Group - Remove Temp_Unit_1 from CR_Group
              • -------- -------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CR_Group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 

Attachments

Status
Not open for further replies.
Back
Top