URI:
   DIR Return Create A Forum - Home
       ---------------------------------------------------------
       Sheep Tag Community
  HTML https://sheeptag.createaforum.com
       ---------------------------------------------------------
       *****************************************************
   DIR Return to: General Discussion
       *****************************************************
       #Post#: 3108--------------------------------------------------
       Need help with a trigger
   DIR By: HaWkys
       Date: November 22, 2013, 7:52 pm
       ---------------------------------------------------------
       oke so am creating a game (like sheep tag) but instead of having
       a pen you are killed, another unit will be created in an
       isolated area. You can be freed by a panel or button outside
       that one of ur allies has to step on, I am having trouble coming
       up with a winning trigger for the wolf, when all of the "sheep"
       for a lack of better term are all in that confined region. So
       far i have:
       Event- Generic unit dies.
       Condition- Triggering unit = Sheep AND Unit in specific region =
       team number of player 1 red (meaning the ENTIRE TEAM)
       Action- Player group - remove all picked players from playable
       map area.
       -Autotimed message ("Sheep have lost, Game will end in 5
       seconds.
       -Wait 5 seconds
       -Game over
       will this work?
       #Post#: 3109--------------------------------------------------
       Re: Need help with a trigger
   DIR By: SHEePYTaGGeRNeP
       Date: November 23, 2013, 3:54 am
       ---------------------------------------------------------
       Change it to?
       --- Code ---
       Condition - AND Owner of unit is an ally of Player Red = true
       ( It's @ boolean )
       
       Action - Unit Group - Pick every unit of Owned by Triggering
       Player - remove all picked unit from the game
       --- End Code ---
       I don't know what you are trying to do though.
       If you want the game to end you probably would want
       --- Code ---
       If ( integer ( count units of type SHEEP ) == 0 )
       Sheep Lose game.
       
       --- End Code ---
       #Post#: 3111--------------------------------------------------
       Re: Need help with a trigger
   DIR By: Wrda
       Date: November 23, 2013, 4:58 am
       ---------------------------------------------------------
       --- Code ---
       End
       Events
       Unit - A unit Dies
       Conditions
       (Unit-type of (Triggering unit)) Equal to Peasant
       Actions
       If (All Conditions are True) then do (Then Actions)
       else do (Else Actions)
       If - Conditions
       (Number of units in (Units of type Peasant))
       Equal to 0
       Then - Actions
       Set group = (Units in (Playable map area))
       Unit Group - Pick every unit in group and do
       (Actions)
       Loop - Actions
       Unit - Remove (Picked unit) from the
       game
       Custom script:   call DestroyGroup(udg_group)
       Game - Display to (All players) the text:
       Sheep have lost, th...
       --------
       -----------------------------------Victory for
       wolves---------------- --------
       --------
       -----------------------------------Defeat for
       sheep------------------- --------
       Else - Actions
       
       --- End Code ---
       NOTE: group is a unit group variable.
       #Post#: 3114--------------------------------------------------
       Re: Need help with a trigger
   DIR By: Chakra
       Date: November 23, 2013, 9:20 am
       ---------------------------------------------------------
       Well, if you are fixing one leak on an end-game trigger, should
       fix both.
       --- Quote ---
       > (Unit-type of (Triggering unit)) Equal to Peasant
       --- End Quote ---
       This by default leaks. However, since it isn't setting some
       variable to it, it's an instant leak, so you can't do
       DestroyGroup on it. However, the count function uses the
       bj_wantDestroyGroup variable, so all you have to do is:
       --- Quote ---
       > Custom script:   set bj_wantDestroyGroup = true
       --- End Quote ---
       Before the if statement.
       #Post#: 3117--------------------------------------------------
       Re: Need help with a trigger
   DIR By: Wrda
       Date: November 23, 2013, 10:02 am
       ---------------------------------------------------------
       Yes there should be another group of the unit type.
       #Post#: 3120--------------------------------------------------
       Re: Need help with a trigger
   DIR By: HaWkys
       Date: November 23, 2013, 11:04 am
       ---------------------------------------------------------
       I'll explain myself more in depth.
       Event- Generic unit dies
       Condition- (Unit-type of (Triggering unit)) Equal to Sheep
       Now let me explain for the action. All of the sheep (or any
       other unit im just naming this one out of the blue) are in the
       "center like" region of sheep tag. They cannot leave. Once all
       the sheep team is stuck in this region. I would like the game to
       end but here i am having problems.
       -Wrda u mentioned a specific value like
       -total # of units in (specific region = 0) I cant have that i
       need when all of the players in the sheep team are in that
       region the game ends.
       #Post#: 3124--------------------------------------------------
       Re: Need help with a trigger
   DIR By: SHEePYTaGGeRNeP
       Date: November 23, 2013, 12:26 pm
       ---------------------------------------------------------
       if (Number of units in (Units in Sheep Region <gen> matching
       ((Unit-type of (Matching unit)) Equal to Wisp))) Equal to
       (Number of players in (All allies of Player 1 (Red)))
       {
       Sheep Have Won The Game;
       }
       Something like this you mean?
       EDIT: I don't know if Allies of Player 1  actually checks for
       players that are playing and are ally of player I, you can also
       just change to Number of Player in ( Variable Player Group that
       you created )
       #Post#: 3130--------------------------------------------------
       Re: Need help with a trigger
   DIR By: Wrda
       Date: November 23, 2013, 6:28 pm
       ---------------------------------------------------------
       Hawkys I don't think you know what my trigger does:
       A unit dies
       if unit type of the dying unit is sheep, then do actions
       if the number of units of sheep is 0 (MEANING THERE ARE NO
       SHEEPS LEFT) then do actions
       blablabla
       #Post#: 3132--------------------------------------------------
       Re: Need help with a trigger
   DIR By: HaWkys
       Date: November 23, 2013, 9:22 pm
       ---------------------------------------------------------
       yes wrda i knew what you meant, but when the sheep die they are
       created in the "jail" and can only be freed when a fellow sheep
       steps on the panel (it opens the gate)
       #Post#: 3133--------------------------------------------------
       Re: Need help with a trigger
   DIR By: Chakra
       Date: November 23, 2013, 9:24 pm
       ---------------------------------------------------------
       If the number of all sheep in the playable map area is equal to
       the number of all sheep in the pen and the gate is closed then
       they lost?
       Sounds like a rather simple deviation.
       *****************************************************
       Page 1 of 2
   DIR Next Page