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

Power Generator + Shield Trigger

Status
Not open for further replies.
Level 2
Joined
Apr 3, 2020
Messages
6
Hi all,

I'm currently working on a map where if ALL THREE power generators are "activated," a shield would form around a gate giving it bonus armor. In terms of giving a unit bonus armor, that I can do. However, I'm not exactly sure how to make a trigger where if three power generators use an ability to be "activated" AND all generators are active, a shield would form around the gate.
P.S. - Already have a shield model.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Well, there's multiple ways of going about this.

An easy way that comes to mind is using an Integer to track when the power generators "activate".

In this case, I'm using the Defend ability as an "Activate/Deactivate Shields" ability that you can toggle on and off.
  • Turn On Shields
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(defend))
        • Then - Actions
          • Set VariableSet ActiveShields = (ActiveShields + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ActiveShields Equal to 3
            • Then - Actions
              • -------- Add the armor ability to the gate --------
              • Special Effect - Create a special effect at (Center of Region 000 <gen>) using Abilities\Spells\Human\ManaShield\ManaShieldCaster.mdl
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(undefend))
            • Then - Actions
              • Set VariableSet ActiveShields = (ActiveShields - 1)
              • -------- Remove the armor ability from the gate --------
              • Special Effect - Set Height of (Last created special effect) to: 5000.00
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
You have to use Orders to catch when a unit activates/deactivates an ability like Defend, Mana Shield, Immolation etc... instead of the "a unit casts an ability" Events that you would normally use.

Maybe use Mana Shield instead of Defend since that ability has a buff that you can customize.
 

Attachments

  • Shields Example.w3m
    17.3 KB · Views: 29
Last edited:
Level 2
Joined
Apr 3, 2020
Messages
6
This is exactly what I am looking for. However, I can't seem to understand why you would raise the special effect up to 5000, only to destroy it with the following action.
 
Status
Not open for further replies.
Top