• 🏆 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!

[Trigger] Insane system: If your hero's mana is lower than 20 percent->spawn wave of creeps

Status
Not open for further replies.
Level 3
Joined
Mar 15, 2015
Messages
53
Goal
I'm making a MUI system that, when your hero's mana is below 20%, a wave of creeps spawn and they will keep getting harder until the hero has higher mana amount than 20%.
Things I've done
I made a tavern system that assign picked hero as Worker[Player Number].
I ran this trigger at Map Initialization to set creep types and amount of them for each level.
  • Shadow Wave Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ShadowUnits[1] = Shadow Creeper
      • Set ShadowUnits[2] = Shadow Creeper
      • Set ShadowUnits[3] = Shadow Walker
      • Set ShadowUnits[4] = Shadow Walker
      • Set ShadowUnits[5] = Shadow Walker
      • Set ShadowUnits[6] = Shadow Charger
      • Set ShadowUnits[7] = Shadow Charger
      • Set AmountOfShadows[1] = 1
      • Set AmountOfShadows[2] = 2
      • Set AmountOfShadows[3] = 1
      • Set AmountOfShadows[4] = 2
      • Set AmountOfShadows[5] = 3
      • Set AmountOfShadows[6] = 1
      • Set AmountOfShadows[7] = 2
  • Lower20
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of Worker[(Integer A)]) Less than or equal to 20.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShadowSpawn[(Integer A)] Equal to 0.00
                • Then - Actions
                  • Set ShadowSpawn[(Integer A)] = 1.00
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ShadowEffect[(Integer A)] Equal to 0.00
                    • Then - Actions
                      • Set ShadowEffect[(Integer A)] = 1.00
                      • Special Effect - Create a special effect attached to the overhead of Worker[(Integer A)] using Abilities\Spells\NightElf\shadowstrike\shadowstrike.mdl
                      • Set SanityEffect[(Integer A)] = (Last created special effect)
                      • Trigger - Run Shadow Wave Trigger <gen> (checking conditions)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
              • Special Effect - Destroy SanityEffect[(Integer A)]
              • Set ShadowSpawn[(Integer A)] = 0.00
              • Set ShadowEffect[(Integer A)] = 0.00
  • Shadow Wave Trigger
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ShadowSpawn[(Integer A)] Equal to 1.00
            • Then - Actions
              • Set ShadowSpawn[(Integer A)] = 2.00
              • Set ShadowLevels[(Integer A)] = 1
              • Set ShadowWaveDice[(Integer A)] = (Random real number between 15.00 and 30.00)
              • Countdown Timer - Start ShadowWaveTimer[(Integer A)] as a One-shot timer that will expire in ShadowWaveDice[(Integer A)] seconds
            • Else - Actions
I can't find a way to loop the Countdown Timer event so i code every trigger manually for each player (1->6).
(Also my creeps keep getting spawned in the wall or tree so I have to turn off their collision, is there any better way than this? Because collision off means they will stack on each other if spawned in a wave and thats not very appealing).
  • Shadow Wave Spawn 1
    • Events
      • Time - ShadowWaveTimer[1] expires
    • Conditions
      • (Percentage mana of Worker[1]) Less than or equal to 20.00
    • Actions
      • Set ShadowWorkerPoint[1] = (Position of Worker[1])
      • For each (Integer A) from 1 to AmountOfShadows[ShadowLevels[1]], do (Actions)
        • Loop - Actions
          • Unit - Create 1 ShadowUnits[ShadowLevels[1]] for Neutral Hostile at (ShadowWorkerPoint[1] offset by ((Random real number between 600.00 and 1000.00), (Random angle))) facing Default building facing degrees
          • Unit - Turn collision for (Last created unit) Off
          • Set ShadowSumLoc = (Position of (Last created unit))
          • Special Effect - Create a special effect at ShadowSumLoc using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
          • Special Effect - Destroy (Last created special effect)
          • AI - Ignore (Last created unit)'s guard position
          • Unit - Order (Last created unit) to Attack-Move To ShadowWorkerPoint[1]
          • Unit Group - Add (Last created unit) to ShadowTempGroup[1]
      • Custom script: call RemoveLocation (udg_ShadowSumLoc)
      • Custom script: call RemoveLocation (udg_ShadowWorkerPoint[1])
