• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell

Status
Not open for further replies.
Level 5
Joined
Jan 6, 2005
Messages
137
Hey, i'm currently trying to make a spell using a target / stormbolt function, which then will cause a thunderclap at the target, i was thinking of making a dummy unit at the target (using check if unit has buff (buff from stormbolt) ) and then create a unit at the target having the buff. So far it works, however, when i order last created unit to cast the given thunderclap (ofc no mana cost or cast time) nothing happens, i don't quite get why, help would be apprieated, thanks :)
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
Well, how do you know that the dummy unit is even spawned? If you know this for certain you should always put a Wait - 0.1 second action between the spawn and the casting. Further more is your dummy the only thing spawned in the whole map? If it is not you should put a variable that will declare this unit as soon as it is being spawned, so instead of making an action Order last created unit to THUNDERCLAP, you use Order MYVARIABLEUNIT to THUNDERCLAP.

Perhaps you forgot to add the THUNDERCLAP to your dummy as a spell?

I am pretty sure it is one of these things that trouble you: Dummy does not spawn, dummy does not have spell, you do not have the wait 0.1 seconds action, you have more spawns and you did not declare your unit in a variable.

It should be one of those four reasons.

Hope this helps,

Kafana
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
you should always put a Wait - 0.1 second action between the spawn and the casting.

Oh really, and whats the reason for this exactly ?

Further more is your dummy the only thing spawned in the whole map? If it is not you should put a variable that will declare this unit as soon as it is being spawned, so instead of making an action Order last created unit to THUNDERCLAP, you use Order MYVARIABLEUNIT to THUNDERCLAP.

That makes no sense at all.
If you order the last created unit to do something, or you order a unit variable which is set to the last created unit, you do exactly the same thing, expect to using a useless variable.
 
you dont need to check buff of stormbolt (+ that probably wont work)

use target unit of ability being cast, or for a leakless answer, set the target to a variable that will be removed later on, and create the dummy unit, no need for wait, you can make the dummy cast the ability right after it is spawned.


(a tip for the dummy unit.. when you want it to go away, instead of using the remove last created unit action, make the dummy unit have, say, 10 life and a -20 life regen or something like that)
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
That is why you should put a small wait(dependent on the missle speed) as I suggested. Concerning the variable I was talking about you should put it because what if he has a spawn every 10 seconds several units somewhere trigger? If the units spawned there spawn at the same frame as the dummy unit it will order them to cast that spell. I might be wrong here(regarding the variable) so please correct me if I am.

And ghostwolf, please, I was only trying to help so you could stop acting all high and mighty and tell Da Inf what is really wrong. I know you are probably more expirienced then me, but even if my solution does not work it wont cause any damage except perhaps increasing the map size by a few bytes.

If I made a mistake with my solution it was not intentional and I was only trying to help, so cut me some slack.
 
Level 5
Joined
Jan 6, 2005
Messages
137
Hm, i have a problem with the waittime though, because, if you then cast the ability close to target, the thunderclap will still occour what would be the time for he missile to reach the target at max range, how do i solve this?
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
Well you go like this: The missle speed is 1000 and the range is 500. The missle speed determins the distance a missle will travel in 1 second. Since your max range is 500 your missle will reach the target in 5/10 seconds, which is 0.5 seconds.

You can easily create a linear function with the distance between your casting and unit being targeted by the ability. Then just put it in your wait.
 
Level 9
Joined
Oct 17, 2007
Messages
547
Dont use wait, i can do it fine without the wait, waits will mess up the rest of the trigger (e.i. if some other unit casts a skill within that wait period then its messed up)

Instead use the
  • Event - Unit Starts the effect of ability
  • Condition - (Ability being cast) equal to Stormbolt
  • Action - Set TempLocPoint = (Position of (Target unit of ability being cast))
  • Unit - Create 1 Dummy Caster for Owner of(Casting unit) at TempLocPoint facing Default building facing degrees
  • Unit - Order (Last Created Unit) to Human Mountain King - Thunder Clap
Give an expiration timer to a unit, to prevent filling the map up with dummy units, and make sure you destroy the temporary location.
 
Last edited:
Status
Not open for further replies.
Top