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

How to make this type of trigger?

Status
Not open for further replies.
Level 4
Joined
Feb 7, 2007
Messages
61
How to make this type of trigger?

Is there a trigger to where...for example...

there are some long-ranged archers who is attacking Computer 12 Units, on a wall behind destrutible gates, in which the Units who are being attacked can't get to, because their pathing is blocked, then order the Units to attack the gates.
 
Level 4
Joined
Feb 7, 2007
Messages
61
Not actually, units who are being attacked by archers on the wall, to kill the gates, which makes it available for them to go around the wall and upstairs to kill the archers.
 
Level 4
Joined
Feb 7, 2007
Messages
61
Basically. But to integrate it with ground troops on the floor attacking them. So they would have to kill anything that gets in the way, in order to kill the archers.
 
Level 6
Joined
Dec 9, 2007
Messages
208
Well you could either make a region trigger in front of the gates that order enemies to attack the gate. (Remember to disable after the gate is down)

Or you could make a gate that is owned by a player. So basicly it would just be a building looking like a gate, but enemies would attack it automaticly.
 
Level 4
Joined
Feb 7, 2007
Messages
61
I thought about doing the first one you said, but then again, there will be mobs behind the mobs attacking the gate. What will happen to the mobs behind the mobs who are attacking the gate after the gate is destroyed?

The 2nd idea is not too bad. I never thought it that way. Then again, i want to make them gates open-able and close-able.
 
You can make a trigger that checks when an archer is attacked. Then, a boolean comparison will be applied to check if the attacker can indeed attack the archer:
  • Trigger
  • Events
    • Unit - A unit is attacked
  • Conditions
    • (CanAttack) Equal to False
  • Actions
    • Unit - Order (Attacking unit) to Stop
    • Set Point1 = (Position of (Attacking unit))
    • Set TempGroup = (Units in (Units within 500.00 of (Point1) matching ((Matching unit) belongs to an enemy of (Owner of (Attacking unit)) Equal to True) and ((Unit-type of (Matching unit)) Not Equal to Archer)
    • Unit - Order (Attacking unit) to Attack (Random unit from TempGroup)
    • Custom script: call RemoveLocation (udg_Point1)
    • Custom script: call DestroyGroup (udg_TempGroup)
You can also make a trigger to check when a unit dies. If a unit is owned by the owner of your archers (E.g. Player 12 (Brown)), then make a check of how many units owned by Player 12 (Brown) are alive and are not of type Archer. If they are 0, then set CanAttack to True.
 
Level 6
Joined
Dec 9, 2007
Messages
208
Well you can just make 2 buildings, the original gate and a open gate with no collision
 
Level 4
Joined
Feb 7, 2007
Messages
61
How do i get to "Can Attack Equal False" Condition? lol

How do i make it to where it will switch the Unit to Close and Open gates?

Edit:

Nvm, i think i know how to make it switch, but

There isn't a model file for the destructible for Gate when its opened for me to switch it to..

I'm still wondering where you find "Can Attack Equal False" at in the conditions. is it a variable?
 
Last edited:
Status
Not open for further replies.
Top