• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

A little question about waits

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
Ok, so lets just say I have a Jass trigger in which I need to wait a specific amount of time before the actions may be executed.

To be more specific:

I have an ability which casts a projectile towards a target, however since the target is removed during the effect of the ability the projectile doesn't move towards the target.
This is why I need to wait a specified amount of time untill the target is being hit by the projectile before I remove it.
(Of course I'll calculate how long the projectile travels towards the target to get a accurate time to wait before removing the target)

Is it okay in this case to use TriggerSleepAction even though it is inaccurate?
Or should I use a timer?
If I do need a timer, how do I make the trigger stop executing actions untill the timer is expired?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
True, a projectile system could solve my problem. But my actual question is:
If a TriggerSleepAction is called before any other functions inside a trigger, is it still inaccurate? Why?
And b.t.w. for what I'm trying to do it doesn't seem that inaccurate to me :S

Either ways, +rep to the both of you!

EDIT: can't rep you yet Adiktuz

Also, could you explain what you mean with timer loops? Give a example perhaps?
It would be much less work not having to use a projectile system.
 
Last edited:
If that projectile adds a buff, you can use a timer loop which checks if the unit has the buff ...

So you add the target to a unit group then make a trigger that runs every .xx seconds which then loops thru all the units in the group, if it has the buff, do the things that should be done...

You would need to save somehow the caster too, and maybe use a counter too [which will check how many times the unit has been targeted] in case that more than one unit can cast that spell...
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
If that projectile adds a buff, you can use a timer loop which checks if the unit has the buff ...

So you add the target to a unit group then make a trigger that runs every .xx seconds which then loops thru all the units in the group, if it has the buff, do the things that should be done...

You would need to save somehow the caster too, and maybe use a counter too [which will check how many times the unit has been targeted] in case that more than one unit can cast that spell...

Wow, I didn't think of using buffs!
This is a great idea and will probably help me achieve what I need.
I thank you sincerely!
 
Status
Not open for further replies.
Top