somebody plz help me with this trigger

Post Reply
User avatar
LordElmo5280
Terran Barracks Laundry Master
Terran Barracks Laundry Master
Posts: 34
Joined: Sun Oct 07, 2007 12:13 pm

somebody plz help me with this trigger

Post by LordElmo5280 »

atm i'm attempting to make a tag map and i'm almost done i just need some major help with this trigger.

In my map I have about 8 different units as the runner but i'll just ask you to help me with the chicken(red) so you won't get confused.  First off I made it so that when you die you respawn as another unit - chicken(captured) at region 001.  So what i'm trying to do is, I wanna make a trigger that when a unit enters region 000 the chicken(captured) dies but at the same time I want it to revive the unit you began with which is the chicken, at region 000.  This is what i did:

This is the trigger that I made where the chicken dies - Note this trigger DOES work I just wanna know if I did the variable right:
Event:  Unit - Chicken 001 Dies
Conditions:  None
Actions: 
Unit - Create 1 Chicken (captured) for Player 1 (Red) at (Center of Region 001 ) facing Default building facing degrees.
VARIABLE Set Player1captured = (Units in Region 001 owned by Player1 (Red))
VARIABLE Set Player1 = (Units owned by Player 1 (Red))
Unit Group - Remove all units of Player1Captured from Player1
Unit Group - Pick every unit in Player1 and do (Unit - Kill (Picked unit))

Now this is the trigger I have trouble with:
Event: A unit enters region 000
Conditions:  None
Actions:
Units Group:  Pick every unit in Player1captured and do (Unit - Kill (Picked Unit))
Unit:  Create 1 Chicken for Player 1 (Red) at (Center of Region 000 ) facing (Position of (Triggering Unit))

My problem is that when you move to region 000 to activate the revival trigger about 20-25 units spawn instead of just one ive been working at this one trigger for a few days now and its getting annoying plz help (if you could give me an exact code that would be awsome if not thats fine too)  :D
Last edited by LordElmo5280 on Fri Oct 26, 2007 2:36 pm, edited 1 time in total.
User avatar
Ricky_Honejasi
Xel'naga Solar Moderator
Xel'naga Solar Moderator
Posts: 2011
Joined: Wed Aug 16, 2006 3:50 pm

Re: somebody plz help me with this trigger

Post by Ricky_Honejasi »

I didn't reply any time soon but anyway :

Your first trigger seems to rely on the pre-created chicken instead of any unit of type of chicken owned by player 1.

For your second trigger, it's possible multiple units "enters" the region. I believe even a newly created unit inside a region might trigger it. It's possible that your second trigger triggers itself again and again because of it.
User avatar
LordElmo5280
Terran Barracks Laundry Master
Terran Barracks Laundry Master
Posts: 34
Joined: Sun Oct 07, 2007 12:13 pm

Re: somebody plz help me with this trigger

Post by LordElmo5280 »

im not sure what you mean but i took a code from kodo tag but kodo tag but since kodo tag only has 1 unit type for each runner its a bit different this is what i did:
Events:
Unit - A unit enters Region 000

Conditions:
Or - Any (Conditions) are true
    Conditions:
        (Unit-type of (Triggering unit)) Equal to voodoodie
        (Unit-type of (Triggering unit)) Equal to Chicken
        (Unit-type of (Triggering unit)) Equal to Computer-ezy
        (Unit-type of (Triggering unit)) Equal to Deer
        (Unit-type of (Triggering unit)) Equal to Dune Worm
        (Unit-type of (Triggering unit)) Equal to KrnPrideKTB
        (Unit-type of (Triggering unit)) Equal to Rabbit
        (Unit-type of (Triggering unit)) Equal to Racoon
(Number of units in (Units in Region 001 )) Not equal to 0

Actions:

Note: These two triggers work

Player - Add (50 x (Number of units in (Units in Region 001 ))) to (Owner of (Triggering unit)) Current gold
Unit Group - Pick every unit in (Units in Region 001 ) and do (Unit - Remove (Picked unit) from the game)

These triggers wont work

     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type Chicken (captured))) Equal to 1)) and do (Unit - Create 1 Chicken for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type KrnPrideKTB (captured))) Equal to 1)) and do (Unit - Create 1 KrnPrideKTB for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type Deer (Captured))) Equal to 1)) and do (Unit - Create 1 Deer for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type voodoodie (Captured))) Equal to 1)) and do (Unit - Create 1 voodoodie for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type Rabbit (captured))) Equal to 1)) and do (Unit - Create 1 Rabbit for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type Racoon (captured))) Equal to 1)) and do (Unit - Create 1 Racoon for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type Dune Worm (captured))) Equal to 1)) and do (Unit - Create 1 Dune Worm for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type Computer-ezy (captured))) Equal to 1)) and do (Unit - Create 1 Computer-ezy for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)