Then reset the process.
  • Shadow Wave Reset 1
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in ShadowTempGroup[1]) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
    • Actions
      • Unit Group - Remove (Dying unit) from ShadowTempGroup[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ShadowTempGroup[1]) Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of Worker[1]) Less than or equal to 20.00
            • Then - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShadowLevels[1] Less than 7
                • Then - Actions
                  • Set ShadowLevels[1] = (ShadowLevels[1] + 1)
                  • Set ShadowWaveDice[1] = (Random real number between 15.00 and 30.00)
                  • Countdown Timer - Start ShadowWaveTimer[1] as a One-shot timer that will expire in ShadowWaveDice[1] seconds
                • Else - Actions
                  • Set ShadowWaveDice[1] = (Random real number between 15.00 and 30.00)
                  • Countdown Timer - Start ShadowWaveTimer[1] as a One-shot timer that will expire in ShadowWaveDice[1] seconds
        • Else - Actions
But nothing worked at all :D There is only one creep spawn and nothing comes after. The special effect is glitchy as hell after the hero gains over 20% mana.
The only one who got insane is me now pls help...
Thanks so much for helping.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
1: You need to initialize Timers/Unit Group arrays. Set their Sizes to 6 in the Variable Editor.
2: Don't use Integer A in your For Loops. Use a unique Integer variable.
3: If you have nested For Loops, which means a Loop inside of another Loop, you need to give each of them a unique Integer variable:
  • For each ShadowLoopA from 1 to X, do (Actions)
    • Loop - Actions
      • For each ShadowLoopB from 1 to X, do (Actions)
Otherwise, they will conflict with one another.

4: In your reset trigger you have an unnecessary condition:
  • Or - Any (Conditions) are true

5: In your reset trigger you use this condition in an If Then Else statement:
  • (Percentage mana of Worker[1]) Less than or equal to 20.00
But you put the Actions for it in the "Else - Actions" instead of the "Then - Actions". This means that you are doing the OPPOSITE of what you want.

