• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Delayed Action 1.5a

  • Like
  • Love
Reactions: Tipou and jonbon29
A System which allows you to execute a Trigger after a Delay or/and Frequently, like a timer but this System allows you to save and use the saved data on the later executed Action-Trigger.

Features:

  1. Execute a Trigger after a delay
  2. Execute a Trigger Perodic
  3. Setup an Delayed Action to start another Delayed Action
  4. Save & use Data into a DA. Allowing full Mui effects.
  5. Attach any Arraybased-Variable.
  6. Terminate a running DA
  7. Unpause/Pause a running DA
  8. Show an Grafical effect.
Why use Delayed Action:
  • Delayed Action makes creating custom Delayed Spells/Triggers more simple.
  • This System differs between the first delay and further ones.
  • Actions created by DA are not unique, allows to spamm and stack pretty easy.
  • Delayed Action needs no custom script to be used by the User, except for custom variable cleaning if you use that feature.
  • You get alot of control over the Delayed Spells/Triggers using this.

How to use

System

Access from outside of the System

Tech

Changelog


The Basic Delayed Action needs two Triggers:
1. A Trigger Creating an Delayed Action.
Here you setup all DelayA_P Variables you need and run the DelayA_CONS_CREATE Trigger.​
2. The: DelayA_Action Trigger, This one is called by the System as soon a DelayA_Delay Expired and each time it Reloads.

Inside the DelayA-Action Trigger you are able to read any DelayA__Action variable, which are your previously saved Values (DelayA___P)

This is one of the in the Map contained Demos.
Stormhammer:

On Attack: After 3 seconds an Lightning form the sky will hit the Target and deal 50 Spelldamage.

Creation-Trigger
Setup all P-Variables you need.
  • Stormhammer attack
    • Events
      • Unit - A unit is Attacked
    • Conditions
      • (Level of Stormhammer for (Attacking unit)) != 0
    • Actions
      • -------- Delay in Seconds --------
      • Set DelayA___P_Delay = 3.00
      • -------- Units --------
      • Set DelayA___P_Source = (Attacking unit)
      • Set DelayA___P_Target = (Attacked unit)
      • -------- Effect beeing Called --------
      • Set DelayA___P_Trigger = stormhammer <gen>
      • -------- Grafical Indikator --------
      • Spezialeffekt - Create a special effect attached to the chest of P_Target using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
      • Set DelayA___P_Grafic = (Last created special effect)
      • -------- Create/Start DelayA --------
      • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
DelayA-Action Trigger: Runs after the Delay Expired.
The DelayA__Action.. Variable are used here.
  • stormhammer
    • Events
    • Conditions
      • (DelayA__Action_Target is alive)
  • Actions
    • Spezialeffekt - Create a special effect attached to the origin of DelayA__Action_Target using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
    • Spezialeffekt - Destroy (Last created special effect)
    • Unit - Cause DelayA__Action_Source to damage DelayA__Action_Target, dealing 50.00 damage of attack type Spell and damage type Magic
Reteleport:


Enchants a target after 6 seconds it is teleported to the position it was Enchanted.

  • Reteleport cast
    • Events
      • Unit - A unit casts a spell
    • Conditions
      • (Ability being cast) = Reteleport
    • Actions
      • Set DelayA___P_Delay = 6.00
      • Set DelayA___P_Source = (Triggering unit)
      • Set DelayA___P_Target = (Target unit of ability being cast)
      • Set DelayA___P_Loc = (Position of P_Target)
      • Spezialeffekt - Create a special effect at DelayA___P_Loc using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
      • Set DelayA___P_Grafic = (Last created special effect)
      • Set DelayA___P_Trigger = Reteleport <gen>
      • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
  • Reteleport
    • Events
    • Conditions
      • (DelayA__Action_Target is alive)
    • Actions
      • -------- Eye Candy --------
      • Set loc = (Position of DelayA__Action_Target)
      • Spezialeffekt - Create a special effect at loc using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Spezialeffekt - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_loc)
      • -------- Teleport Back --------
      • Unit - Move DelayA__Action_Target instantly to DelayA__Action_Loc


The Freq Feature allows you to preset a Delayed Action to Create another.
Trap

This Creates Periodic Traps which will have a delay and then will deal dps for a short time.
  • Demo Create Traps
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- ------------ --------
      • -------- Trap Fire --------
      • -------- Every 8 seconds will a Fire spawn which will deal 50 DpS for 4 seconds to Units in an 180 AoE. --------
      • -------- Trap Intervall --------
      • Set DelayA___P_Reload_Dur = 8.00
      • Set DelayA___P_Reloads = DelayA_CONSTANT_UNLIMITED_RELOADS
      • Set DelayA___P_Loc = (Center of Trap <gen>)
      • -------- Trap First Delay --------
      • Set DelayA___P_Freq_Delay = 0.20
      • -------- Trap Action --------
      • Set DelayA___P_Freq_Trigger = Trap DPS <gen>
      • -------- Trap 's Free Info; Here: AoE & DPA --------
      • Set DelayA___P_Freq_Data = 180
      • Set DelayA___P_Freq_Real = 10.00
      • -------- Intervall of Action --------
      • Set DelayA___P_Freq_Reload_Dur = 0.20
      • Set DelayA___P_Freq_Reloads = 19
      • -------- -> Results in 20 (19 Reloads + 1 instantly) Executions of the Action. In this Case 10 * 20 Dmg --------
      • -------- Grafic Stuff --------
      • Set DelayA___P_Freq_Grafic_TargetType = DelayA_CONSTANT_GRAFIC_Point
      • Set DelayA___P_Freq_Grafic_Path = Abilities\Spells\Other\ImmolationRed\ImmolationRedTarget.mdl
      • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
      • -------- ------------ --------
      • -------- ------------ --------
      • -------- Trap Lightning --------
      • -------- Every 5 seconds will a Lightning Strike the Loc dealing 140 Dmg over 0.9 seconds. --------
      • -------- Trap Intervall --------
      • Set DelayA___P_Loc = (Center of Trap 2 <gen>)
      • Set DelayA___P_Reload_Dur = 5.00
      • Set DelayA___P_Reloads = DelayA_CONSTANT_UNLIMITED_RELOADS
      • -------- Trap Effect --------
      • Set DelayA___P_Freq_Trigger = Trap DPS <gen>
      • Set DelayA___P_Freq_Real = 20.00
      • Set DelayA___P_Freq_Data = 100
      • Set DelayA___P_Freq_Reload_Dur = 0.15
      • Set DelayA___P_Freq_Reloads = 6
      • Set DelayA___P_Freq_Grafic_TargetType = DelayA_CONSTANT_GRAFIC_Point
      • Set DelayA___P_Freq_Grafic_Path = Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
      • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
  • Trap DPS
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Einheitengruppe - Pick every unit in (Units within (Real(DelayA__Action_Data)) of DelayA__Event_Loc matching (((Matching unit) is alive) equal True)) and do (Actions)
        • Schleifen - Aktionen
          • Unit - Set life of (Picked unit) to ((Leben of (Picked unit)) - DelayA__Action_Real)


