Charge 1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Charges you to a desired location.

UPDATED TRIGGERS!!!!



  • Charge VARIABLES
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Charge_Damage[1] = 100.00
      • Set Charge_Damage[2] = 150.00
      • Set Charge_Damage[3] = 200.00
      • Set Charge_Damage[4] = 300.00
      • Set Charge_Damage[5] = 350.00
      • Set Charge_DistanceMoved = 30.00
      • Set Charge_Distance_Status_Change[1] = 0.00
      • Set Charge_Distance_Status_Change[2] = 300.00
      • Set Charge_Distance_Status_Change[3] = 600.00
      • Set Charge_AoE_Damage = 350.00
      • Set Charge_AttachmentPoint = origin
      • Set Charge_SpecialEffect1 = Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
      • Set Charge_SpecialEffect2 = ShadowWave.mdx
      • Trigger - Add to Charge LOOP <gen> the event (Time - Every 0.05 seconds of game time)


  • Charge CAST
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Charge_MUI Equal to False
        • Then - Actions
          • Trigger - Turn on Charge LOOP <gen>
        • Else - Actions
      • Set Charge_MUI = True
      • Set Charge_MUI_2 = (Charge_MUI_2 + 1)
      • Set Charge_Unit[Charge_MUI_2] = (Casting unit)
      • Set Charge_Level[Charge_MUI_2] = (Level of Charge for Charge_Unit[Charge_MUI_2])
      • Set Charge_CastingPoint[Charge_MUI_2] = (Target point of ability being cast)
      • Set Charge_Unit_Point[Charge_MUI_2] = (Position of Charge_Unit[Charge_MUI_2])
      • Set Charge_Angle[Charge_MUI_2] = (Angle from Charge_Unit_Point[Charge_MUI_2] to Charge_CastingPoint[Charge_MUI_2])
      • Set Charge_Distance[Charge_MUI_2] = (Distance between Charge_Unit_Point[Charge_MUI_2] and Charge_CastingPoint[Charge_MUI_2])
      • Set Charge_Status[Charge_MUI_2] = -1
      • Set Charge_DistanceTraveled[Charge_MUI_2] = 0.00
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_Distance[Charge_MUI_2] Greater than or equal to Charge_Distance_Status_Change[(Integer A)]
            • Then - Actions
              • Set Charge_Status[Charge_MUI_2] = (Charge_Status[Charge_MUI_2] + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Charge_Status[Charge_MUI_2] Equal to 0
        • Then - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_Status[Charge_MUI_2] Equal to 1
            • Then - Actions
              • Special Effect - Create a special effect attached to the Charge_AttachmentPoint of Charge_Unit[Charge_MUI_2] using Charge_SpecialEffect1
              • Set Charge_Effect[Charge_MUI_2] = (Last created special effect)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Charge_Status[Charge_MUI_2] Equal to 2
                • Then - Actions
                  • Special Effect - Create a special effect attached to the Charge_AttachmentPoint of Charge_Unit[Charge_MUI_2] using Charge_SpecialEffect2
                  • Set Charge_Effect[Charge_MUI_2] = (Last created special effect)
                • Else - Actions
      • Unit Group - Add Charge_Unit[Charge_MUI_2] to Charge_Group
      • Unit - Pause Charge_Unit[Charge_MUI_2]
      • Unit - Make Charge_Unit[Charge_MUI_2] Invulnerable


  • Charge LOOP
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Charge_MUI_2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_DistanceTraveled[(Integer A)] Less than Charge_Distance[(Integer A)]
            • Then - Actions
              • Unit - Turn collision for Charge_Unit[(Integer A)] Off
              • Set Charge_MovePoint[(Integer A)] = ((Position of Charge_Unit[(Integer A)]) offset by Charge_DistanceMoved towards Charge_Angle[(Integer A)] degrees)
              • Set Charge_DistanceTraveled[(Integer A)] = (Charge_DistanceTraveled[(Integer A)] + 30.00)
              • Unit - Move Charge_Unit[(Integer A)] instantly to Charge_MovePoint[(Integer A)], facing Charge_Angle[(Integer A)] degrees
              • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Charge_Status[(Integer A)] Equal to 0
                • Then - Actions
                  • Set Charge_Unit_Group[(Integer A)] = (Units within Charge_AoE_Damage of Charge_CastingPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Charge_Unit[(Integer A)])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechani
                  • Unit Group - Pick every unit in Charge_Unit_Group[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause Charge_Unit[(Integer A)] to damage (Picked unit), dealing Charge_Damage[Charge_Level[(Integer A)]] damage of attack type Spells and damage type Normal
                  • Unit - Unpause Charge_Unit[(Integer A)]
                  • Unit - Make Charge_Unit[(Integer A)] Vulnerable
                  • Unit Group - Remove Charge_Unit[(Integer A)] from Charge_Group
                  • Unit - Turn collision for Charge_Unit[(Integer A)] On
                  • Custom script: call RemoveLocation (udg_Charge_Unit_Point[GetForLoopIndexA()])
                  • Custom script: call RemoveLocation (udg_Charge_CastingPoint[GetForLoopIndexA()])
                  • Custom script: call DestroyGroup (udg_Charge_Unit_Group[GetForLoopIndexA()])
                  • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Charge_Status[(Integer A)] Equal to 1
                    • Then - Actions
                      • Set Charge_Unit_Group[(Integer A)] = (Units within Charge_AoE_Damage of Charge_CastingPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Charge_Unit[(Integer A)])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechani
                      • Unit Group - Pick every unit in Charge_Unit_Group[(Integer A)] and do (Actions)
                        • Loop - Actions
                          • Unit - Cause Charge_Unit[(Integer A)] to damage (Picked unit), dealing Charge_Damage[Charge_Level[(Integer A)]] damage of attack type Spells and damage type Normal
                      • Unit - Unpause Charge_Unit[(Integer A)]
                      • Unit - Make Charge_Unit[(Integer A)] Vulnerable
                      • Unit Group - Remove Charge_Unit[(Integer A)] from Charge_Group
                      • Special Effect - Destroy Charge_Effect[(Integer A)]
                      • Unit - Turn collision for Charge_Unit[(Integer A)] On
                      • -------- ================= --------
                      • Unit - Create 1 dummy for (Owner of Charge_Unit[(Integer A)]) at Charge_CastingPoint[(Integer A)] facing Default building facing degrees
                      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                      • Unit - Add Slam (CHARGE SLOW) to (Last created unit)
                      • Unit - Set level of Slam (CHARGE SLOW) for (Last created unit) to Charge_Level[(Integer A)]
                      • Unit - Order (Last created unit) to Neutral - Slam
                      • Special Effect - Create a special effect at Charge_CastingPoint[(Integer A)] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • -------- ================= --------
                      • Custom script: call RemoveLocation (udg_Charge_Unit_Point[GetForLoopIndexA()])
                      • Custom script: call RemoveLocation (udg_Charge_CastingPoint[GetForLoopIndexA()])
                      • Custom script: call DestroyGroup (udg_Charge_Unit_Group[GetForLoopIndexA()])
                      • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Charge_Status[(Integer A)] Equal to 2
                        • Then - Actions
                          • Set Charge_Unit_Group[(Integer A)] = (Units within Charge_AoE_Damage of Charge_CastingPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Charge_Unit[(Integer A)])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechani
                          • Unit Group - Pick every unit in Charge_Unit_Group[(Integer A)] and do (Actions)
                            • Loop - Actions
                              • Unit - Cause Charge_Unit[(Integer A)] to damage (Picked unit), dealing Charge_Damage[Charge_Level[(Integer A)]] damage of attack type Spells and damage type Normal
                          • Unit - Unpause Charge_Unit[(Integer A)]
                          • Unit - Make Charge_Unit[(Integer A)] Vulnerable
                          • Unit Group - Remove Charge_Unit[(Integer A)] from Charge_Group
                          • Special Effect - Destroy Charge_Effect[(Integer A)]
                          • Unit - Turn collision for Charge_Unit[(Integer A)] On
                          • -------- ================= --------
                          • Unit - Create 1 dummy for (Owner of Charge_Unit[(Integer A)]) at Charge_CastingPoint[(Integer A)] facing Default building facing degrees
                          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                          • Unit - Add Slam (CHARGE SLOW) to (Last created unit)
                          • Unit - Set level of Slam (CHARGE SLOW) for (Last created unit) to Charge_Level[(Integer A)]
                          • Unit - Order (Last created unit) to Neutral - Slam
                          • Special Effect - Create a special effect at Charge_CastingPoint[(Integer A)] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • -------- ================= --------
                          • Unit - Create 1 dummy for (Owner of Charge_Unit[(Integer A)]) at Charge_CastingPoint[(Integer A)] facing Default building facing degrees
                          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                          • Unit - Add Charge (STUN) to (Last created unit)
                          • Unit - Set level of Charge (STUN) for (Last created unit) to Charge_Level[(Integer A)]
                          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                          • Special Effect - Create a special effect at Charge_CastingPoint[(Integer A)] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Charge_Unit_Point[GetForLoopIndexA()])
                          • Custom script: call RemoveLocation (udg_Charge_CastingPoint[GetForLoopIndexA()])
                          • Custom script: call DestroyGroup (udg_Charge_Unit_Group[GetForLoopIndexA()])
                          • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
                        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Charge_Group) Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Set Charge_MUI = False
              • Set Charge_MUI_2 = 0
            • Else - Actions


