Trigger Help

A place to talk about general WC3 and EotA related stuff.
Post Reply
Message
Author
User avatar
Gilles
Visitor
Visitor
Posts: 34
Joined: January 5th, 2007, 3:50 pm

Trigger Help

#1 Post by Gilles »

Not sure if this should go in off-topic.

How do you make summons follow their summoner? Are you using a follow command? Or more complicated, like calculate when the hero get's too far away and order it to move to the hero? I'm having trouble with my own following summon.
Summon
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Summon Water Being
Or - Any (Conditions) are true
Conditions
(Region 001 <gen> contains (Triggering unit)) Equal to True
Actions
Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at (Center of Water <gen>) facing (Position of (Triggering unit))
Unit - Add Summon Water Being (real) to (Last created unit)
Unit - Order (Last created unit) to Human Archmage - Summon Water Elemental
Set WaterBeing = (Summoned unit)
Set NaturesGuardian_Water = (Triggering unit)
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Now for the follow.
WaterBeing Move
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Unit - Order WaterBeing to Follow NaturesGuardian_Water
If you have some time Darn Yak, I'd appreciate it if you could help me out. Thanks.

User avatar
Dekar
Jelly Doughnut
Posts: 1433
Joined: May 27th, 2006, 8:13 am
Realm: Northrend (Europe)
Battle.net name: Dekar
Location: Germany

Re: Trigger Help

#2 Post by Dekar »

Try "Distance between points" with the positions of the 2 units. It should return a real.

If it is larger than 300 make it attack move to the caster, if it is larger then 800 make it move to him.

Will leak in GUI though if you dont fix it.
<EotA@Azeroth> YAKS GO MOOOOOOOOOOOOOOOOOOOOOOOO

Dekar: the ultimate ocean themed hero should buff and depend on spawn waves!
DarnYak: why is that
Dekar: WAVES
Dekar: :D
DarnYak: i was afraid that was the answer

User avatar
Gilles
Visitor
Visitor
Posts: 34
Joined: January 5th, 2007, 3:50 pm

Re: Trigger Help

#3 Post by Gilles »

Dekar wrote:Try "Distance between points" with the positions of the 2 units. It should return a real.

If it is larger than 300 make it attack move to the caster, if it is larger then 800 make it move to him.

Will leak in GUI though if you dont fix it.
Can't get it to work. Here is what I have.
I even tried moving the triggers that set the variables up to the top. Still won't work.
Summon
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Summon Water Being
Or - Any (Conditions) are true
Conditions
(Region 001 <gen> contains (Triggering unit)) Equal to True
Actions
Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at (Random point in Water <gen>) facing (Position of (Triggering unit))
Unit - Add Summon Water Being (real) to (Last created unit)
Unit - Order (Last created unit) to Human Archmage - Summon Water Elemental
Set WaterBeing = (Summoned unit)
Set NaturesGuardian_Water = (Triggering unit)
Set Range = (Distance between (Position of (Summoned unit)) and (Position of (Triggering unit)))
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
WaterBeing Move
Events
Game - Range becomes Equal to 300.00
Conditions
Actions
Unit - Order WaterBeing to Attack-Move To (Position of NaturesGuardian_Water)
WaterBeing MoveFarther
Events
Game - Range becomes Equal to 800.00
Conditions
Actions
Unit - Order WaterBeing to Move To (Position of NaturesGuardian_Water)

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: Trigger Help

#4 Post by DarnYak »

Alright, you've got the basic concept right but there's some big issues with the triggers. Ignoring memory leak issues, as those should be dealt with after the thing works.

Code: Select all

Conditions
(Ability being cast) Equal to Summon Water Being 
Or - Any (Conditions) are true
Conditions
(Region 001 <gen> contains (Triggering unit)) Equal to True
Not sure why youhave an or here, the ability being cast should be sufficient. Unless it should be an AND... I suppose that could explain some of the weirdnessi n the trigger.

Code: Select all

Unit - Order (Last created unit) to Human Archmage - Summon Water Elemental
Set WaterBeing = (Summoned unit)
Suggestion: just create the summoned unit directly with a create unit, and add a summon timer (if nessary). If there's a birth animation problem, just queue that animation up.

Problem: Summoned unit doesn't refer to anything in this trigger. Another event, "A unit spawns a summoned unit" goes off, and in that event it will refer to Summoned Unit properly.

This is the main reason you're entire trigger is being frustrating and unresponsive at the moment.

Code: Select all

Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
You could probably just remove the unit at this point, most spells go off instantly.


Dekar's suggestion is pretty correct for a nicer following unit, but you're understanding of how that works seems abit off.

Code: Select all

Events
Game - Range becomes Equal to 300.00
This might work, but I doubt it and don't like it. Not too familiar with the range trigger and how frequently it goes off. Instead what you want to do, in you're periodic 2 second timer, have an If (Distance between is > 300) then do follow, else (if distance between > 800 then do warp)

DarnYak

User avatar
Dekar
Jelly Doughnut
Posts: 1433
Joined: May 27th, 2006, 8:13 am
Realm: Northrend (Europe)
Battle.net name: Dekar
Location: Germany

Re: Trigger Help

#5 Post by Dekar »

"Game - Range becomes Equal to 300.00" O_o wtf is that?

Add a periodical event for the distance check triggers: Every 1 second

Change the distance check to xxx greater than 300/800 instead of equal to.

Merge the 2 distance checks into one trigger:


Events:
Every 1 sec
Actions:
if distance between x y > 300 then attack move
if distance between x y > 800 then move

edit: yak posted at the same time :D
<EotA@Azeroth> YAKS GO MOOOOOOOOOOOOOOOOOOOOOOOO

Dekar: the ultimate ocean themed hero should buff and depend on spawn waves!
DarnYak: why is that
Dekar: WAVES
Dekar: :D
DarnYak: i was afraid that was the answer

User avatar
Gilles
Visitor
Visitor
Posts: 34
Joined: January 5th, 2007, 3:50 pm

Re: Trigger Help

#6 Post by Gilles »

Thanks guys, I'll try and fix it up soon.

btw DarnYak, I have the "Or" condition because I was going to make multiple areas that you could spawn the unit. Now that I've thought about it, I have to just summon the unit beside the caster.

Post Reply