• 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.

[Spell] Spawning a unit at a certain location

Status
Not open for further replies.
Level 3
Joined
Sep 19, 2017
Messages
36
My goal is to summon a unit behind the caster and have it do a action, my only problem is that i'm not sure how to set a variable to be specifically behind the caster.
 
Level 23
Joined
Dec 4, 2007
Messages
1,559
This can be done quite easily, using the polar offset projection with a substraction of your caster's degree by 180.

You also want to check for unpathable terrain behind your caster.
 
Level 3
Joined
Sep 19, 2017
Messages
36
This can be done quite easily, using the polar offset projection with a substraction of your caster's degree by 180.

You also want to check for unpathable terrain behind your caster.
Thank you for the fast reply, how do you get to "polar offset projection"?

upload_2017-10-1_15-44-38.png


This spawns the footman to the west
 
Level 11
Joined
Jun 2, 2004
Messages
849
Position of Triggering Unit leaks a point variable on its own, and then another point variable is created for the offset.


To fix, do something like:

TempPoint = Position of Triggering Unit
TempPoint2 = (TempPoint offset by [amount] toward [angle] degrees)

Then clean up TempPoint and TempPoint2 at the end of the trigger.
 
Level 3
Joined
Sep 19, 2017
Messages
36
Position of Triggering Unit leaks a point variable on its own, and then another point variable is created for the offset.


To fix, do something like:

TempPoint = Position of Triggering Unit
TempPoint2 = (TempPoint offset by [amount] toward [angle] degrees)

Then clean up TempPoint and TempPoint2 at the end of the trigger.
OK! Cool i knew about the first one but the second one i did not. Thanks!
 
Status
Not open for further replies.
Top