• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Removing effects/dummies

Status
Not open for further replies.
Level 7
Joined
Dec 28, 2009
Messages
257
Heya folks, another question of mine :D

The question: What is the best way to delete(remove) spell effects or dummies created by trigger, when using some spell etc?

PS: I tend to write EVERYTHING in very long messages, even petty questions... hope its not too long to read :D

Some talk:
Lets say i have spell like Holy Light, but when i cast it trigger creates some hardly-visible unit (i think thats what you call a Dummy?), gives it my custom spell to increase attack speed based on Bloodlust, uses it on original target and then dissapears. + It does some special effect like "ressurection-target" on target via trigger too (i'd put this art to spell instead, but lets say i do it via trigger).

So something like:
Event - unit begins casting spell
blah blah Holy Light
Action: Create 1 albatross for (owner of casting unit) at position of (target)
Add "Bloodlust(custom) to Last created unit
order Last created unit to Orc Shammy - bloodlust original Target
Create special effect "Ressurection - target" at Target


And now i should add something like

/Wait 0,5 seconds*
/remove last created unit from game
/remove last created effect from game**

*if i removed it instantly, it might not finish casting spell (happens), and effect might not be even seen
**I might only think it but spell effect doesnt simply dissapear after it uses main animation, it stays there, invisible as rogue..

As far as i know. But afaik, this way to do it might suck. I dont like using /Wait action in such triggers, im afraid it might cause some havoc, but i have to delete those "dummies" somehow (or ill give that dummy 5 hp and HP regen -1 per second so it dies anyway?).

So again question, in spells like this, or any trigger that creates special effect or some dummy to cast another spell, what is the best way to get rid of that unit/effect? To avoid leaks, or ending up with 30dummies from using this spell? My simple one with /Wait and then /remove is fine, or id have to go for something complex?

And please, no Jass or post some Jass with instructions, im useless at that, or something simple and 99,9+% working, and not longer than 5 trigger lines :D

Thanks for help, hope you understood what i meant and you dont laugh at the way i do some spells, im noob! :D
 
Level 25
Joined
Sep 26, 2009
Messages
2,387
#1 "Event - unit begins casting spell"
Don't use this for triggered spells. This event "a unit begins casting an ability" fires before mana is taken from the caster and before cooldown starts. It is like this:
Spell is clicked => [unit begins casting an ability] => cast point (set differently per unit; it is Art- Cast Point in object editor of that unit) => now cooldown starts, mana is used => unit starts the effect of the ability

The event you used is mostly used to check if it is correct target (for example this way you can make it so the spell can be used on undead only by checking if the unit is undead or not; if not, you stop the spell and no cooldown/mana will be taken)

Conclusion - use "Unit starts the effect of ability" instead.


#2 Dummy unit
Dummy unit can be either
- casting dummy unit (this is a unit that has no model set, no shadow, no attack, has locust ability, has "fly" movement type)
- effect dummy unit - same as "casting dummy unit" but this one has a model of the effect you want to use.

Casting dummy - uses spells - like your modified bloodlust
Effect dummy - used for effects that you want to modify; else you use Special effect action.


#3 Removing dummy
- you set their duration - a timed life. That way those dummies will die after timer runs out.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
it would be easier if u post ur triggers. as for removing dummies after u create them set an expiration timer for them.

to get rid of an effect u would just do it when that spell instance ends. so u need to make the spell MUI. my tutorial Things a GUIer Should Know has a chapter called how to index it will help u in creating the spell. in the de-index part in my tutorial u will put the destroy effect.

a spell will take a lot more than 5 lines. u should learn some more things about GUI my tutorial will help u a lot with that.
 
Level 7
Joined
Dec 28, 2009
Messages
257
#1 "Event - unit begins casting spell"
Don't use this for triggered spells. This event "a unit begins casting an ability" fires before mana is taken from the caster and before cooldown starts. It is like this:
Spell is clicked => [unit begins casting an ability] => cast point (set differently per unit; it is Art- Cast Point in object editor of that unit) => now cooldown starts, mana is used => unit starts the effect of the ability

The event you used is mostly used to check if it is correct target (for example this way you can make it so the spell can be used on undead only by checking if the unit is undead or not; if not, you stop the spell and no cooldown/mana will be taken)

Conclusion - use "Unit starts the effect of ability" instead.


#2 Dummy unit
Dummy unit can be either
- casting dummy unit (this is a unit that has no model set, no shadow, no attack, has locust ability, has "fly" movement type)
- effect dummy unit - same as "casting dummy unit" but this one has a model of the effect you want to use.

Casting dummy - uses spells - like your modified bloodlust
Effect dummy - used for effects that you want to modify; else you use Special effect action.


#3 Removing dummy
- you set their duration - a timed life. That way those dummies will die after timer runs out.

-Yeh, im familiar with that difference between "Unit starts the effect of ability" and "Unit begins casting" and similar events, i just wrote it hastily coz i was too lazy to write it all, and the main point was in that /Wait and /remove stuff :D
-Mkay, thanks, ill stick to Expiration Timer :D

it would be easier if u post ur triggers. as for removing dummies after u create them set an expiration timer for them.

to get rid of an effect u would just do it when that spell instance ends. so u need to make the spell MUI. my tutorial Things a GUIer Should Know has a chapter called how to index it will help u in creating the spell. in the de-index part in my tutorial u will put the destroy effect.

a spell will take a lot more than 5 lines. u should learn some more things about GUI my tutorial will help u a lot with that.

Err i guess im blind, ive read it, seems like nice tutorial, but what de-index part? I didnt find it, could you just write what command should i use after i use trigger to use mostly any effect from Thunderclap to Ressurection? :D (alas, there is no "timed life" thing for spell effects, so i really wonder about solving it :D)
 
Status
Not open for further replies.
Top