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

[JASS] Making a line with units problem

Not open for further replies.
Hi guys, I am working on a spell that should create a wall of units. This units would be in a line perpendicular to the caster. However I have problems and I don't get the damn formula.
Can some one fix this for me please?
Btw, this uses vJASS, but all you need is here... can some one tell me what I am doing wrong please ?

//setting variables
            set data.caster = caster
            set data.level = level
            set data.catcher = NewTimer()
            set data.spellX = spellX
            set data.spellY = spellY
            set data.walls = CreateGroup()
            set angle = (180.0 / bj_PI) * Atan2(data.spellY - GetUnitY(data.caster), data.spellX - GetUnitX(data.caster))
            set owner = GetOwningPlayer(data.caster)
            //Create the wall, I can't find a formula to complete the wall, I can 
            //only create 1 unit, If I create more, they will mess up everything.
            //Can some one help me find a formula ?
            set i = 0
                exitwhen(i == WallNumber(data.level))
                set wall = CreateUnit(owner, WallId(data.level), data.spellX - (i * WallSize(data.level)) * Cos(angle * (bj_PI / 180.0)), data.spellY * Sin(angle * (bj_PI / 180.0)), angle)
                call GroupAddUnit(data.walls, wall)
                set i = i + 1
Not open for further replies.