There may be other issues with the logic but let me know if those changes fix it.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
Here's my take on your system, I think I achieved what you wanted. When a Hero drops below <= 20% mana the first wave spawns (after the timer expires). Once the wave is defeated the player's wave counter increases by 1 and the next wave spawns. This cycle continues as long as the Hero is <= 20% mana. If a Hero goes above 20% mana then their wave timer is paused and the wave counter resets back to 1.
  • Shadow Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet Shadow_Type[1] = Grunt
      • Set VariableSet Shadow_Type[2] = Raider
      • Set VariableSet Shadow_Type[3] = Headhunter
      • Set VariableSet Shadow_Type[4] = Shaman
      • Set VariableSet Shadow_Type[5] = Spirit Walker
      • Set VariableSet Shadow_Type[6] = Kodo Beast
      • Set VariableSet Shadow_Type[7] = Tauren
      • Set VariableSet Shadow_Count[1] = 2
      • Set VariableSet Shadow_Count[2] = 2
      • Set VariableSet Shadow_Count[3] = 2
      • Set VariableSet Shadow_Count[4] = 2
      • Set VariableSet Shadow_Count[5] = 2
      • Set VariableSet Shadow_Count[6] = 2
      • Set VariableSet Shadow_Count[7] = 2
      • -------- --------
      • -------- This Hashtable will save the Player's Number to the Shadow Spawns so we can easily find who a dying Shadow "belonged" to: --------
      • Hashtable - Create a hashtable
      • Set VariableSet Shadow_Hashtable = (Last created hashtable)
      • -------- --------
      • -------- Set the Workers and Add the Players to the Worker Group: --------
      • Set VariableSet Shadow_Worker[1] = Paladin 0001 <gen>
      • Player Group - Add Player 1 (Red) to Shadow_Players
  • Shadow Mana Check
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in Shadow_Players and do (Actions)
        • Loop - Actions
          • Set VariableSet Shadow_PN = (Player number of (Picked player))
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of Shadow_Worker[Shadow_PN]) Less than or equal to 20.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Shadow_IsOn[Shadow_PN] Equal to False
                • Then - Actions
                  • Countdown Timer - Start Shadow_Timer[Shadow_PN] as a One-shot timer that will expire in (Random real number between 3.00 and 5.00) seconds
                  • Set VariableSet Shadow_CurrentWave[Shadow_PN] = 1
                  • Special Effect - Create a special effect attached to the overhead of Shadow_Worker[Shadow_PN] using Abilities\Spells\NightElf\shadowstrike\shadowstrike.mdl
                  • Set VariableSet Shadow_Art[Shadow_PN] = (Last created special effect)
                  • Set VariableSet Shadow_IsOn[Shadow_PN] = True
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Shadow_IsOn[Shadow_PN] Equal to True
                • Then - Actions
                  • Countdown Timer - Pause Shadow_Timer[Shadow_PN]
                  • Special Effect - Destroy Shadow_Art[Shadow_PN]
                  • Set VariableSet Shadow_IsOn[Shadow_PN] = False
                • Else - Actions
  • Shadow Timers
    • Events
      • Time - Shadow_Timer[1] expires
      • Time - Shadow_Timer[2] expires
      • Time - Shadow_Timer[3] expires
      • Time - Shadow_Timer[4] expires
      • Time - Shadow_Timer[5] expires
      • Time - Shadow_Timer[6] expires
    • Conditions
    • Actions
      • -------- This is a Loop in Jass form which will set Shadow_PN for us by checking which timer expired: --------
      • Custom script: local integer pn = 0
      • Custom script: loop
      • Custom script: exitwhen pn == -1
      • Custom script: set pn = pn + 1
      • Custom script: if (GetExpiredTimer() == udg_Shadow_Timer[pn]) then
      • Custom script: set udg_Shadow_PN = pn
      • Custom script: set pn = -1
      • Custom script: endif
      • Custom script: endloop
      • -------- --------
      • -------- Now that we have Shadow_PN set to the proper player number we can proceed normally: --------
      • Set VariableSet Shadow_Points[0] = (Position of Shadow_Worker[Shadow_PN])
      • For each (Integer Shadow_Loop) from 1 to Shadow_Count[Shadow_CurrentWave[Shadow_PN]], do (Actions)
        • Loop - Actions
          • Set VariableSet Shadow_Points[1] = (Shadow_Points[0] offset by 256.00 towards (Random angle) degrees.)
          • Unit - Create 1 Shadow_Type[Shadow_CurrentWave[Shadow_PN]] for Neutral Hostile at Shadow_Points[1] facing Default building facing degrees
          • Hashtable - Save Shadow_PN as 0 of (Key (Last created unit).) in Shadow_Hashtable.
          • Set VariableSet Shadow_UnitsLeft[Shadow_PN] = (Shadow_UnitsLeft[Shadow_PN] + 1)
          • /// You would do your collision stuff / attacking stuff here
          • Custom script: call RemoveLocation (udg_Shadow_Points[1])
      • Custom script: call RemoveLocation (udg_Shadow_Points[0])
  • Shadow Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Load 0 of (Key (Triggering unit).) from Shadow_Hashtable.) Greater than 0
    • Actions
      • Set VariableSet Shadow_PN = (Load 0 of (Key (Triggering unit).) from Shadow_Hashtable.)
      • Set VariableSet Shadow_UnitsLeft[Shadow_PN] = (Shadow_UnitsLeft[Shadow_PN] - 1)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit).) in Shadow_Hashtable.
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Shadow_UnitsLeft[Shadow_PN] Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of Shadow_Worker[Shadow_PN]) Less than or equal to 20.00
            • Then - Actions
              • -------- Start a new wave: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Shadow_CurrentWave[Shadow_PN] Less than 7
                • Then - Actions
                  • Set VariableSet Shadow_CurrentWave[Shadow_PN] = (Shadow_CurrentWave[Shadow_PN] + 1)
                • Else - Actions
              • Countdown Timer - Start Shadow_Timer[Shadow_PN] as a One-shot timer that will expire in (Random real number between 3.00 and 5.00) seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Shadow_IsOn[Shadow_PN] Equal to True
                • Then - Actions
                  • Countdown Timer - Pause Shadow_Timer[Shadow_PN]
                  • Special Effect - Destroy Shadow_Art[Shadow_PN]
                  • Set VariableSet Shadow_IsOn[Shadow_PN] = False
                • Else - Actions
        • Else - Actions