Keywords:
Charge
Contents

Charge 1.0 BETA (Map)

Reviews
15:57, 20th Sep 2014 TriggerHappy: Rejected on request.

Moderator

M

Moderator

15:57, 20th Sep 2014
TriggerHappy:

Rejected on request.
 
Level 8
Joined
Nov 9, 2011
Messages
322
Triggers


  • Charge VARIABLES
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Charge_Damage[1] = 100.00
      • Set Charge_Damage[2] = 150.00
      • Set Charge_Damage[3] = 200.00
      • Set Charge_Damage[4] = 300.00
      • Set Charge_Damage[5] = 350.00
      • Set Charge_DistanceMoved = 30.00
      • Set Charge_Distance_Status_Change[1] = 0.00
      • Set Charge_Distance_Status_Change[2] = 300.00
      • Set Charge_Distance_Status_Change[3] = 600.00
      • Set Charge_AoE_Damage = 350.00
      • Trigger - Add to Charge LOOP <gen> the event (Time - Every 0.05 seconds of game time)


  • Charge CAST
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Charge_MUI Equal to False
        • Then - Actions
          • Trigger - Turn on Charge LOOP <gen>
        • Else - Actions
      • Set Charge_MUI = True
      • Set Charge_MUI_2 = (Charge_MUI_2 + 1)
      • Set Charge_Unit[Charge_MUI_2] = (Casting unit)
      • Set Charge_Level[Charge_MUI_2] = (Level of Charge for Charge_Unit[Charge_MUI_2])
      • Set Charge_CastingPoint[Charge_MUI_2] = (Target point of ability being cast)
      • Set Charge_Unit_Point[Charge_MUI_2] = (Position of Charge_Unit[Charge_MUI_2])
      • Set Charge_Angle[Charge_MUI_2] = (Angle from Charge_Unit_Point[Charge_MUI_2] to Charge_CastingPoint[Charge_MUI_2])
      • Set Charge_Distance[Charge_MUI_2] = (Distance between Charge_Unit_Point[Charge_MUI_2] and Charge_CastingPoint[Charge_MUI_2])
      • Set Charge_Status[Charge_MUI_2] = -1
      • Set Charge_DistanceTraveled[Charge_MUI_2] = 0.00
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_Distance[Charge_MUI_2] Greater than or equal to Charge_Distance_Status_Change[(Integer A)]
            • Then - Actions
              • Set Charge_Status[Charge_MUI_2] = (Charge_Status[Charge_MUI_2] + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Charge_Status[Charge_MUI_2] Equal to 0
        • Then - Actions
          • Do nothing
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_Status[Charge_MUI_2] Equal to 1
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of Charge_Unit[Charge_MUI_2] using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
              • Set Charge_Effect[Charge_MUI_2] = (Last created special effect)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Charge_Status[Charge_MUI_2] Equal to 2
                • Then - Actions
                  • Special Effect - Create a special effect attached to the origin of Charge_Unit[Charge_MUI_2] using ShadowWave.mdx
                  • Set Charge_Effect[Charge_MUI_2] = (Last created special effect)
                • Else - Actions
      • Unit Group - Add Charge_Unit[Charge_MUI_2] to Charge_Group
      • Unit - Pause Charge_Unit[Charge_MUI_2]
      • Unit - Make Charge_Unit[Charge_MUI_2] Invulnerable


  • Charge LOOP
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Charge_MUI_2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_DistanceTraveled[(Integer A)] Less than Charge_Distance[(Integer A)]
            • Then - Actions
              • Unit - Turn collision for Charge_Unit[(Integer A)] Off
              • Set Charge_MovePoint[(Integer A)] = ((Position of Charge_Unit[(Integer A)]) offset by Charge_DistanceMoved towards Charge_Angle[(Integer A)] degrees)
              • Set Charge_DistanceTraveled[(Integer A)] = (Charge_DistanceTraveled[(Integer A)] + 30.00)
              • Unit - Move Charge_Unit[(Integer A)] instantly to Charge_MovePoint[(Integer A)], facing Charge_Angle[(Integer A)] degrees
              • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Charge_Status[(Integer A)] Equal to 0
                • Then - Actions
                  • Set Charge_Unit_Group[(Integer A)] = (Units within Charge_AoE_Damage of Charge_CastingPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Charge_Unit[(Integer A)])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechani
                  • Unit Group - Pick every unit in Charge_Unit_Group[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause Charge_Unit[(Integer A)] to damage (Picked unit), dealing Charge_Damage[Charge_Level[(Integer A)]] damage of attack type Spells and damage type Normal
                  • Unit - Unpause Charge_Unit[(Integer A)]
                  • Unit - Make Charge_Unit[(Integer A)] Vulnerable
                  • Unit Group - Remove Charge_Unit[(Integer A)] from Charge_Group
                  • Unit - Turn collision for Charge_Unit[(Integer A)] On
                  • Custom script: call RemoveLocation (udg_Charge_Unit_Point[GetForLoopIndexA()])
                  • Custom script: call RemoveLocation (udg_Charge_CastingPoint[GetForLoopIndexA()])
                  • Custom script: call DestroyGroup (udg_Charge_Unit_Group[GetForLoopIndexA()])
                  • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Charge_Status[(Integer A)] Equal to 1
                    • Then - Actions
                      • Set Charge_Unit_Group[(Integer A)] = (Units within Charge_AoE_Damage of Charge_CastingPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Charge_Unit[(Integer A)])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechani
                      • Unit Group - Pick every unit in Charge_Unit_Group[(Integer A)] and do (Actions)
                        • Loop - Actions
                          • Unit - Cause Charge_Unit[(Integer A)] to damage (Picked unit), dealing Charge_Damage[Charge_Level[(Integer A)]] damage of attack type Spells and damage type Normal
                      • Unit - Unpause Charge_Unit[(Integer A)]
                      • Unit - Make Charge_Unit[(Integer A)] Vulnerable
                      • Unit Group - Remove Charge_Unit[(Integer A)] from Charge_Group
                      • Special Effect - Destroy Charge_Effect[(Integer A)]
                      • Unit - Turn collision for Charge_Unit[(Integer A)] On
                      • -------- ================= --------
                      • Unit - Create 1 dummy for (Owner of Charge_Unit[(Integer A)]) at Charge_CastingPoint[(Integer A)] facing Default building facing degrees
                      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                      • Unit - Add Slam (CHARGE SLOW) to (Last created unit)
                      • Unit - Set level of Slam (CHARGE SLOW) for (Last created unit) to Charge_Level[(Integer A)]
                      • Unit - Order (Last created unit) to Neutral - Slam
                      • Special Effect - Create a special effect at Charge_CastingPoint[(Integer A)] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • -------- ================= --------
                      • Custom script: call RemoveLocation (udg_Charge_Unit_Point[GetForLoopIndexA()])
                      • Custom script: call RemoveLocation (udg_Charge_CastingPoint[GetForLoopIndexA()])
                      • Custom script: call DestroyGroup (udg_Charge_Unit_Group[GetForLoopIndexA()])
                      • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Charge_Status[(Integer A)] Equal to 2
                        • Then - Actions
                          • Set Charge_Unit_Group[(Integer A)] = (Units within Charge_AoE_Damage of Charge_CastingPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Charge_Unit[(Integer A)])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechani
                          • Unit Group - Pick every unit in Charge_Unit_Group[(Integer A)] and do (Actions)
                            • Loop - Actions
                              • Unit - Cause Charge_Unit[(Integer A)] to damage (Picked unit), dealing Charge_Damage[Charge_Level[(Integer A)]] damage of attack type Spells and damage type Normal
                          • Unit - Unpause Charge_Unit[(Integer A)]
                          • Unit - Make Charge_Unit[(Integer A)] Vulnerable
                          • Unit Group - Remove Charge_Unit[(Integer A)] from Charge_Group
                          • Special Effect - Destroy Charge_Effect[(Integer A)]
                          • Unit - Turn collision for Charge_Unit[(Integer A)] On
                          • -------- ================= --------
                          • Unit - Create 1 dummy for (Owner of Charge_Unit[(Integer A)]) at Charge_CastingPoint[(Integer A)] facing Default building facing degrees
                          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                          • Unit - Add Slam (CHARGE SLOW) to (Last created unit)
                          • Unit - Set level of Slam (CHARGE SLOW) for (Last created unit) to Charge_Level[(Integer A)]
                          • Unit - Order (Last created unit) to Neutral - Slam
                          • Special Effect - Create a special effect at Charge_CastingPoint[(Integer A)] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • -------- ================= --------
                          • Unit - Create 1 dummy for (Owner of Charge_Unit[(Integer A)]) at Charge_CastingPoint[(Integer A)] facing Default building facing degrees
                          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                          • Unit - Add Charge (STUN) to (Last created unit)
                          • Unit - Set level of Charge (STUN) for (Last created unit) to Charge_Level[(Integer A)]
                          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                          • Special Effect - Create a special effect at Charge_CastingPoint[(Integer A)] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Charge_Unit_Point[GetForLoopIndexA()])
                          • Custom script: call RemoveLocation (udg_Charge_CastingPoint[GetForLoopIndexA()])
                          • Custom script: call DestroyGroup (udg_Charge_Unit_Group[GetForLoopIndexA()])
                          • Custom script: call RemoveLocation (udg_Charge_MovePoint[GetForLoopIndexA()])
                        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Charge_Group) Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Set Charge_MUI = False
              • Set Charge_MUI_2 = 0
            • Else - Actions
 
