Hi, I get the Error:TowerUp.count is private at the marked line and I don't have a clue why, the function is inside the scope 0o!
JASS:
scope OrcTowers initializer InitTrig_System
struct TowerUp
private unit array units [5]
private real x
private real y
private integer count
method createFinal takes nothing returns nothing
local integer index=2
loop
exitwhen index >5
call RemoveUnit(.units[index])
set index=index+1
endloop
endmethod
method createDummy takes nothing returns nothing
set .count=.count+1
set .units[.count]=CreateUnit(GetOwningPlayer(.units[1]),039;o00G039;,.x + 250. * Cos(((2-.count)*90.) * bj_DEGTORAD),.y + 250. * Sin(((2-.count)*90.) * bj_DEGTORAD),0.)
call IssueTargetOrder(.units[.count],"move",.units[1])
if .count==5 then
call UnitRemoveAbility(.units[1],039;A004039;)
call UnitAddAbility(.units[1],039;A00F039;)
endif
endmethod
static method create takes unit u returns TowerUp
local TowerUp tu =TowerUp.allocate()
set tu.units[1] =u
set tu.x=GetUnitX(u)
set tu.y=GetUnitY(u)
set tu.count=1
call SetUnitUserData(u,tu)
return tu
endmethod
endstruct
private function UpgradeTower takes nothing returns nothing
local TowerUp tu
if TowerUp(GetUnitUserData(GetTriggerUnit())) ==0 then
set tu=TowerUp.create(GetTriggerUnit())
else
set tu=TowerUp(GetUnitUserData(GetTriggerUnit()))
endif
if tu.count <5 then //here !
call tu.createDummy()
else
call tu.createFinal()
endif
endfunction
//here is only the initialization function
endscope