Warcraft III resources & community, 2003–2006 · archived

Help in my map triggers

9 posts
#1

Help in my map triggers

i need help with 2 problems
my map is an hero arena.

the first one is a triger that prevent allies attack allies.

the second is to detect living units in team 1 to make duel end.

look my :idea:idea but dont work i nedd help to fix it or try another way to do it.

the end of duel
Events
Time - Every 5.00 seconds of game time
Conditions
bDuel Equal to True
Actions
For each (Integer A) from 1 to 5, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team2 <gen> (checking conditions)) else do (Do nothing))
For each (Integer A) from 6 to 10, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team 1 <gen> (checking conditions)) else do (Do nothing))
#2
1) Just make a dummy with a polymorph based ability that costs 0 mana that can target enemies and allies.
also give the dummy -1 hp regen and 1(2) hp.

Events:
Unit is attacked
Conditions:
--------
Actions:
If: owner of attacking unit is an allie of owner of attacked unit
Then: Create 1 polymorph dummy at position of attacking unit
Order last created unit to human sorceress - polymorph attacking unit
Else: Do Nothing

PS: Make sure u base the spell off the sorc polymorph and not the neutral hostile, else it doesnt work

2)
For each (Integer A) from 1 to 5, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team2 <gen> (checking conditions)) else do (Do nothing))
For each (Integer A) from 6 to 10, do (If ((Number of living (Unit-type of Heroes[(Integer A)]) units owned by (Owner of Heroes[(Integer A)])) Equal to 0) then do (Trigger - Run End Duel team 1 <gen> (checking conditions)) else do (Do nothing))


.... No ..... :P U dont need 2 do it that complicated
Events:
Unit dies
Contitions:
--------
Actions:
If: and conditions:
Dying unit = owned by player 1
integer comparison - number of units owned by player 1 in Rect (a rect that covers the arena) = o
Then: *end the duel*
Else: Do Nothing

Tell me if it doesnt work
#3
hey guy tnx for the help but in my case all the heroes of the game are on duel.. not only player 1
#4
Then: Unit dies. If unit is in a playergroup1 (playergruop type variable) (in map ini set all players form a team in that variable)
if number of units in playergroup is 0 then......
#5
hey man you can explain it with more details ??
i tried this but dont worked :cry:


the end of duel
Events
Unit - A unit Dies
Conditions
bDuel Equal to True
((Triggering unit) is A Hero) Equal to True
Actions
If ((Owner of (Dying unit)) Equal to (Random player from Team1)) then do (Unit Group - Add (Dying unit) to Team1deadheroes) else do (Do nothing)
If ((Owner of (Dying unit)) Equal to (Random player from Team2)) then do (Unit Group - Add (Dying unit) to Team2deadheroes) else do (Do nothing)
If ((Number of units in Team1deadheroes) Equal to (Number of units in Team1Heroes)) then do (Trigger - run End Duel team2 <gen>) else do (Do nothing)
If ((Number of units in Team2deadheroes) Equal to (Number of units in Team2Heroes)) then do (Trigger - run End Duel team 1 <gen>) else do (Do nothing)
#6
Why the hell dont u just do what I said?

Why do u add players to a playergroup in that trigger when they die??? U should add players to the player group in another trigger in map initilization.

Whats this for bullcr*p => If ((Number of units in Team1deadheroes) Equal to (Number of units in Team1Heroes))

The number in 'team1deadheroes' is ALWAYS equal to the number of 'team1deadheroes' :shock:

I dont get what u r trying. Just do precisely as what I told u 2 or 3 post back
#7
hey why are you streesing man just relax :P

i finded 2 ways to do it xD one based on your way one that i tryed.

all this could be faster and better if people can give opensource maps.

then tank you


"sorry for my bad english"
#8
arthurprshey why are you streesing man just relax :P

i finded 2 ways to do it xD one based on your way one that i tryed.

all this could be faster and better if people can give opensource maps.

then tank you


It also could be faster if u do what I said!... kidding :P But doesnt it work or not?

arthurprs"sorry for my bad english"


Nobody is perfect...

*cough*exceptme*cough*
#9
exacty how that you said no

now im at work tomorow i post the 2 ways...