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

Status
Not open for further replies.
Level 2
Joined
Feb 8, 2010
Messages
17
  • Defeat
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If ((Dying unit) Equal to Building01) then do (Set Building01Alive = False) else do (Do nothing)
      • If ((Dying unit) Equal to Building02) then do (Set Building02Alive = False) else do (Do nothing)
      • If ((Dying unit) Equal to Building03) then do (Set Building03Alive = False) else do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Building01Alive Equal to False
          • Building02Alive Equal to False
          • Building03Alive Equal to False
        • Then - Actions
          • Game - Defeat (Owner of (Dying unit)) with the message: Defeat!
        • Else - Actions
Variables used:
Building01-03 are "Unit" variables.
Building01-03Alive are "Boolean" variables. Value: "True"
If you have alot of building needed for defeat you could use array variables. But for this i went non-array.


  • Player1 Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
Trigger 1: Might not be the best trigger for this type of thing, since it will require alot of Variables. But without further info this was the best I could come up with.

Trigger 2: I do not know of an way to make this just 1 trigger for all players, I dont even think that is possible without JASS or something, since the PlayerGroup variable wont respond to this. Not sure why. But you will have to make one for each player.

Regards,
Orbit
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I would do it like this:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Temp_Group_1 = (Units owned by (Owner of (Triggering unit)) matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Farm)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_Group_1) Equal to 0
        • Then - Actions
          • Game - Defeat (Owner of (Triggering unit)) with the message: Defeat!
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
When all farms are destroyed, the player is defeated.
 
Level 6
Joined
Jul 8, 2009
Messages
60
I would do it like this:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Temp_Group_1 = (Units owned by (Owner of (Triggering unit)) matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Farm)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_Group_1) Equal to 0
        • Then - Actions
          • Game - Defeat (Owner of (Triggering unit)) with the message: Defeat!
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
When all farms are destroyed, the player is defeated.

could you mabye send me this trigger in the map i dont know how to set the variable to that
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a unit group variable. When you se the variable, select "Units owned by player matching condition". Then click the "Player 1(Red)" and select "owner of unit". Click OK. Then click "condition", select "And". It's almost at the bottom of the list. The first condition can be found under boolean, the second is unit type comparison.
 
Status
Not open for further replies.
Top