Also, for the Collision stuff you could Wait 2.00 seconds or so after the unit enters the map and then turn it's collision back on. This may help it get unstuck once in a while without needing to keep the collision permanently off. An example:
  • Unit - Create 1 Shadow_Type[Shadow_CurrentWave[Shadow_PN]] for Neutral Hostile at Shadow_Points[1] facing Default building facing degrees
  • Trigger - Run Fix Collision <gen> (ignoring conditions)
  • Fix Collision
    • Events
    • Conditions
    • Actions
      • Custom script: local unit u = GetLastCreatedUnit()
      • Custom script: call SetUnitPathing(u, false)
      • Wait 2.00 seconds
      • Custom script: call SetUnitPathing(u, true)
      • Custom script: set u = null

Some random concerns I have about this system:
What happens when a hero dies? Their mana is still being checked despite them being dead.
What happens if you don't kill the neutral hostile units? Should they expire?

Attached map requires the latest patch.
 

Attachments

  • Shadow Mana Example 1.w3m
    21.7 KB · Views: 13
Last edited:
Level 3
Joined
Mar 15, 2015
Messages
53
Thanks for the respond! I've implied your triggers but for some reason it only works for player 1. Sadly I'm using 1.31 patch so I can't check your example. I only changed variables name so... Please have a look.
Here's the Tavern system, modified a lil bit from this tutorial: Hero Selection Systems (to assign Player Group and Workers var).
  • Worker Spawn
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Selling unit) Equal to World Stone 0022 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
          • Game - Display to (All players) the text: You already have a ...
        • Else - Actions
          • Unit - Remove Wisp[(Player number of (Owner of (Sold unit)))] from the game
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Set HeroSpawnPoint = (Random point in HeroSpawn <gen>)
          • Set Workers[(Player number of (Owner of (Sold unit)))] = (Sold unit)
          • Player Group - Add (Owner of (Sold unit)) to PlayingPlayerGroup
          • Unit - Move Workers[(Player number of (Owner of (Sold unit)))] instantly to HeroSpawnPoint
          • Selection - Clear selection for (Owner of (Sold unit))
          • Selection - Add (Sold unit) to selection for (Owner of (Sold unit))
          • Custom script: call RemoveLocation(udg_HeroSpawnPoint)
  • Shadow Wave Spawn
    • Events
      • Time - ShadowWaveTimer[1] expires
      • Time - ShadowWaveTimer[2] expires
      • Time - ShadowWaveTimer[3] expires
      • Time - ShadowWaveTimer[4] expires
      • Time - ShadowWaveTimer[5] expires
      • Time - ShadowWaveTimer[6] expires
    • Conditions
    • Actions
      • Custom script: local integer pn = 0
      • Custom script: loop
      • Custom script: exitwhen pn == -1
      • Custom script: set pn = pn + 1
      • Custom script: if (GetExpiredTimer() == udg_ShadowWaveTimer[pn]) then
      • Custom script: set udg_ShadowPN = pn
      • Custom script: set pn = -1
      • Custom script: endif
      • Custom script: endloop
      • Set ShadowWorkerPoint[0] = (Position of Workers[ShadowPN])
      • For each (Integer ShadowLoop) from 1 to AmountOfShadows[ShadowLevels[ShadowPN]], do (Actions)
        • Loop - Actions
          • Set ShadowWorkerPoint[1] = (ShadowWorkerPoint[0] offset by ((Random real number between 500.00 and 1000.00), (Random angle)))
          • Unit - Create 1 ShadowUnits[ShadowLevels[ShadowPN]] for Neutral Hostile at ShadowWorkerPoint[1] facing Default building facing degrees
          • Trigger - Run Fix Collision <gen> (ignoring conditions)
          • Hashtable - Save ShadowPN as 0 of (Key (Last created unit)) in ShadowHash
          • Set ShadowUnitsLeft[ShadowPN] = (ShadowUnitsLeft[ShadowPN] + 1)
          • Special Effect - Create a special effect at ShadowWorkerPoint[1] using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
          • Special Effect - Destroy (Last created special effect)
          • AI - Ignore (Last created unit)'s guard position
          • Unit - Order (Last created unit) to Attack-Move To ShadowWorkerPoint[0]
          • Custom script: call RemoveLocation (udg_ShadowWorkerPoint[1])
      • Custom script: call RemoveLocation (udg_ShadowWorkerPoint[0])
  • Shadow Wave Reset
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Load 0 of (Key (Triggering unit)) from ShadowHash) Greater than 0
    • Actions
      • Set ShadowPN = (Load 0 of (Key (Triggering unit)) from ShadowHash)
      • Set ShadowUnitsLeft[ShadowPN] = (ShadowUnitsLeft[ShadowPN] - 1)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in ShadowHash
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ShadowUnitsLeft[ShadowPN] Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of Workers[ShadowPN]) Less than or equal to 20.00
              • (Workers[ShadowPN] is alive) Equal to True
            • Then - Actions
              • -------- Start a new wave: --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShadowLevels[ShadowPN] Less than 7
                • Then - Actions
                  • Set ShadowLevels[ShadowPN] = (ShadowLevels[ShadowPN] + 1)
                • Else - Actions
              • Countdown Timer - Start ShadowWaveTimer[ShadowPN] as a One-shot timer that will expire in (Random real number between 15.00 and 30.00) seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShadowIsOn[ShadowPN] Equal to True
                • Then - Actions
                  • Countdown Timer - Pause ShadowWaveTimer[ShadowPN]
                  • Special Effect - Destroy SanityEffect[ShadowPN]
                  • Set ShadowIsOn[ShadowPN] = False
                • Else - Actions
        • Else - Actions
