• 🏆 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] victory conditions

Status
Not open for further replies.
Level 17
Joined
Aug 19, 2007
Messages
1,380
Hi, I'm having trouble with victory conditions for my newest map http://www.hiveworkshop.com/forums/map-development-202/new-rts-augmentation-warfare-171000/#post1626020.

The triggers just does nothing:

  • Victory
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Number of units in (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True))) Equal to 0
    • Actions
      • Player Group - Pick every player in (All allies of (Owner of (Killing unit))) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
Anyone know what I did wrong? Thanks for taking the time!
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Or maybe just this:
  • TestTrigger2144
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Number of units in (Units in (Playable map area) owned by (Owner of (Triggering unit)))) Equal to (==) 0
    • Actions
      • Player Group - Pick every player in (All allies of (Owner of (Killing unit))) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
~ Greetings
The Bomb King > Dr. Boom
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Moin moin =)

Or maybe just this:
  • TestTrigger2144
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Number of units in (Units in (Playable map area) owned by (Owner of (Triggering unit)))) Equal to (==) 0
    • Actions
      • Player Group - Pick every player in (All allies of (Owner of (Killing unit))) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
~ Greetings
The Bomb King > Dr. Boom
Not the best way to do that since it gives a different victory condition...if it actually would work correctly.
The reason the condition is failing is because it doesn't check if the matching unit is alive.
I'm not sure, but I think you're leaking a group too.
 
Level 17
Joined
Aug 19, 2007
Messages
1,380
thanks for all the comments,

Maybe you should make the event a perodic thing like every 1 seconds it checks the condtions and if its true than win.
Although i can't see nothing wrong....
, I don't think this can work since it doesn't count which the killer is (the action won't work).

seems you are setting the condition at wrong way.

should have use if/then/else.
, I tried it but that doesn't work either alas.

Moin moin =)

Or maybe just this:
  • TestTrigger2144
    • Events
    • Unit - A unit Dies
    • Conditions
    • (Number of units in (Units in (Playable map area) owned by (Owner of (Triggering unit)))) Equal to (==) 0
    • Actions
    • Player Group - Pick every player in (All allies of (Owner of (Killing unit))) and do (Actions)
    • Loop - Actions
    • Game - Victory (Picked player) (Show dialogs, Show scores)
~ Greetings
The Bomb King > Dr. Boom
, unfortunately this doesn't work. .

Not the best way to do that since it gives a different victory condition...if it actually would work correctly.
The reason the condition is failing is because it doesn't check if the matching unit is alive.
I'm not sure, but I think you're leaking a group too.
, yes I think you're right, could you explain me how I could make the trigger?

I tried this one, but that doesn't work either:

  • Victory
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Victory_Unit = (Killing unit)
      • Wait 3.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of (Owner of Victory_Unit)) Equal to True))) Equal to 0
        • Then - Actions
          • Player Group - Pick every player in (All allies of (Owner of Victory_Unit)) and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
        • Else - Actions
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
You need to use And since it requires two conditions.
The trigger would look something like this:
  • VictoryCondition
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching ((((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Equal to 0
        • Then - Actions
          • Player Group - Pick every player in (All allies of (Owner of (Killing unit))) and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Status
Not open for further replies.
Top