- Joined
- May 1, 2008
- Messages
- 1,605
Moin moin =)
Ok longer time ago that I start a topic but I don't get it. I want make somehow a sliding system. I just try something but I always get 4 errors:
Undeclared Variable x1
Undeclared Variable y1
Undeclared Variable x2
Undeclared Variable y2
It's the first time that I try to deal with "ForGroup" and "GroupEnumUnits" ... so I bet there will be other mistakes, but the important one is now, why I get these 4 errors???
Greetings
~ The Bomb King > Dr. Boom
Ok longer time ago that I start a topic but I don't get it. I want make somehow a sliding system. I just try something but I always get 4 errors:
Undeclared Variable x1
Undeclared Variable y1
Undeclared Variable x2
Undeclared Variable y2
JASS:
function Trig_Slide1_Con takes nothing returns boolean
return (GetUnitTypeId(GetFilterUnit()) == 'h000') and (GetTerrainType(x1, y1) == 'Idki')
endfunction
function Trig_Slide1_Act takes nothing returns nothing
call SetUnitPositionLoc(GetEnumUnit(), Location(x2, y2))
endfunction
function Trig_Slide1_Actions takes nothing returns nothing
local real x1 = GetLocationX(GetUnitLoc(GetEnumUnit()))
local real y1 = GetLocationY(GetUnitLoc(GetEnumUnit()))
local real x2 = GetLocationX(GetUnitLoc(GetEnumUnit())) + 9.00 * Cos(GetUnitFacing(GetEnumUnit()))
local real y2 = GetLocationY(GetUnitLoc(GetEnumUnit())) + 9.00 * Sin(GetUnitFacing(GetEnumUnit()))
local group g = CreateGroup()
call GroupEnumUnitsInRect(g, gg_rct_Map, Filter(function Trig_Slide1_Con))
call ForGroup(g, function Trig_Slide1_Act)
set x1 = 0
set x2 = 0
set y1 = 0
set y2 = 0
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Slide1 takes nothing returns nothing
set gg_trg_Slide1 = CreateTrigger( )
call TriggerRegisterTimerEvent(gg_trg_Slide1, 0.03, true)
call TriggerAddAction( gg_trg_Slide1, function Trig_Slide1_Actions )
endfunction
It's the first time that I try to deal with "ForGroup" and "GroupEnumUnits" ... so I bet there will be other mistakes, but the important one is now, why I get these 4 errors???
Greetings
~ The Bomb King > Dr. Boom