You use Handle ID for Key (Last created unit) as in
  • Hashtable - Save ShadowPN as 0 of (Key (Last created unit)) in ShadowHash
right? Then I don't know where's the problem.
Also, for the Collision stuff you could Wait 2.00 seconds or so after the unit enters the map and then turn it's collision back on.
Yes! I love it thank you!
For your concerns:
What happens when a hero dies? Their mana is still being checked despite them being dead.
Didn't even realize that. Can this condition fix it?
  • (Workers[ShadowPN] is alive) Equal to True
What happens if you don't kill the neutral hostile units? Should they expire?
I set Acquisition Range for each Shadow Unit equal 20000.00 so they won't quit chasing, and the game ends when hero dies so it's fine.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
If it only works for 1 player then you forgot to set the Size of the Array for the Timer. This has to be done inside of the Variable Edit due to a bug.
Also, are you creating the Hashtable properly?

And about the condition, if the game ends when the hero dies then is that condition even needed? It should fix the problem though.

What about the setup trigger and the periodic trigger? Can you post those as well.
 
Last edited:
Level 3
Joined
Mar 15, 2015
Messages
53
But then there will be another players, without the condition Shadow Units whould keep spawning and attacking other heroes am I correct?
I set the array to 6 but they keep reset back to 1, so I thought Array Size is automatically set.
1632134067173.png

