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

[vJASS] Some simple trouble with polar positioning

Status
Not open for further replies.
Level 4
Joined
Nov 7, 2009
Messages
83
JASS:
        local unit target = GetSpellTargetUnit()
        local unit caster = GetTriggerUnit()
        local integer level = GetUnitAbilityLevel(caster, SPELL_ID)
        local location dummy_right_pos = PolarProjectionBJ(GetUnitLoc(caster),100,-45)
        local real dummy_right_face = AngleBetweenPoints(GetUnitLoc(caster),dummy_right_pos)
        local unit dummy = CreateUnitAtLoc(GetOwningPlayer(caster),DUMMY_ID,dummy_right_pos,dummy_right_face)

I'm having trouble and I'm not sure if it is that I am writing something wrong on the code, if I am making a mistake on maths or if it is something else.

The code is actually quite simple, it's supposed to create a unit for some spell at a certain polar offseted distance from the caster and facing towards the caster, but I sometimes get the unit in the right place, sometimes not and it's always facing 0 degrees.
 
Status
Not open for further replies.
Top