• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Victory Trigger Problem

Status
Not open for further replies.
Level 3
Joined
Apr 27, 2005
Messages
28
Here my trigger for victory of force one...


Code:
Force1
    Events
        Unit - A unit owned by Player 5 (Yellow) Dies
        Unit - A unit owned by Player 6 (Orange) Dies
        Unit - A unit owned by Player 7 (Green) Dies
        Unit - A unit owned by Player 9 (Gray) Dies
    Conditions
        ((Triggering player) is an ally of Player 5 (Yellow)) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units in (Playable map area) owned by (Matching player))) Equal to 0
            Then - Actions
                Game - Victory Player 1 (Red) (Show dialogs, Show scores)
                Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
                Game - Victory Player 3 (Teal) (Show dialogs, Show scores)
                Game - Victory Player 4 (Purple) (Show dialogs, Show scores)
            Else - Actions



Problem is as soon as 1 builing of an opponents dies your force wins.... I thought that it looked right... anyone see what wrong with it?
 
Level 6
Joined
May 8, 2005
Messages
249
make a generic unit event, to make the trigger shorter. also, do if owner of unit = to ally of player
and unit type = the building
 
Level 3
Joined
Apr 27, 2005
Messages
28
I dont think you getting what my trigger is...

I want the trigger to be so that force on achives vicort when force 2 has no units/builings left...
 
Level 6
Joined
May 8, 2005
Messages
249
ok, make a timer event then. like every x seconds.

edit: i think matching player, ive never used it, but i know triggering player works. it would replace it becuase its the triggering player that the event is happening to. so you would need the timer event, just change matching to triggering.

also, you can still change to generic unit event, and do make sure the owner of triggering player = ally of player 5. then, instead of triggering player, its owner of triggering unit.

however, for the quick fix, just change to triggering player.
 
Level 7
Joined
Jul 30, 2004
Messages
451
titan_06 said:
ok, make a timer event then. like every x seconds.

imo turning a trigger into a 'periodic event' that doesn't need to be is a bad practice
you should learn to use event handling more

of course, not saying that you have to turn it back or anything, just something to think about for the future
 
Status
Not open for further replies.
Top