• 🏆 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!

[Trigger] Point with Polar Offset

Status
Not open for further replies.
Level 4
Joined
Apr 3, 2012
Messages
31
I'm currently making a "boomerang" ability, which is simply a shockwave that returns to
the location of the caster. This is achieved by spawning a dummy unit with an identical ability with a .75 second cast timer.

Now, I'm having problems with defining the point that the unit should spawn. Since it should spawn at the max range of the shockwave ability, I can't use Target point of ability being cast. Based on some other questions I found online, the following should work:

  • Boomerang
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Boomerang
    • Actions
      • Set aa_TempUnit = (Casting Unit)
      • Set aa_TempPoint = (Position of aa_TempUnit)
      • Set aa_TempPoint2 = (aa_TempPoint offset by 1000.00 towards (Angle from aa_TempPoint to aa_TempPoint2) degrees)
      • Unit - Create 1 Dummy for (Owner of aa_TempUnit) at aa_TempPoint2 facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Boomerang (Dummy) to (Last created unit)
      • Unit - Set level of Boomerang (Dummy) for (Last created unit) to (Level of Boomerang for aa_TempUnit
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm aa_TempPoint
      • Custom script: call RemoveLocation(udg_aa_TempPoint)
      • Custom script: call RemoveLocation(udg_aa_TempPoint2)
However, this seems to always set the aa_TempPoint2 to the direct left of the casting unit (180 degree facing angle).
I also tried basing the point on the facing angle of the casting unit:

  • Set aa_TempPoint2 = (aa_TempPoint offset by 1000.00 towards (Facing of aa_TempUnit) degrees)
This action works for the most part, but targeting the ability behind the caster will cause the dummy unit to spawn only halfway through the turning animation, even if the unit has a turn rating of 3.00. (So the dummy spawns roughly 90 degrees from where the initial ability was targeted.)

Does anyone know how I should trigger this to make it work properly?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Edit// Before anyone reads what i've written: Is this supposed to be shooting boomerang in front of the hero or where the ability is cast-ed at ? Depending on teh answer, the bellow in teh spoiler may not be correct entirely.

aa_TempPoint2 here
(aa_TempPoint offset by 1000.00 towards (Angle from aa_TempPoint to aa_TempPoint2) degrees)
Should be "Target Point of ability being cast"

So, you need another temp point.

Also, this
Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm aa_TempPoint
Should be temppoint2

Something of the sort.

Edit// Spamming dummy units is not a particularly good idea. I am not much in-depth with the game engine, but the people who are will tell you that every unit is a leak.
I'd rather suggest making a single dummy unit and moving it with another trigger with event firing every 0.03 sek which moves the dummy and deals damage around it.

Edit 2// You've also mentioned "Shockwave?" If this is the Tauren Chieftain ability, better switch it around as it spams terrain deformations, which also leak as I am aware, and you can not remove those properly.
 
Last edited:
Level 22
Joined
Aug 27, 2013
Messages
3,973
However, this seems to always set the aa_TempPoint2 to the direct left of the casting unit (180 degree facing angle).
I also tried basing the point on the facing angle of the casting unit:
Because TempPoint2 is still empty at this point. Take look at this part "(Angle from aa_TempPoint to aa_TempPoint2)" the game is confused how to find TempPoint2. Thus finding the right angle is impossible.

It should be:
TempPoint = Position of Caster
TempPoint2 = Target Point of Ability Being Cast
TempPoint3 = TempPoint with offset 1000 facing angle from TempPoint to TempPoint2

don't forget to remove leaks. And keep in mind what @nedio95 said about too many dummy units & shockwave problem.
I'd suggest to use Crushing Wave or Carrion Swarm in replacement of Shockwave.

Edit: Also change your dummy unit's "Art - Animation - Cast Backswing" and "Art - Animation - Cast Point" to 0. It'll help the dummy to cast spell instantly.
 
Level 4
Joined
Apr 3, 2012
Messages
31
Hi, thanks for the replies.

I actually had set it up as you both mention beforehand, but seem to have gotten my triggers mixed up when I posted this. I'm pretty sure I had it the same way as you mentioned at one point though.
Regardless, I rewrote the trigger from the top, and it worked, so I guess I had just missed something when I did it the first time around.

I'm already using Carrion Swarm, and already have cast point and backswing set to 0.



As a follow-up question, you mention using a single dummy unit to prevent leaks. Instead of moving the unit with a trigger, would it make sense to keep the current trigger, and just have a single dummy placed on the map beforehand, and use that unit to cast the current dummy spell every time the ability is cast? (It doesn't need to be MUI).
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
As a follow-up question, you mention using a single dummy unit to prevent leaks. Instead of moving the unit with a trigger, would it make sense to keep the current trigger, and just have a single dummy placed on the map beforehand, and use that unit to cast the current dummy spell every time the ability is cast? (It doesn't need to be MUI).

I am not entirely sure I am following?
You'd have a unit in the corner of the map that would cast the spell? I don't see how this works in this case.
Or you'd have one dummy unit that would cast the spell to spam the dummy units ? This is the initial problem
Or do you mean the pre-places unit is issued a move-to-point-target-of-spell ? This may work, but you'll have to be aware of path-ing issues...

Or you meant something else?
 
Level 4
Joined
Apr 3, 2012
Messages
31
I meant having a dummy unit in the corner of the map, which got moved every time the spell was cast, rather than spawn a new dummy unit every time. Since spawning new units evidently leak, I thought it would be better to just use the same dummy every time?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
If only a single unit can cast the ability, it could work.

Although, I am not entirely sure if having an active unit 100% of the time is better than having a dummy for a few sec and then cleaning it... Somebody else would have to pitch in.
 
Level 13
Joined
Jul 15, 2007
Messages
763
If only a single unit can cast the ability, it could work.

Although, I am not entirely sure if having an active unit 100% of the time is better than having a dummy for a few sec and then cleaning it... Somebody else would have to pitch in.

Using a dummy that lasts all game and for multiple effects/spells is a lot more efficient than creating a dummy unit when you cast a spell. A unit permanently leaks even after it is correctly removed from the game, meaning if your game generates a lot of dummy units per minute, you can run into problems.

A spell based on Carrion Swarm is OK for a master dummy. Just know if you are interested in knowing 'who did what damage' (e.g. an in-game DPS meter) having a singular dummy for this is bad as Carrion Swarm is a line-projectile spell with travel time meaning your dummy could be manipulated/changed ownership whilst an instance of the spell is already in motion.

E.g. Dummy casts Carrion Swarm A, then immediately afterwards it casts Carrion Swarm B (from a different player), it is likely the player who triggered Carrion Swarm B also gets credit for Carrion Swarm A damage.

Generally master dummies are best for non-damaging effects (i.e. slows, stuns, cripples, curses, sleeps, faerie fire, cyclones, inner fires, bla bla bla). You should consider staying with using a temp dummy for Carrion Swarm.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You simply use a seperate dummy caster for each player, no need rocket science.
 
Status
Not open for further replies.
Top