HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger help needed

08-12-2006, 02:59 AM#1
WTFish
I have another thing which I'm not sure exactly how to make.

I'm trying to create a healing well that is neutral, but can be claimed by going close to it. However it can't be claimed if there are any enemies within say 1000 range. If an enemy unit comes within that range, while the well is under your control, the well will go back to neutral, until you have scared them off, then you can reclaim it.

Any ideas on how this could be accomplished? Exact triggers would be nice.

Thanks.
08-12-2006, 06:38 AM#2
DioD
Trigger:
Untitled Trigger 001
Collapse Events
Unit - A unit comes within 1000.00 of No unit
Conditions
Collapse Actions
-------- i dont know what extracly you need soo no filters added --------
Unit - Change ownership of No unit to Neutral Passive and Change color
08-13-2006, 12:44 AM#3
WTFish
I don't think you read my first post completely, lol. I know the very basics, but I don't know how to make the well not able to be claimed if there are any enemies within 1000, or go back to neutral if an enemy comes within range while it's under your control. If you can elaborate on your answer, or someone else could help, it would be greatly appreciated.
08-13-2006, 12:47 AM#4
DioD
Enum group in 1000 range count units if > 0 there is units if 0 no units turn neutral.

Its not a trigger, its jass functions based only
08-14-2006, 05:11 AM#5
WTFish
Lol, as I said, I only know the very basics. If you could be kind enough to elaborate, maybe give the code so I can cnp it and then edit it, that would be great.

Ty
08-14-2006, 10:27 AM#6
The)TideHunter(
Quote:
Originally Posted by DioD
Enum group in 1000 range count units if > 0 there is units if 0 no units turn neutral.

Its not a trigger, its jass functions based only

It dosent Enum units.
The trigger runs when a unit comes in range of 1000.
If the unit is already their, then it wont pick it up.
Its when a unit comes in range of 1000, not any less or any more.
If you blinked into the area, it wouldent trigger (so i persume).
08-19-2006, 10:57 PM#7
WTFish
Im still not sure exactly how to do the trigger, if someone can give it in [trigger] tags that would be nice.

ty.
08-20-2006, 01:34 AM#8
Ignitedstar
No proper answers for this one either?

It took me awhile to figure this out, so use it and be happy!

What you want uses two triggers: One that fires when you-the player comes close to it and another that fires when the creeps(Neutral Hostile in this case) comes close to it.

My trigger uses a Moon Well, so it should work the same with your Well, too.

FIRST TRIGGER:

Trigger:
Well To Red
Collapse Events
Unit - A unit comes within 1000.00 of Moon Well 0000 <gen>
Collapse Conditions
((Triggering unit) is owned by Player 1 (Red)) Equal to True
(Moon Well 0000 <gen> is owned by Neutral Passive) Equal to True
Notes: These conditions makes sure that the trigger doesn't spam itself to death.
Collapse Actions
Set EnemiesInRange = (Number of units in (Units within 1000.00 of (Position of Moon Well 0000 <gen>) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True))))
--------- It turns out that dead corpses DO COUNT towards the EnemiesInRange. -_- ---------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
EnemiesInRange Equal to 0
Collapse Then - Actions
Unit - Change ownership of Moon Well 0000 <gen> to Player 1 (Red) and Change color
Cinematic - Ping minimap for Player Group - Player 1 (Red) at (Position of Moon Well 0000 <gen>) for 1.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
Game - Display to Player Group - Player 1 (Red) the text: You have gained control of the Moon Well
Sound - Play Rescue <gen>
Collapse Else - Actions
Do nothing
----------- The Ping and the the text is mostly proof that this trigger did trigger ----------


SECOND TRIGGER:

Trigger:
Collapse Well To Enemy
Collapse Events
Unit - A unit comes within 1000.00 of Moon Well 0000 <gen>
Collapse Conditions
((Triggering unit) is owned by Neutral Hostile) Equal to True
(Moon Well 0000 <gen> is owned by Player 1 (Red)) Equal to True
Notes: These conditions makes sure that the trigger doesn't spam itself to death.
Collapse Actions
Set EnemiesInRange = (Number of units in (Units within 1000.00 of (Position of Moon Well 0000 <gen>) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True))))
------------- It turns out that dead corpses DO COUNT towards the EnemiesInRange. -_- -----------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
EnemiesInRange Greater than or equal to 1
Collapse Then - Actions
Unit - Change ownership of Moon Well 0000 <gen> to Neutral Passive and Change color
Cinematic - Ping minimap for Player Group - Player 1 (Red) at (Position of Moon Well 0000 <gen>) for 1.00 seconds, using a Warning ping of color (100.00%, 0.00%, 0.00%)
Game - Display to Player Group - Player 1 (Red) the text: You have lost contr...
Sound - Play CreepAggroWhat1 <gen>
Collapse Else - Actions
Do nothing
----------- The Ping and the the text is mostly proof that this trigger did trigger ----------

You know what? I might as well use this myself. Yay!

Oh, there's one thing that I think I couldn't do anything about. If your in the 1000 radius and you kill the creep in it, you won't get the Well unless you go out of radius and then come back in.
08-21-2006, 02:14 AM#9
colderduck
what was wrong with your (ignitedstar) trigger is that u used matching unit instead of picked unit

also, in the second trigger, setting the EnemiesInRange variable isn't necesary becuase if an enemy came 1000 near the moonwell, obviously there is going to be more than 1 enemy unit

and if the creep dies within the radius, u can use this trigger to give you back the moonwell

Trigger:
Collapse Event
Unit - A Unit Dies
Collapse Conditions
((Owner of (Triggering unit)) is an enemy of Player 1 (Red)) Equal to True
(Distance between (Position of Moonwell 0000) and (Position of (Triggering Unit))) Less than 1000.00
Collapse Actions
Set EnemiesInRange = (Number of units in (Units within 1000.00 of (Position of Moonwell 0000 <gen>) matching ((((Picked unit) is alive) equal to true) and (((Owner of (Picked unit)) is an enemy of Player 1 (Red) Equal to true))))
Set AlliesInRange = (Number of units in (Units within 1000.00 of (Position of Moonwell 0000 <gen> matching ((((Picked unit) is aliave) equal to true) and (((Owner of (Picked unit)) is an ally of Player 1 (Red) Equal to true))))
Collapse If (All conditions are True) then do (Then Actions) Else do (Else actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
EnemiesInRange Equal to 0
AlliesInRange Greater than 0
Collapse Then - Actions
Unit - Change ownership of Moonwell 0000 <gen> to Player 1 (Red) and change color
Collapse Else - Actions
Do Nothing

you can add sounds and text if you want like how IgnitedStar did