You can attach any Array Based Variable to a started Delayed Action.
This is done by using DelayedA_Index_Entered.
Inside a Delayed Action Trigger you use DelayedA_Index to Access the Custom Variable.

Here a simple Demo, Granting a Hero which has not a full inventory a Ring of Regeneration for 5 seconds.
This is not included in the Demo Map.

  • Custom Variable start
    • Events
      • Unit - A unit is Attacked
    • Bedingungen
      • ((Triggering unit) is a Hero)
      • (Number of items carried by (Triggering unit)) Smaller as (Size of inventory for (Triggering unit))
    • Aktionen
      • Hero - Create Ring of Regeneration and give it to (Triggering unit)
      • Set DelayA___P_Delay = 5.00
      • Set DelayA___P_Trigger = Custom Variable Action <gen>
      • Set DelayA___P_OnTerminate = Custom Variable Clear <gen>
      • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
      • -------- Attaching the Item to the Delayed Action --------
      • Set Item[DelayA_Index_Entered] = (Last created item)
The Action in which we destroy The Ring again.
  • Custom Variable Action
    • Events
    • Conditions
    • Actions
      • Item - Remove Item[DelayA_Index]
The OnTerminate Trigger: Here you Remove/Destroy Objects created by your Custom Variabales.
  • Custom Variable Clear
    • Events
    • Conditions
    • Actions
      • Set Item[DelayA_Index] = No Item


  • Delayed Action loop
    • Events
    • Conditions
    • Actions
      • -------- For Easy Copy; You can Remove this comment and the next Line if you want. --------
      • Set DelayA_Loop = 0
      • Set DelayA_Index = 0
      • For each (Integer DelayA_Loop) from 1 to DelayA_Count, do (Actions)
        • Schleifen - Aktionen
          • Set DelayA_Index = DelayA_Link_Next[DelayA_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditios
              • Or - Any (Conditions) are true
                • Bedingungen
                  • DelayA_Paused[DelayA_Index] Equal False
                  • DelayA_Terminate[DelayA_Index] Equal True
            • Then - Actions
              • Set DelayA_Remainig_Dur[DelayA_Index] = (DelayA_Remainig_Dur[DelayA_Index] - DelayA_CONS_Intervall)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditios
                  • Or - Any (Conditions) are true
                    • Bedingungen
                      • DelayA_Remainig_Dur[DelayA_Index] smaller Equal 0.00
                      • DelayA_Terminate[DelayA_Index] Equal True
                • Then - Actions
                  • -------- Skip Actions ; If Termiation is set. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditios
                      • DelayA_Terminate[DelayA_Index] Equal False
                    • Then - Actions
                      • -------- Creates another Delayed Action if enabled; Based on the Freq Variables. --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditios
                          • DelayA_Freq_Has[DelayA_Index] Equal True
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditios
                              • DelayA_Freq_Intervall[DelayA_Index] smaller Equal 0
                            • Then - Actions
                              • Set DelayA_Freq_Intervall[DelayA_Index] = DelayA_Freq_Intervall_Reload[DelayA_Index]
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditios
                                  • DelayA_Has_Loc[DelayA_Index] Equal True
                                  • DelayA_Freq_Grafic_Targetype[DelayA_Index] Equal DelayA_CONS_GRAFIC_POINT
                                • Then - Actions
                                  • Set DelayA___P_Loc = (Point(DelayA_X[DelayA_Index], DelayA_Y[DelayA_Index]))
                                  • Spezialeffekt - Create a special effect at DelayA___P_Loc using DelayA_Freq_Grafic_Path[DelayA_Index]
                                  • Set DelayA___P_Grafic = (Last created special effect)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditios
                                      • DelayA_Freq_Grafic_Targetype[DelayA_Index] Equal DelayA_CONS_GRAFIC_TARGET
                                    • Then - Actions
                                      • Spezialeffekt - Create a special effect attached to the DelayA_Freq_Attachment[DelayA_Index] of DelayA_Targets[DelayA_Index] using DelayA_Freq_Grafic_Path[DelayA_Index]
                                      • Set DelayA___P_Grafic = (Last created special effect)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditios
                                          • DelayA_Freq_Grafic_Targetype[DelayA_Index] Equal DelayA_CONS_GRAFIC_SOURCE
                                        • Then - Actions
                                          • Spezialeffekt - Create a special effect attached to the DelayA_Freq_Attachment[DelayA_Index] of DelayA_Sources[DelayA_Index] using DelayA_Freq_Grafic_Path[DelayA_Index]
                                          • Set DelayA___P_Grafic = (Last created special effect)
                                        • Else - Actions
                              • Set DelayA___P_Data = DelayA_Freq_Data[DelayA_Index]
                              • Set DelayA___P_Real = DelayA_Freq_Data_Real[DelayA_Index]
                              • Set DelayA___P_Reload_Dur = DelayA_Freq_Reload_Dur[DelayA_Index]
                              • Set DelayA___P_Reloads = DelayA_Freq_Reloads[DelayA_Index]
                              • Set DelayA___P_Source = DelayA_Sources[DelayA_Index]
                              • Set DelayA___P_Target = DelayA_Targets[DelayA_Index]
                              • Set DelayA___P_Trigger = DelayA_Freq_Trigger[DelayA_Index]
                              • Set DelayA___P_Delay = DelayA_Freq_Duration[DelayA_Index]
                              • Set DelayA___P_OnTerminate = DelayA_Freq_OnTerminate[DelayA_Index]
                              • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
                              • Trigger - Run DelayA_Freq_OnStart[DelayA_Index] (ignoring conditions)
                            • Else - Actions
                              • Set DelayA_Freq_Intervall[DelayA_Index] = (DelayA_Freq_Intervall[DelayA_Index] - 1)
                        • Else - Actions
                      • -------- Skip Event-Actions; if No Trigger is set --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditios
                          • DelayA_Trigger[DelayA_Index] UnEqual NO_TRIGGER
                        • Then - Actions
                          • -------- Filll the DE-Action Vari --------
                          • -------- Start the Action Trigger --------
                          • Set DelayA__Action_Data = DelayA_Data[DelayA_Index]
                          • Set DelayA__Action_Real = DelayA_Data2[DelayA_Index]
                          • Set DelayA__Action_Terminate_This = False
                          • Set DelayA__Action_Source = DelayA_Sources[DelayA_Index]
                          • Set DelayA__Action_Target = DelayA_Targets[DelayA_Index]
                          • Set DelayA__Action_Grafic = DelayA_Grafic[DelayA_Index]
                          • Set DelayA__Action_Left_Reloads = DelayA_ReLoads[DelayA_Index]
                          • Custom script: set udg_DelayA__Action_Has_Reloads = not ( udg_DelayA_ReLoads[udg_DelayA_Index] == 0)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditios
                              • DelayA_Has_Loc[DelayA_Index] Equal True
                            • Then - Actions
                              • -------- Handle Event Loc --------
                              • Set DelayA__Action_Loc = (Point(DelayA_X[DelayA_Index], DelayA_Y[DelayA_Index]))
                              • Trigger - Run DelayA_Trigger[DelayA_Index] (checking conditions)
                              • Custom script: call RemoveLocation(udg_DelayA__Action_Loc)
                              • Custom script: set udg_DelayA__Action_Loc=null
                            • Else - Actions
                              • Trigger - Run DelayA_Trigger[DelayA_Index] (checking conditions)
                          • Custom script: if udg_DelayA__Action_Loc_New != null then
                          • Set DelayA_X[DelayA_Index] = (X of DelayA__Action_Loc_New)
                          • Set DelayA_Y[DelayA_Index] = (Y of DelayA__Action_Loc_New)
                          • Set DelayA_Has_Loc[DelayA_Index] = True
                          • Custom script: call RemoveLocation(udg_DelayA__Action_Loc_New)
                          • Custom script: set udg_DelayA__Action_Loc_New=null
                          • Custom script: endif
                        • Else - Actions
                          • Set DelayA__Action_Terminate_This = False
                    • Else - Actions
                  • -------- Termination? --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditios
                      • Or - Any (Conditions) are true
                        • Bedingungen
                          • DelayA_ReLoads[DelayA_Index] Equal 0
                          • DelayA__Action_Terminate_This Equal True
                          • DelayA_Terminate[DelayA_Index] Equal True
                    • Then - Actions
                      • -------- Clearing and Custom Variable Termination --------
                      • Spezialeffekt - Destroy DelayA_Grafic[DelayA_Index]
                      • Trigger - Run DelayA_OnTerminate[DelayA_Index] (ignoring conditions)
                      • Set DelayA_Freq_Has[DelayA_Index] = False
                      • -------- Change Pointers & Reading Array --------
                      • Set DelayA_Link_Next[DelayA_Link_Previous[DelayA_Index]] = DelayA_Link_Next[DelayA_Index]
                      • Set DelayA_Link_Previous[DelayA_Link_Next[DelayA_Index]] = DelayA_Link_Previous[DelayA_Index]
                      • Set DelayA_Pointer_Unused[DelayA_Pointer_Unused_Last] = DelayA_Index
                      • Set DelayA_Pointer_Unused_Last = (DelayA_Pointer_Unused_Last + 1)
                      • Set DelayA_Count = (DelayA_Count - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditios
                          • DelayA_Count Equal 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                      • Set DelayA_Remainig_Dur[DelayA_Index] = DelayA_ReLoad_Dur[DelayA_Index]
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditios
                          • DelayA_ReLoads[DelayA_Index] Greater as 0
                        • Then - Actions
                          • Set DelayA_ReLoads[DelayA_Index] = (DelayA_ReLoads[DelayA_Index] - 1)
                        • Else - Actions
                • Else - Actions
            • Else - Actions
  • Delayed Action add
    • Events
    • Conditions
    • Actions
      • Set DelayA_Count = (DelayA_Count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditios
          • DelayA_Pointer_Unused_Last UnEqual 0
        • Then - Actions
          • Set DelayA_Pointer_Unused_Last = (DelayA_Pointer_Unused_Last - 1)
          • Set DelayA_Index_Entered = DelayA_Pointer_Unused[DelayA_Pointer_Unused_Last]
        • Else - Actions
          • Set DelayA_Pointer_Last_Row = (DelayA_Pointer_Last_Row + 1)
          • Set DelayA_Index_Entered = DelayA_Pointer_Last_Row
      • Set DelayA_Link_Next[DelayA_Index_Entered] = 0
      • Set DelayA_Link_Next[DelayA_Link_Previous[0]] = DelayA_Index_Entered
      • Set DelayA_Link_Previous[DelayA_Index_Entered] = DelayA_Link_Previous[0]
      • Set DelayA_Link_Previous[0] = DelayA_Index_Entered
      • -------- Save P_Data into DA_System Array --------
      • Set DelayA_Terminate[DelayA_Index_Entered] = False
      • Set DelayA_Paused[DelayA_Index_Entered] = False
      • Set DelayA_Remainig_Dur[DelayA_Index_Entered] = DelayA___P_Delay
      • Set DelayA_Sources[DelayA_Index_Entered] = DelayA___P_Source
      • Set DelayA_Targets[DelayA_Index_Entered] = DelayA___P_Target
      • Set DelayA_Trigger[DelayA_Index_Entered] = DelayA___P_Trigger
      • Set DelayA_OnTerminate[DelayA_Index_Entered] = DelayA___P_OnTerminate
      • Set DelayA_Data[DelayA_Index_Entered] = DelayA___P_Data
      • Set DelayA_Data2[DelayA_Index_Entered] = DelayA___P_Real
      • Set DelayA_ReLoad_Dur[DelayA_Index_Entered] = DelayA___P_Reload_Dur
      • Set DelayA_ReLoads[DelayA_Index_Entered] = DelayA___P_Reloads
      • Set DelayA_Grafic[DelayA_Index_Entered] = DelayA___P_Grafic
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditios
          • Or - Any (Conditions) are true
            • Bedingungen
              • DelayA___P_Freq_Trigger UnEqual NO_TRIGGER
              • DelayA___P_Freq_Grafic_Path UnEqual <Leerer String>
        • Then - Actions
          • Set DelayA_Freq_Has[DelayA_Index_Entered] = True
          • Set DelayA_Freq_Attachment[DelayA_Index_Entered] = DelayA___P_Freq_Grafic_Attach
          • Set DelayA_Freq_Data[DelayA_Index_Entered] = DelayA___P_Freq_Data
          • Set DelayA_Freq_Data_Real[DelayA_Index_Entered] = DelayA___P_Freq_Real
          • Set DelayA_Freq_Duration[DelayA_Index_Entered] = DelayA___P_Freq_Delay
          • Set DelayA_Freq_Grafic_Targetype[DelayA_Index_Entered] = DelayA___P_Freq_Grafic_Target
          • Set DelayA_Freq_Grafic_Path[DelayA_Index_Entered] = DelayA___P_Freq_Grafic_Path
          • Set DelayA_Freq_Intervall[DelayA_Index_Entered] = DelayA___P_Freq_Intervall
          • Set DelayA_Freq_Intervall_Reload[DelayA_Index_Entered] = DelayA___P_Freq_Intervall
          • Set DelayA_Freq_OnStart[DelayA_Index_Entered] = DelayA___P_Freq_OnStart
          • Set DelayA_Freq_Reload_Dur[DelayA_Index_Entered] = DelayA___P_Freq_Reload_Dur
          • Set DelayA_Freq_Reloads[DelayA_Index_Entered] = DelayA___P_Freq_Reloads
          • Set DelayA_Freq_OnTerminate[DelayA_Index_Entered] = DelayA___P_Freq_OnTerminate
          • Set DelayA_Freq_Trigger[DelayA_Index_Entered] = DelayA___P_Freq_Trigger
        • Else - Actions
          • Set DelayA_Freq_Has[DelayA_Index_Entered] = False
      • -------- Save Loc if used --------
      • Custom script: if udg_DelayA___P_Loc != null then
      • Set DelayA_X[DelayA_Index_Entered] = (X of DelayA___P_Loc)
      • Set DelayA_Y[DelayA_Index_Entered] = (Y of DelayA___P_Loc)
      • Set DelayA_Has_Loc[DelayA_Index_Entered] = True
      • Custom script: else
      • Set DelayA_Has_Loc[DelayA_Index_Entered] = False
      • Custom script: endif
      • -------- -------------------- --------
      • Trigger - Turn on Delayed Action loop <gen>
      • -------- Clean Parameters --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditios
          • DelayA_CONS_CLEAR_PARAMETER Equal True
        • Then - Actions
          • Custom script: call RemoveLocation(udg_DelayA___P_Loc)
          • Custom script: set udg_DelayA___P_Loc=null
          • Set DelayA___P_Data = 0
          • Custom script: set udg_DelayA___P_Grafic = null
          • Set DelayA___P_Delay = 0.00
          • Set DelayA___P_Real = 0.00
          • Set DelayA___P_Reload_Dur = 0.00
          • Set DelayA___P_Reloads = 0
          • Set DelayA___P_Source = Keine Einheit
          • Set DelayA___P_Target = Keine Einheit
          • Set DelayA___P_Trigger = NO_TRIGGER
          • Set DelayA___P_OnTerminate = NO_TRIGGER
          • Set DelayA___P_Freq_Delay = 0.00
          • Set DelayA___P_Freq_Grafic_Target = 0
          • Set DelayA___P_Freq_Grafic_Attach = <Leerer String>
          • Set DelayA___P_Freq_Grafic_Path = <Leerer String>
          • Set DelayA___P_Freq_Data = 0
          • Set DelayA___P_Freq_Delay = 0.00
          • Set DelayA___P_Freq_OnStart = NO_TRIGGER
          • Set DelayA___P_Freq_Real = 0.00
          • Set DelayA___P_Freq_Intervall = 0
          • Set DelayA___P_Freq_Reload_Dur = 0.00
          • Set DelayA___P_Freq_Reloads = 0
          • Set DelayA___P_Freq_OnTerminate = NO_TRIGGER
          • Set DelayA___P_Freq_Trigger = NO_TRIGGER
        • Else - Actions
  • Delayed Action init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Constant Intervall should not be Changed anywhere Else. --------
      • -------- Depending on usage you can Increase this value or decrease --------
      • -------- Higher Values make it more Incorrect but leighter on CPU --------
      • Set DelayA_CONS_Intervall = 0.05
      • Trigger - Add to Delayed Action loop <gen> the event (Time - Every DelayA_CONS_Intervall seconds of game time)
      • -------- This says if you want that the parameter values are nulled after usage --------
      • -------- can be changed before you call the "Delayed Effect add" Trigger --------
      • Set DelayA_CONS_CLEAR_PARAMETER = True
      • -------- Constants --------
      • Set DelayA_CONS_UNLIMITED_RELOADS = -1
      • Set DelayA_CONS_GRAFIC_POINT = 1
      • Set DelayA_CONS_GRAFIC_SOURCE = 2
      • Set DelayA_CONS_GRAFIC_TARGET = 3
      • Set DelayA_CONS_CREATE = Delayed Action add <gen>
      • -------- Some Copy Paste values --------
      • Set DelayA__Action_Has_Reloads = False


This is a helper function contained in the System which shows access from outside of the Delayed Action infrastructure.

In this Trigger we terminate all Delayed Actions created by the unit DelayA___P_Source.
  • DA Terminate PSource
    • Events
    • Conditions
    • Actions
      • Set DelayA_Index = 0
      • For each (Integer A) from 1 to DelayA_Count, do (Actions)
        • Schleifen - Aktionen
          • Set DelayA_Index = DelayA_Link_Next[DelayA_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DelayA_Sources[DelayA_Index] Equal DelayA___P_Source
            • Then - Actions
              • Set DelayA_Terminate[DelayA_Index] = True
            • Else - Actions


Order of executions in the Delayed Action Loop:
  1. Freq Creation
  2. Freq - OnStart
  3. DelayA Trigger
  4. DelayA OnTermination/ or only Reload

List of Variables API
-----------
Creation
-----------
DelayA___P_Delay The First Delay
DelayA___P_Trigger which Aciton shall be done
DelayA___P_Reload_Dur The Intervall
DelayA___P_Reloads How often you Repeat execution of the Trigger
DelayA___P_Source The unit triggering all that
DelayA___P_Target The Unit suffering/benefiting, if there is one
DelayA___P_Data A Free simple Number
DelayA___P_Real A Free Real Number
DelayA___P_Loc If you want to save a Location
DelayA___P_Grafic A Spezialeffect you might want to save; It is destroyed on overall Expire
DelayA___P_OnTerminate This Trigger is called as soon your DelayA Ends. Cleaning

Freq Variables to let an DelayA start another DelayA.
----------
DelayA___P_Freq_Data A Free to use Integer for Frequenlly Effects:
DelayA___P_Freq_Real A Free to use Real
DelayA___P_Freq_Delay First Delay of your secondary DelayA
DelayA___P_Freq_Intervall If set above 0 the Freq Effect will only trigger every x reloads of the primary DelayA; 1 Means every second Reload of the primary DelayA.
DelayA___P_Freq_Grafic_TargetType Says who gets the Grafical effect if Spawned. Use the Constants to choose the right
DelayA___P_Freq_Grafic_Attachment If TargetType = Target/Source; On which Attachment Point for example overhead.
DelayA___P_Freq_Grafic_Path Which Modell has the Grafic Effect.
DelayA___P_Freq_Reload_Dur Intervall of secondary DelayA
DelayA___P_Freq_Reloads How often does your secondary DelayA repeats

For Custom Variables:
DelayA___P_Freq_OnStart An trigger running directly after the Creation of the Freq DelayA. Here you can create/setup your custom Variables. [use udg_DelayA_Index_Entered]
DelayA___P_Freq_OnTerminate This will Run if the Freq Trigger does expire. Should be used to clean custom variables.

Action This Variables are used in your DelayA-Action Trigger
-----------
Read-only
--------
DelayA__Action_Source Saved Source
DelayA__Action_Target Saved Target
DelayA__Action_Data Free Integer
DelayA__Action_Real Free Real
DelayA__Action_Loc, If set earlier; It is cleaned by the System automataclly
DelayA__Action_Has_Reloads
DelayA__Action_Left_Reloads
DelayA__Action_Grafic

Write-able
---------
DelayA__Action_Loc_new, to change the Loc saved
DelayA__Action_Terminate_This Terminates the DelayA triggering the Action.
/
Custom Variables
---------------
To use Custom Variables it has to be an Array-based Varible.
Connection your Variable with an DelayA is done over three Steps.

1.Set them with the index [udg_DelayA_Index_Entered] which the System offers after you called the "Delayed Action add"-Trigger.
udg_Your_Vari [udg_DelayA_Index_Entered] = your Value
2.Termination-Trigger
Destroy/null used custom Variables
call DestroyGroup( udg_Your_Group[udg_DelayA_Index] )

A Demo showing this is Static Volt, Greater Heal.
/
List of System Variables
-----------------
Constants
-----------
DelayA_CONS_CLEAR_PARAMETER If true it will clear and null DelayA_Parameters
DelayA_CONS_GRAFIC_POINT Value of TargetType
DelayA_CONS_GRAFIC_SOURCE ""
DelayA_CONS_GRAFIC_TARGET ""
DelayA_CONS_Intervall Should only be changed at Delayed Action Init;
DelayA_CONS_UNLIMITED_RELOADS -1; Negative Reloads mean unlimited Repeats
DelayA_CONS_ADD_DelayA A easy Reference to Delayed Action add Trigger. Simplifies Copy and creating new ones, if you got alot of Triggers starting with D.

Index-Values
-----------
DelayA_First The Lowest Index of Running DelayA
DelayA_Last The Highest Index
DelayA_Index The Index of the current DelayA DataPack
Use THis inside a DelayA_Action/Terminate Trigger to access the DelayA Datapack
DelayA_Link_Next Linked List Reference, use this to Acces values from outside of the DelayA System, Checkout Delayed Action Helper
DelayA_LInk_Previous Linked List Reference
DelayA_Index_Entered Index of a new created/started DelayA.
DelayA_Loop Current Index in the Loop do not Use that
DelayA_Pointer_Last_Row Size of Data-Tabell
DelayA_Pointer_Unused_Last Amount of unused DelayA-Pointers (-1 at start)
DelayA_Pointer_Unused Array of Unused Pointers/Free to use Data Rows

Arraybased-System
-----------
DelayA_Freq_Attachment
DelayA_Freq_Data
DelayA_Freq_Data_Real
DelayA_Freq_Duration
DelayA_Freq_Grafic_Path
DelayA_Freq_Grafic_TargetTyp
DelayA_Freq_Has
DelayA_Freq_Intervall
DelayA_Freq_Intervall_Reload
DelayA_Freq_OnStart
DelayA_Freq_OnTerminate
DelayA_Freq_Reload_Dur
DelayA_Freq_Trigger
DelayA_Data The Free Integers
DelayA_Data2 The Free Real
DelayA_Grafic
DelayA_Has_Loc
DelayA_Paused
DelayA_ReLoad_Dur
DelayA_ReLoads
DelayA_Remainig_Dur
DelayA_Sources
DelayA_Targets
DelayA_Terminate
DelayA_Trigger
DelayA_OnTerminate
DelayA_X
DelayA_Y



Version 1.1
First Release​
Version 1.2
Un/Pause, Permanent Delayed Action​
Version 1.3
Preset Delayed Action to start another Delayed Action, This is called Freq
Terminate DA from outside​
Version 1.3a
Documentation Update
Renamed from Delayed Effect -> Delayed Action​
Version 1.3c
Optimizing of Version Row 1.3​
Version 1.4
Pointers were implemented which Point to the Data-Row beeing used.
Removed the Need of Reindex Triggers of Version 1.3 Row.
Consider OnTermination still is needed to Remove/Destroy used Objects.​
Version 1.4a
Fixed a critical Bug Implemented in V1.4.​

Sternenregen -> Star circle
Sternregen is now in English
Added a new Constant: DelayA_CONS_ADD_DelayA.
The new constant makes copying more easy and sets the Creating trigger at the top of the Trigger List.

Changed the Prefix of System Variable: DA -> DelayA
This ones were shortend to accept the new Prefix.
DA___P_Freq_Grafic_Attachment -> DelayA___P_Freq_Grafic_Attach
DA___P_Freq_Grafic_TargetType -> DelayA___P_Freq_Grafic_Target
DA__Action_Has_Reloads_Left -> DelayA__Action_Has_Reloads
DA__Action_Remaining_Reloads -> DelayA__Action_Left_Reloads
DA__Action_Terminate_This_DA -> DelayA__Action_Terminate_This
DA_Pointer_Unused_Last_Index -> DelayA_Pointer_Unused_Last
Term Changes:
DA_Constant -> DelayA_CONS
DA_Frequently -> DelayA_Freq


Version 1.5
Changed Access type: Dynamic Pointer -> Linked List​
Verson 1.5a
Optimized the Linked List​

Credits

Maker
zv27

Contents

Delayed Action 1.5a (Map)

Thanks for your Feedback.
I uploaded a newer Version (V1.2) cause of some fatal design Misstakes:
  • DE now try to Refill old Unused Indexes first before using new ones, the old behaviour could together with unlimted Duration reach Max Arrazsize pretty Easy.
  • Negative Reloads won't countdown anymore, cause the are there to be unlimited.
  • Removed an unneeded Line in a Demo.
  • Added an Helper Folder containing two Triggers to pause/unpause all current DE.
  • Added a new Vari udg_DE_Index_Entered, Representing the Index in which you DE was created.
 
Last edited:
Level 10
Joined
Aug 21, 2010
Messages
316
Interesting, I am actually surprised over the fact that this did not exist already.

A few years ago there was such a system only much more advanced(Jass and vJass version)
system is actually supported everything concerning the special effects(static non-static,periodic,delayed etc.)
but then I suddenly decided to remove all my resources.
So this is nothing new.

A few ideas from my system.
- the possibility to change the model during the execution.
- the possibility of combining several models during the execution.(
For example, at the same time apply a fire, ice, poison etc.)
- the possibility that the system recognizes whether the effect is static or not static.
- the possibility that the system selects a random effect from the list or database of effects.
- the possibility that the system defines the location where the effect will be applied(For example, hand head, weapons, etc.)For this I use integers, eg: left hand = 1,right hand =2,weapon=3 etc.
 
Last edited:
A few years ago there was such a system only much more advanced(Jass and vJass version)
system is actually supported everything concerning the special effects(static non-static,periodic,delayed etc.)
but then I suddenly decided to remove all my resources.
So this is nothing new.

A few ideas from my system.
- the possibility to change the model during the execution.
- the possibility of combining several models during the execution.(
For example, at the same time apply a fire, ice, poison etc.)
- the possibility that the system recognizes whether the effect is static or not static.
- the possibility that the system selects a random effect from the list or database of effects.
- the possibility that the system defines the location where the effect will be applied(For example, hand head, weapons, etc.)For this I use integers, eg: left hand = 1,right hand =2,weapon=3 etc.

Quite Some nice ideas, i'll overthink how to add some of them as optional features.
 
Updated to Version 1.3.
This Update added the Features:
  • Delayed Effects can start Frequently own Delayed Effects, which can be setuped like normal ones. (@zv27 I had that idea as i was creating your suggestion of spawing Grafical effects.)
  • You can Terminate Delayed Effects from outside.
  • P_Variables gained the Prefix "DE___"
Updated/Added new Demos showing this Features.
 
No haven't done that before. But i did after you mentioned them.
->They are pretty different than mine and indeed use more advanced techniques:

Almia's "Timed Effect":
Has not much to do with "DE" (this system), cause "TE" is about placing grafical effects for a duration.

Wietlol's "Effect over Time":
Is overlapping with "Delayed Effect" indeed. But EoT is focusing on Buffs & Units and allows custom Code beeing triggered by using Custom Events. It requiers costum script in every trigger using EoT (you can copy paste the needed Lines in most cases, so this is fine). Indeed EoT is powerful and the better choice, if you plan to create unique Unit-Effects like Buffs or Curses.

Mine "Delayed Effect":
Allows you to execute Triggers after a delay/frequently. DE does not need custom script to be used and can hold any Array-Variable connected to a running DE. Supports from itself location based Actions which EoT does not ( with this i mean without the use of custom script). Additional i have the cool Feature of predfined DE starting a DE which is needed for intervalic Traps dealing DpS or Vulcans shooting multiple rocks over time. DE are not unique allows you to spam them.

TE and EoT might be much better as i say, only checked out what thy do in general.

Renaming this System (Delayed Effect) might be a good idea maybe: "Delayed Action" to stop that confuse with "Timed Effect", what you think about that.
 
I also thought first it has to do something with gariphical effects ( have not read code), maybe your alternative name would be better.
From the description I'm not very sure yet how it exactly will achieve something that one normal can't easily achieve, but I'm curious
to check it out (some later though).

By the way, I see that you don't use an english editor. You can always PM me with onUpdate for example and semd me the map, so I can easily copy and paste english triggers for you.
 
Level 10
Joined
Aug 21, 2010
Messages
316
This system is different from the above system and should be approved.It has a totally different approach.
After all, to me it all looks like Rising Dusk's system from 2007.
Unfortunately, originality is gone all copy each other constantly repeating the same things.

Edit:
It seems that the spell section slowly becomes boring.
 
Last edited:
Level 38
Joined
Feb 27, 2007
Messages
4,951
After reading the threads and looking at them in the WE my understanding is that this system isn't really fundamentally different from Weitlol's. Yours executes the triggers directly and his relies on "variable becomes equal to..." events for the triggers, while his requires a few minor JASS calls in custom script lines (that any GUI user can figure out/undestand IMO). They both do approximately the same things:
  • Catch some regular event
  • Store these sorts of things: caster, target (unit/point), 1 real, 1 integer
  • Allow creation/automatic cleanup of 1 effect per instance
  • Run another trigger after a delay
Ultimately both are just systems for the automated storage/retrieval of data you would ideally save locally (if you were writing JASS) or in a struct (if you were using vJASS) but are forced to store globally because GUI can't do either. Unless I fundamentally misunderstand the code, both are effectively 'general-purpose spell struct that loops through all instances every X seconds' done in GUI.

Convince me there's a reason I would use yours over Weitlol's.
 
After reading the threads and looking at them in the WE my understanding is that this system isn't really fundamentally different from Weitlol's. Yours executes the triggers directly and his relies on "variable becomes equal to..." events for the triggers, while his requires a few minor JASS calls in custom script lines (that any GUI user can figure out/undestand IMO). They both do approximately the same things:
  • Catch some regular event
  • Store these sorts of things: caster, target (unit/point), 1 real, 1 integer
  • Allow creation/automatic cleanup of 1 effect per instance
  • Run another trigger after a delay
Ultimately both are just systems for the automated storage/retrieval of data you would ideally save locally (if you were writing JASS) or in a struct (if you were using vJASS) but are forced to store globally because GUI can't do either. Unless I fundamentally misunderstand the code, both are effectively 'general-purpose spell struct that loops through all instances every X seconds' done in GUI.

Convince me there's a reason I would use yours over Weitlol's.
You understood the full purpose of this System.

Don't need to convince you as you are able to use advanced WE scripting -> you are not the target group of this Uploaded System at all.

As i said before Weitlol's EOT focuses on Units and Buffs the result is Unique Unit to Unit orientated effects, good if you want such a behaviour, but nasty if you don't want it.

Mine does not support Buffs at all resulting in a easier creation of not Unique Effects/not Unit-Unit orientated effects and allows to stack them as seperated instances.
 
It is possible to manipulate any Data, including time and the Action-Trigger itself, of running Delayed Actions from outside of the Action-Trigger, but there is no easy function. You have to directly manipulate the data inside the Array, at the Position inside the Table which a DA_Pointer points to.
For Stormhammer do it that way:
First you have to change the Storm-Action Trigger, to support Custom Data.
  • stormhammer
    • Events
    • Conditions
      • (DA__Action_Target is alive)
    • Actions
      • Spezialeffekt - Create a special effect attached to the origin of DA__Action_Target using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
      • Spezialeffekt - Destroy (Last created special effect)
      • Unit - Cause DA__Action_Source to damage DA__Action_Target, dealing (50.00 + DA__Action_Real) damage of attack type Spell and damage type Magic
Second you need to change the Stormhammer Trigger.
I assumed For each Stormhammer user an own Action will be used.
  • Stormhammer attack powerup
    • Events
      • Unit - A unit was attacked
    • Conditions
      • (Level of Sturmhammer for (Attacking unit)) Unequal 0
    • Actions
      • -------- Check if this allready Exists --------
      • For each (Integer A) from DA_First to DA_Last, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • IF - Conditions
              • DA_Sources[DA_Pointer[(Integer A)]] Equal (Attacking unit)
              • DA_Targets[DA_Pointer[(Integer A)]] Equal (Attacked unit)
              • DA_Trigger[DA_Pointer[(Integer A)]] Equal stormhammer <gen>
            • Then - Actions
              • Set DA_Remainig_Dur[DA_Pointer[(Integer A)]] = 3.00
              • Set DA_Data2[DA_Pointer[(Integer A)]] = (DA_Data2[DA_Pointer[(Integer A)]] + 50.00)
              • Skip remaining actions
            • Else - Actions
      • -------- If not was hit, Continue with normal --------
      • -------- Delay in Seconds --------
      • Set DA___P_Delay = 3.00
      • -------- Units --------
      • Set DA___P_Source = (Attacking unit)
      • Set DA___P_Target = (Attacked unit)
      • -------- Effect beeing Called --------
      • Set DA___P_Trigger = stormhammer <gen>
      • -------- Grafical Indikator --------
      • Spezialeffekt - Create a special effect attached to the chest of DA___P_Target using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
      • Set DA___P_Grafic = (Last created special effect)
      • -------- Create/Start DE --------
      • Trigger - Run Delayed Action add <gen> (ignoring conditions)
Edit: Be aware that Running Delayed Actions-Data-Array have to be accessed over a DA_Pointer outside a Action-trigger.
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,783
I'm getting some issues with a delayed action it seems almost random
sometimes the unit stops taking damage all together despite graphic effect remaining (which I took out)
The reload duration starts getting faster and faster


  • Venom Attack Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Venom for (Attacking unit)) Not equal to 0
    • Actions
      • For each (Integer A) from DA_First to DA_Last, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DA_Sources[DA_Pointer[(Integer A)]] Equal to (Attacking unit)
              • DA_Targets[DA_Pointer[(Integer A)]] Equal to (Attacked unit)
              • DA_Trigger[DA_Pointer[(Integer A)]] Equal to Venom <gen>
            • Then - Actions
              • Set DA_ReLoad_Dur[DA_Pointer[(Integer A)]] = 1.00
              • Set DA_ReLoads[DA_Pointer[(Integer A)]] = 8
              • Set DA_Data[DA_Pointer[(Integer A)]] = (Level of Venom for (Attacking unit))
              • Skip remaining actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set DA___P_Data = (Level of Venom for (Attacking unit))
          • Set DA___P_Delay = 0.05
          • Set DA___P_Reload_Dur = 1.00
          • Set DA___P_Reloads = 8
          • Set DA___P_Source = (Attacking unit)
          • Set DA___P_Target = (Attacked unit)
          • Set DA___P_Trigger = Venom <gen>
          • Trigger - Run Delayed Action add <gen> (ignoring conditions)
        • Else - Actions
  • Venom
    • Events
    • Conditions
      • (DA__Action_Target is alive) Equal to True
      • (DA__Action_Target has buff Venom ) Equal to True
    • Actions
      • Unit - Cause DA__Action_Source to damage DA__Action_Target, dealing ((4.00 x (Real((Level of Venom for DA__Action_Source)))) + (((Max life of DA__Action_Target) - (Life of DA__Action_Target)) x ((0.04 + (0.01 x (Real((Level of Venom for DA__Action_Source))))) / 4.00))) damage of attack type Spells and damage type Magic
      • Special Effect - Create a special effect attached to the chest of DA__Action_Target using Abilities\Spells\Undead\DeathandDecay\DeathandDecayDamage.mdl
      • Special Effect - Destroy (Last created special effect)

Edit

Thanks works perfect now, lovely system
 
Last edited:
Which Version of Delayed Action you use?
Stands at the First Line of Docu.

Edit: If it is not Version 1.4a I Recomment updating.
After Rereading your Comment, comparing it with my Memory (Bugs in Version 1.4) and finding no Logical error in your posted Trigger, i'm sure you use Version 1.4 which has a critical system Bug.

Advice: Following is no error but unneeded :)
  • A Delay equal or below the Systems Intervall has no need to be set, default 0.05.
  • The Reload Duration Resetting is not needed.
 
Last edited:
Thanks for the submission, not much to say about changes needed on this one the code seems generally clean and fine
Your indexing method is rather convoluted, it could be simplified into this form of linked list [Trigger] - Why dynamic indexing is flawed and people should use linked list instead rather than the one your using right now (will reduce allocation and recycling lines) though I'll note that in the example Spell_Last can be substituted with Spell_Prev[0]. This is the only thing that needs to be changed that I can see for now

Also can you use a longer prefix? (3-4 characters minimum) it's a relatively new regulation we're using, it won't stop it from being approved but it'll better help avoid system/spell collisions
It'd be helpful it you could come up with a specific list of reason why people should use this over the more advanced equivalents (simpler but easier to use, that kind of thing) just to make judgement on this one more clear
 
As I mentioned before Spell_Last can be replaced with Spell_Prev[0], this will always reference the last node without the need of another variable to identify it or in this case DelayA_Link_Previous[0] can replace Set DelayA_Last (and then you can get rid of the IF statement for it in the recycling and the "Set DelayA_Last = DelayA_Index_Entered" line, as an aside I'm not sure what "Reduces Connections inside the Action code from 1 <> n -> 1 <> 1." means in your description - at any rate I'll discuss the merits of the system over the other similar ones with KILLCIDE, from a code perspective this is approvable now and probably will be in a little bit

Edit: It's a decent GUI-Friendly equivalent for some of the more advanced systems we have on the hive, containing the core features without excess could also be considered a plus, approved
You could make it so you can place effects on both the source and target at the same time
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,783
Does the edit to the stormhammer still work?

  • Stormhammer attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Storm Hammers for (Attacking unit)) Not equal to 0
    • Actions
      • For each (Integer A) from DelayA_First to DelayA_Last, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DelayA_Sources[DelayA_Pointer[(Integer A)]] Equal to (Attacking unit)
              • DelayA_Targets[DelayA_Pointer[(Integer A)]] Equal to (Attacked unit)
              • DelayA_Trigger[DelayA_Pointer[(Integer A)]] Equal to stormhammer <gen>
            • Then - Actions
              • Set DelayA_Remainig_Dur[DelayA_Pointer[(Integer A)]] = 3.00
              • Set DelayA_Data2[DelayA_Pointer[(Integer A)]] = (DelayA_Data2[DelayA_Pointer[(Integer A)]] + 50.00)
              • Skip remaining actions
            • Else - Actions
              • -------- Delay in Seconds --------
              • Set DelayA___P_Delay = 3.00
              • -------- Units --------
              • Set DelayA___P_Source = (Attacking unit)
              • Set DelayA___P_Target = (Attacked unit)
              • -------- Effect beeing Called --------
              • Set DelayA___P_Trigger = stormhammer <gen>
              • -------- Grafical Indikator --------
              • Special Effect - Create a special effect attached to the chest of DelayA___P_Target using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
              • Set DelayA___P_Grafic = (Last created special effect)
              • -------- Create/Start DE --------
              • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)

As well as the addition to the ending trigger of delayA_Action_Real + 50.00
 
The Delayed Action-Trigger don't have to be changed from what i said last time.
The Stormhammer Attack has to be changed to this:
Cause of the Change of Data Access.

This way.
  • Stormhammer attack
    • Events
      • Unit - Unit is attacked
    • Conditions
      • (Level of Sturmhammer for (Attacking unit)) not equal 0
    • Actions
      • Set DelayA_Index = 0
      • For each (Integer A) from 1 to DelayA_Count, do (Actions)
        • Schleifen - Aktionen
          • Set DelayA_Index = DelayA_Link_Next[DelayA_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DelayA_Sources[DelayA_Index] Equal (Attacking unit)
              • DelayA_Targets[DelayA_Index] Equal (Attacked unit)
              • DelayA_Trigger[DelayA_Index] Equal Stormhammer dmg <gen>
            • Then - Actions
              • Set DelayA_Remainig_Dur[DelayA_Index] = 3.00
              • Set DelayA_Data2[DelayA_Index] = (DelayA_Data2[DelayA_Index] + 50.00)
              • Skip remaining actions
            • Else - Actions
      • -------- Delay in Seconds --------
      • Set DelayA___P_Delay = 3.00
      • -------- Units --------
      • Set DelayA___P_Source = (Attacking unit)
      • Set DelayA___P_Target = (Attacked unit)
      • -------- Effect beeing Called --------
      • Set DelayA___P_Trigger = Stormhammer dmg <gen>
      • -------- Grafical Indikator --------
      • Spezialeffekt - Create a special effect attached to the chest of DelayA___P_Target using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
      • Set DelayA___P_Grafic = (Last created special effect)
      • -------- Create/Start DE --------
      • Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,783
I have this Poison trigger that activates when I unit dies, the intended effect is to make it last 4 seconds longer to all units afflicted with the Poison, however the damage immediately stops when the unit dies and the graphic remains.

Am I doing something wrong?



  • DOT unit Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • LF_Boolean[(Custom value of (Dying unit))] Equal to True
    • Actions
      • -------- Heal and show healing Grafic --------
      • Set TempPoint = (Position of (Dying unit))
      • Set TempGroup = (Units within 450.00 of TempPoint)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is dead) Equal to False
              • ((Picked unit) belongs to an enemy of (Owner of LF_Caster[(Custom value of (Dying unit))])) Equal to True
              • LF_Boolean[(Custom value of (Picked unit))] Equal to True
            • Then - Actions
              • Set DelayA_Index = 0
              • For each (Integer A) from 1 to DelayA_Count, do (Actions)
                • Loop - Actions
                  • Set DelayA_Index = DelayA_Link_Next[DelayA_Index]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DelayA_Targets[DelayA_Index] Equal to (Picked unit)
                      • DelayA_Sources[DelayA_Index] Equal to LF_Caster[(Custom value of (Dying unit))]
                      • DelayA_Trigger[DelayA_Index] Equal to DOT damage <gen>
                    • Then - Actions
                      • Set DelayA_ReLoads[DelayA_Index] = (DelayA_ReLoads[DelayA_Index] + 4)
                    • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Depending on how many delayed Actions are inside your map, it might be better to only once loop the Delayed Action, one could still do the same behaviour without saving data for units by using an group variable and ask if the current tested target of delayed Action is inside the group.

  • Stormhammer Boost
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set loc = (Position of (Triggering unit))
      • Set Group = (Units within 512.00 of loc)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) is A structure) Equal to True
                  • ((Picked unit) is dead) Equal to True
                  • ((Picked unit) belongs to an ally of Player 1 (Red)) Equal to True
            • Then - Actions
              • -------- Remove Unwanted Unit, which is Building, dead or ally of Player Red --------
              • Unit Group - Remove (Picked unit) from Group
            • Else - Actions
      • -------- Use an independent variable and Loop the Delayed Action Loop, Don't use DelayA_Index to prevent errors --------
      • Set Index = 0
      • For each (Integer A) from 1 to DelayA_Count, do (Actions)
        • Loop - Actions
          • Set Index = DelayA_Link_Next[Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DelayA_Trigger[Index] Equal to stormhammer <gen>
              • (DelayA_Targets[Index] is in Group) Equal to True
            • Then - Actions
              • Set DelayA_ReLoads[Index] = (DelayA_ReLoads[Index] + 1)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)
      • Custom script: call RemoveLocation(udg_loc)
 
Top