- Joined
- Mar 13, 2013
- Messages
- 299
I see the trigger action of removing a buff, but don't see one for adding a buff? Am I missing something, or is there some other way?
You need to understand the difference between buff and ability.You can add a buff using a passive ability ( spell ) , just use Unit - Add Ability To Unit
Could you provide a testmap please. Thank you.You can add a buff using a passive ability ( spell ) , just use Unit - Add Ability To Unit
You can add a buff using a passive ability ( spell ) , just use Unit - Add Ability To Unit
No you can't cast buff/debuff.
You can only (force) cast an ability which applies a (de)buff.
Meaning you can't just apply Inner Fire buff on your unit via other unit.
But you can order other unit to cast Inner Fire spell which automatically applies Inner Fire buff on the unit.
what kind of 'care'? I'm guessing simply creating a unit, casting the spell, and then removing the unit isn't careful enough?In WC3 sadly you need to use either dummy abilities with buffs (like an aura) inside a hidden spell book or use a dummy unit to cast a dummy ability which gives the buff. Both will need non-trivial triggering and in GUI when using the dummy unit approach care must be taken to minimize leaks.
There are a few points to be careful with.I'm guessing simply creating a unit, casting the spell, and then removing the unit isn't careful enough?
There are a few points to be careful with.
1. The position of the dummy unit in GUI will need to be a location. This can leak unless the location object is removed.
2. Creating the dummy unit itself is not simple. It needs to be locust with no collision so as not to influence the game beyond casting the dummy ability. 0 animation delay is a must for responsive and immediate casting.
3. Where the dummy unit is created is also difficult. Creating it under an existing unit results in a massive performance penalty due to displacement.
4. Removing dummies may or may not be completely leak free. Mostly this can be ignored however if poorly written damage detection systems are present or if a lot of dummy units are being used it may be best to recycle the dummy units (place them in the corner of the map, and move them nearby as you need them).
5. Some dummy abilities cannot be cast in GUI as no order string exists for them. Most notable is "Wand of Illusion" item ability which makes a mirror image of the target unit, something people commonly use. You will need to use a JASS call to issue the order directly as an order ID integer.
6. Care must be taken with dummy units to avoid them interacting with other triggers unintentionally. Although dummy units with locust are ignored from area search results they will still show up as player unit results. The best example would be a player leaving in the middle of casting an ability involving dummies where on leave all his units get removed, this could potentially remove his dummy units in the middle of an ability cast (eg if the dummies are for graphics) which could cause catastrophic errors to occur.
7. Dummy units usually do not exist on map load. As such their data is not loaded and cached resulting in poor performance when they are first initially created (the game will drop many frames while they get loaded). As such you either need to pre-place an example of the dummy or create one at map initialization. You cannot create them after map initialization as this will result in poor in-game performance when ever they are created (potentially even calling up the "waiting for player" dialog as a result).
Yeh so dummy units are not easy in WC3.
how does one make the animation delay zero? I can't seem to find it.