Last edited:

Chaosy

Tutorial Reviewer
Level 39
Joined
Jun 9, 2011
Messages
13,083
1. all variable names should be a X_variable name. Where X is the spell name. Mega Super Spell variables should have MSS_damage and MSS_MUI and so on.

2. you use a lot of "last created unit" you should consider using a variable for that.

3. remove the "do nothing" action just leave it blanc, it will have exactly the same effect.

4. use the following code to use hidden tags.

[hidden=some text][trigger]some awesome triggers here[/trigger][/hidden]

  • some awesome triggers here
 
Level 13
Joined
Jul 16, 2012
Messages
680
I recommend you use 0.03 or 0.03125 or 0.0312500 sec in your Loop instead using 0.05

Special Effect - Create a special effect attached to the origin of Charge_Unit[Charge_MUI_2] using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
Special Effect - Create a special effect attached to the origin of Charge_Unit[Charge_MUI_2] using ShadowWave.mdx
Those red part, you must put it in Variables

In your Trigger Loop
You must use Integer Variable instead using Integer A
 
Level 8
Joined
Nov 9, 2011
Messages
322
I recommend you use 0.03 or 0.03125 or 0.0312500 sec in your Loop instead using 0.05

Special Effect - Create a special effect attached to the origin of Charge_Unit[Charge_MUI_2] using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
Special Effect - Create a special effect attached to the origin of Charge_Unit[Charge_MUI_2] using ShadowWave.mdx
Those red part, you must put it in Variables

