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

Gate Toggle Problems

Status
Not open for further replies.
Level 6
Joined
Oct 11, 2005
Messages
142
I'm been trying to make a "open gate" and "close gate" spell that is suppose to open/close any gate it targets. The "open gate" works fine, but opened gates are untargetable by spells so I can't cast "close gate" to close the gates. Is there any way to fix this?
 
Level 6
Joined
Oct 11, 2005
Messages
142
But that would require me to make a trigger for every gate, something I was trying to avoid in the first place. Isn't there a way to make just one universal gate opening system?
 
Level 5
Joined
May 3, 2009
Messages
129
couldn't it be done something like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Storm Bolt
    • Actions
      • Wait 0.40 game-time seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of (Target destructible of ability being cast)) Equal to Lever
        • Then - Actions
          • Set lever = (Target destructible of ability being cast)
          • Destructible - Pick every destructible within 100.00 of (Position of lever) and do (Actions)
            • Loop - Actions
              • Destructible - Close (Picked destructible)
          • Destructible - Remove (Target destructible of ability being cast)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of (Target destructible of ability being cast)) Not equal to Lever
        • Then - Actions
          • Destructible - Open (Target destructible of ability being cast)
          • Destructible - Create a Lever at (Target point of ability being cast) facing (Random angle) with scale 0.50 and variation 1
        • Else - Actions
the wait is only to give the spell the cooldown as i have used storm bolt to test it
 
Level 6
Joined
Oct 11, 2005
Messages
142
Turns out the aoe close spell works, thanks for the help.

for the curious, the final close trigger:

Close Gate
Events
Unit - A unit Starts the effect of an ability
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Close Gate
Then - Actions
Destructible - Pick every destructible within 100.00 of (Target point of ability being cast) 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
(Destructible-type of (Picked destructible)) Equal to Iron Gate (Horizontal)
(Destructible-type of (Picked destructible)) Equal to Iron Gate (Vertical)
(Destructible-type of (Picked destructible)) Equal to City Entrance
(Destructible-type of (Picked destructible)) Equal to City Entrance
Then - Actions
Destructible - Close (Picked destructible)
Else - Actions
Do nothing
Else - Actions
Do nothing
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Close Gate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Close Gate
        • Then - Actions
          • Destructible - Pick every destructible within 100.00 of (Target point of ability being cast) 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
                      • (Destructible-type of (Picked destructible)) Equal to Iron Gate (Horizontal)
                      • (Destructible-type of (Picked destructible)) Equal to Iron Gate (Vertical)
                      • (Destructible-type of (Picked destructible)) Equal to City Entrance
                      • (Destructible-type of (Picked destructible)) Equal to City Entrance
                • Then - Actions
                  • Destructible - Close (Picked destructible)
                • Else - Actions
                  • Do nothing
        • Else - Actions
          • Do nothing

Change it to

  • Close Gate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Close Gate
    • Actions
      • Set Temp_Loc_1 = (Target point of ability being cast)
      • Destructible - Pick every destructible within 100.00 of (Temp_Loc_1) 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
                  • (Destructible-type of (Picked destructible)) Equal to Iron Gate (Horizontal)
                  • (Destructible-type of (Picked destructible)) Equal to Iron Gate (Vertical)
                  • (Destructible-type of (Picked destructible)) Equal to City Entrance
                  • (Destructible-type of (Picked destructible)) Equal to City Entrance
            • Then - Actions
              • Destructible - Close (Picked destructible)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
 
Level 6
Joined
Oct 11, 2005
Messages
142
The revised, leak-free trigger:

Close Gate
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Close Gate
Actions
Set Temp_Point = (Target point of ability being cast)
Destructible - Pick every destructible within 100.00 of Temp_Point 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
(Destructible-type of (Picked destructible)) Equal to Iron Gate (Horizontal)
(Destructible-type of (Picked destructible)) Equal to Iron Gate (Vertical)
(Destructible-type of (Picked destructible)) Equal to City Entrance
(Destructible-type of (Picked destructible)) Equal to City Entrance
Then - Actions
Destructible - Close (Picked destructible)
Sound - Play GateOpen <gen> at 100.00% volume, located at (Position of (Picked destructible)) with Z offset 0.00
Else - Actions
Custom script: call RemoveLocation(udg_Temp_Point)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Close Gate
    • ...
    • Then - Actions
      • Set Temp_Point2 = Position of (Picked Destructible)
      • Destructible - Close (Picked destructible)
      • Sound - Play GateOpen <gen> at 100.00% volume, located at (Set Temp_Point2) with Z offset 0.00
      • Custom script: call RemoveLocation(udg_Temp_Point2)
    • ...
 
Level 8
Joined
Aug 21, 2009
Messages
333
Instead of making it instant cast and AOE, try just basing the spell on something with a target (ie. stormbolt) and adding "debris" to the Targets Allowed field.

EDIT: it would also be cool if you had a feature in your map where a key is required for the first time you open any gate.
 
Level 8
Joined
Aug 21, 2009
Messages
333
well, did you get it to work the other way (no target, instant spell)?

that might be your best bet. otherwise, you could put a model-less and collisionless unit at the same location as the gate and have the ability be cast on that when the gate is gone. This will require some way of relating the placeholder unit to the gate itself, but this could be done through proximity (ie. select all destructibles within XX of the placeholder unit and revive them).

Tell me if this needs clarification or if you even think this is worth pursuing.
 
Level 6
Joined
Oct 11, 2005
Messages
142
Maker's method works fine with no problems, just make a no target, AoE spell and have a trigger that opens/closes any gate within the AoE.
 
Status
Not open for further replies.
Top