- Joined
- May 4, 2007
- Messages
- 2,260
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 ?
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 ?
JASS:
//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
loop
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
endloop