In your Trigger Loop
You must use Integer Variable instead using Integer A

What do you mean i need variables i putted when i created special effects and destroyed when the spell is finished. And also for Loop What do you mean im kinda new to this.
 
Level 19
Joined
Mar 18, 2012
Messages
1,717
Dummy units don't need the invulnerable ability since they already have locust.

You should outline every configurable variable with a small comment. Explain in one sentence what each variable does.

The ability should be stored into a variable of type "ability". This variable will be used a) in your cast condition --> ability beeing cast equals ... and b) level of ... for charge_unit

In order to activate the loop trigger you should do an integer comparison and not the boolean check you are doing at the moment (Charge_MUI). You'll find a very nice explanation within my signature under "DynamicIndexing".

Please do not loop through IntegerA/B, but use an integer variable instead for instance Charge_LoopIndex.

Pausing an unit should be avoided, because the PauseUnit function doesn't work so well with other game mechanics like buffs.

Locations, groups, variables in general which do not persist over one loop shouldn't be arrays.

Anything used more than once/twice should be stored into a variable, lastCreatedUnit for example is what I'm talking about. You can us a normal unit variable "tempUnit" to remove extra computation time.

  • Special Effect - Create a special effect at Charge_CastingPoint[(Integer A)] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Public resources shoudn't be hardcoded, instead move the effect string used into the configuration trigger.