For some reason it only revives the dog(computer-ezy) when i enter middle, everything else works.
Last edited by LordElmo5280 on Fri Nov 02, 2007 6:04 pm, edited 1 time in total.
User avatar
Ricky_Honejasi
Xel'naga Solar Moderator
Xel'naga Solar Moderator
Posts: 2011
Joined: Wed Aug 16, 2006 3:50 pm

Re: somebody plz help me with this trigger

Post by Ricky_Honejasi »

LordElmo5280 wrote: im not sure what you mean but i took a code from kodo tag but kodo tag but since kodo tag only has 1 unit type for each runner its a bit different this is what i did:
What I did mean in other words :

In the very first trigger in your first post, you must NOT use Chicken 0001 (or whatever very specific unit, not to be confused with unit-type) since the trigger will fall the second that player have a different chicken.

About the second trigger in your first post, a trigger's actions can trigger another trigger's actions or even the very same trigger again. If you follow the logic of both triggers :

1) Trigger #2 has a "Region enter" event
2) Trigger #2 has a create unit action
3) Trigger #2 might trigger itself after the create unit action creates a unit that somehow is in the very same region as the region that triggers #2 in the first place.

As for using another map's triggers (which you should give credit to the author btw), it is always recommended that you fully understand how it worked in the very first place and not use it with a "it seems to work, ill use it" mentality.

Meh, was dog(computer-ezy) the only one that entered the region?

EDIT 1 : Also, I would recommend scrapping those 8 unit-types and just limit yourself to "Chicken" and "Chicken (Captured)".

EDIT 2 : Heh, after checking more carefully ...

1) "Move Unit Group - Pick every unit in (Units in Region 001 ) and do (Unit - Remove (Picked unit) from the game)" to the very end of your actions

2) Change
"Unit Group - Pick every unit in (Units in Region 001 ) and do (Unit - Remove (Picked unit) from the game)"
to
"Unit Group - Pick every unit in (Units in Region 001 of type Chicken(Captured)) and do (Unit - Remove (Picked unit) from the game)"

Your mistake was to remove all chicken (captured or not) in region 001 with "Unit Group - Pick every unit in (Units in Region 001 ) and do (Unit - Remove (Picked unit) from the game)" and then when it arrives to the chicken spawning conditions, they are already gone so it checks as 0 chicken instead of 1.
Last edited by Ricky_Honejasi on Fri Nov 02, 2007 6:57 pm, edited 1 time in total.
User avatar
LordElmo5280
Terran Barracks Laundry Master
Terran Barracks Laundry Master
Posts: 34
Joined: Sun Oct 07, 2007 12:13 pm

Re: somebody plz help me with this trigger

Post by LordElmo5280 »

In order to make it less confusing I changed my region 000 and 001's names to:
region 000 = Critter Save
Region 001 = Critter Capture

I now understand what was wrong with my first trigger but i don't get how trigger #1 can trigger, trigger #2 in trigger #1 when a unit dies it respawns in region Critter Capture as a different unit.  i don't understand how it can trigger, trigger #2 if a unit hasn't entered region Critter Save to activate trigger #2 how can trigger #1 activate trigger#2 if trigger#2's events have not been met?

Also i fixed my:
Unit Group - Pick every unit in (Units in Region 001 ) and do (Unit - Remove (Picked unit) from the game)" to
"Unit Group - Pick every unit in (Units in Region 001 of type Chicken(Captured)) and do (Unit - Remove (Picked unit) from the game)"
and i did it for the rest of my unit types:
"Unit Group - Pick every unit in (Units in Region 001 of type computer-ezy(Captured)) and do (Unit - Remove (Picked unit) from the game)"
"Unit Group - Pick every unit in (Units in Region 001 of type rabbit (Captured)) and do (Unit - Remove (Picked unit) from the game)"
ect.....
But this put me back to my old problem, it spawns 15-20 or them and it only works for computer-ezy.

I think the problem is my player groups:
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type Chicken (captured))) Equal to 1)) and do (Unit - Create 1 Chicken for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
     Player Group - Pick every player in (All players matching ((Number of units in (Units owned by (Matching player) of type KrnPrideKTB (captured))) Equal to 1)) and do (Unit - Create 1 KrnPrideKTB for (Picked player) at (Center of Region 000 ) facing Default building facing degrees)
ect.....

Also alittle responses to your edits:
I would rather put different unit types because i was planning to put all of the names of my friend's screen names in the game, unless there is a way to add a different name for each player's unit, even though its the same unit type otherwise i would rather keep it like this, unless its impossible to make a revival trigger with 8 different types of units, or its way to complex for my level.)

I understand some of the concept of kodo tag's trigggers, I had to in order to change them so it would work for all 8 of my unit types and i will be giving credit to them and all of the other maps i've copied from.
Last edited by LordElmo5280 on Fri Nov 02, 2007 10:06 pm, edited 1 time in total.
Post Reply