Edit: Yes I created the hash
  • Shadow Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ShadowUnits[1] = Shadow Creeper
      • Set ShadowUnits[2] = Shadow Creeper
      • Set ShadowUnits[3] = Shadow Walker
      • Set ShadowUnits[4] = Shadow Walker
      • Set ShadowUnits[5] = Shadow Walker
      • Set ShadowUnits[6] = Shadow Charger
      • Set ShadowUnits[7] = Shadow Charger
      • Set AmountOfShadows[1] = 1
      • Set AmountOfShadows[2] = 2
      • Set AmountOfShadows[3] = 1
      • Set AmountOfShadows[4] = 2
      • Set AmountOfShadows[5] = 3
      • Set AmountOfShadows[6] = 1
      • Set AmountOfShadows[7] = 2
      • Hashtable - Create a hashtable
      • Set ShadowHash = (Last created hashtable)
In conclusion, I can't set Size to 12, it would jump back to 1 after I clicked on something else...
 
Last edited:
Level 3
Joined
Mar 15, 2015
Messages
53
Oh sorry here they are

  • Shadow Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ShadowUnits[1] = Shadow Creeper
      • Set ShadowUnits[2] = Shadow Creeper
      • Set ShadowUnits[3] = Shadow Walker
      • Set ShadowUnits[4] = Shadow Walker
      • Set ShadowUnits[5] = Shadow Walker
      • Set ShadowUnits[6] = Shadow Charger
      • Set ShadowUnits[7] = Shadow Charger
      • Set AmountOfShadows[1] = 1
      • Set AmountOfShadows[2] = 2
      • Set AmountOfShadows[3] = 1
      • Set AmountOfShadows[4] = 2
      • Set AmountOfShadows[5] = 3
      • Set AmountOfShadows[6] = 1
      • Set AmountOfShadows[7] = 2
      • Hashtable - Create a hashtable
      • Set ShadowHash = (Last created hashtable)

  • Lower20Check
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in PlayingPlayerGroup and do (Actions)
        • Loop - Actions
          • Set ShadowPN = (Player number of (Picked player))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage mana of Workers[ShadowPN]) Less than or equal to 20.00
              • (Workers[ShadowPN] is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShadowIsOn[ShadowPN] Equal to False
                • Then - Actions
                  • Countdown Timer - Start ShadowWaveTimer[ShadowPN] as a One-shot timer that will expire in (Random real number between 15.00 and 30.00) seconds
                  • Set ShadowLevels[ShadowPN] = 1
                  • Special Effect - Create a special effect attached to the overhead of Workers[ShadowPN] using Abilities\Spells\NightElf\shadowstrike\shadowstrike.mdl
                  • Set SanityEffect[ShadowPN] = (Last created special effect)
                  • Set ShadowIsOn[ShadowPN] = True
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ShadowIsOn[ShadowPN] Equal to True
                • Then - Actions
                  • Countdown Timer - Pause ShadowWaveTimer[ShadowPN]
                  • Special Effect - Destroy SanityEffect[ShadowPN]
                  • Set ShadowIsOn[ShadowPN] = False
                • Else - Actions
 
Level 19
Joined
Feb 27, 2019
Messages
582
The array size can be adjusted in the Trigger Editor by then re-selecting the Variable Type, however it disables everything the variable is used in. So... dont do that. I have even had bugs when I click on another variable afterwards and it disables everything for that variable. Using the Variable Editor would be wise.

Array size can be left at 1 and still allow to be set above 1. The higher arrays will not be affected by the initial value.

Oh, I see now in Things You Should Know When Using Triggers / GUI Section 1 Chapter 2 that it says Dialogs and Timers should have a higher array set from the start.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
The array size can be adjusted in the Trigger Editor by then re-selecting the Variable Type, however it disables everything the variable is used in. So... dont do that. I have even had bugs when I click on another variable afterwards and it disables everything for that variable. Using the Variable Editor would be wise.

Array size can be left at 1 and still allow to be set above 1. The higher arrays will not be affected by the initial value.

Oh, I see now in Things You Should Know When Using Triggers / GUI Section 1 Chapter 2 that it says Dialogs and Timers should have a higher array set from the start.
Array Sizes for Unit Groups, Player Groups, and Timers need to be initialized. You can leave it at 1 for everything else.
 
Status
Not open for further replies.
Top