The charging would look much better, if the unit uses its walk/run animation.
The final aoe damage could also be highlighted by the slam animation.
The latter is rather difficult, I once wrote a charge system for a map it covered extra features like movespeed acceleration, etc...
What I want to say is: It's not a big deal if you leave out the slam animation part

Enough for now.
 
Level 8
Joined
Nov 9, 2011
Messages
322
Good tutorial for dynamic indexing: http://www.hiveworkshop.com/forums/...orials-279/visualize-dynamic-indexing-241896/

Working with groups is much slower, especially in GUI. It's not that it's a bad function for you, just use it if you want.

But for more complex stuff it's getting more important to care about speed sometimes, that's why some recommend to use it over groups.

My guess here is like when unit casts spell i set some integer + 1 and when in loop finishes ''integer - 1'' and at the end i check if the integer is 0 ? And thanks for the link
 
Well yeah. :D You work with variables[array] if you want to index something.

For example if you want to index caster you will have to create a unit variable with array. And you use an integer to index all units. (whats comes in, in these "[]" brackets is the integer as index).

Will look like:
  • Unit - do some actions with Caster[index]

And if start/finish the spell you have to change the maxIndex each time of course, but that's all explained in the tutorial very well.
 
Level 8
Joined
Nov 9, 2011
Messages
322
Well yeah. :D You work with variables[array] if you want to index something.

For example if you want to index caster you will have to create a unit variable with array. And you use an integer to index all units. (whats comes in, in these "[]" brackets is the integer as index).

Will look like:
  • Unit - do some actions with Caster[index]

And if start/finish the spell you have to change the maxIndex each time of course, but that's all explained in the tutorial very well.

One question my index is ''Charge_MUI_2'' its for the brackets [] if u see in triggers now tell me why would i reduce it everytime some1 finishes spell when i can do that when there are no more ppl ''charging'' as u saw in the end of trigger 3.
 
For recycling. With this dynamic indexing method you can handle 8192 instances at once and any time. If you don't recycle properly you can't, because you may have not needed gaps and unuseable instances.

Imagine your index won't reach 0, because of a new cast each few seconds. Then even with your check, it will overflow after a while and might cause bugs.

But again, the tutorial explains it well. Look at deindex part. If you have more questions for better understanding you can open a seperate thread for it or VM/PM me.
 
One question my index is ''Charge_MUI_2'' its for the brackets [] if u see in triggers now tell me why would i reduce it everytime some1 finishes spell when i can do that when there are no more ppl ''charging'' as u saw in the end of trigger 3.

It switches places with the last index; all the unneeded data is thrown away from the loop(not from the game itself) once you reduce it.
 
Level 8
Joined
Nov 9, 2011
Messages
322
Level 22
Joined
Sep 24, 2005
Messages
4,820
It will work as long as you don't exceed the array size limit.

I'll try explaining how it works:

Your spell instantiates 6 instances: [1,2,3,4,5,6]
Instance 3 expires: [1,2,3(6),4,5] (6 gets swapped with 3, since 3 is no longer needed)
Your spell instantiates 2 more: [1,2,3(6),4,5,6,7]
Instance 4 expires: [1,2,3(6),4(7),5,6] (7 gets swapped with 4)
Instance 4(7) expires: [1,2,3(6*),4(6),5] (6 gets swapped with 4)

Note: The green 6 is the first swapped data.
 
Level 8
Joined
Nov 9, 2011
Messages
322
It will work as long as you don't exceed the array size limit.

I'll try explaining how it works:

Your spell instantiates 6 instances: [1,2,3,4,5,6]
Instance 3 expires: [1,2,3(6),4,5] (6 gets swapped with 3, since 3 is no longer needed)
Your spell instantiates 2 more: [1,2,3(6),4,5,6,7]
Instance 4 expires: [1,2,3(6),4(7),5,6] (7 gets swapped with 4)
Instance 4(7) expires: [1,2,3(6*),4(6),5] (6 gets swapped with 4)

Note: The green 6 is the first swapped data.

okay thanks and what is the array limit?
 
Level 22
Joined
Sep 24, 2005
Messages
4,820
8191 elements with 0 included; 8190 excluding 0

EDIT: Because the last index([8191]) is bugged.
 
Last edited:
Top