globals
trackable array udg_trackables
location array udg_trackablepoints
trigger udg_MouseTrig
real udg_X
real udg_Y
integer udg_trackablenum
endglobals
fuction Trig_MouseTriggerActions takes nothing returns nothing
local integer int = 1
loop
exitwhen int == trackablenum
if GetTriggeringTrackable() == udg_trackables[int] then
set udg_X = GetLocationX(udg_trackablepoints[int])
set udg_Y = GetLocationY(udg_trackablepoints[int])
endif
set int = int + 1
endloop
endfunction
function InitTrig_MouseTrigger takes nothing returns nothing
set udg_MouseTrig = CreateTrigger()
local group trackableus GroupEnumUnitsOfPlayer(CreateGroup(), Player(PLAYER_NEUTRAL_PASSIVE), true)
loop
local integer int 1
local unit first FirstOfGroup(trackableus)
exitwhen unit == "null"
//(haven't put model here yet)
set udg_trackables[int] = CreateTrackable("", GetLocationX(GetUnitLoc(first)), GetLocationX(GetUnitLoc(first)), GetRandomInt(0, 360))
set udg_trackablepoints[int] = GetUnitLoc(first)
call GroupRemoveUnit(trackableus, first)
call RemoveUnit(first)
call TriggerRegisterTrackableTrackEvent(udg_MouseTrig, udg_trackables[int])
set int = int + 1
endloop
set trackablenum = int
set int = "null
set first = "null"
call TriggerAddAction(udg_MouseTrig, function Trig_MouseTriggerActions)
endfunction
globals
trackable array udg_trackables
location array udg_trackablepoints
trigger udg_MouseTrig
real udg_X
real udg_Y
integer udg_trackablenum
endglobals
fuction Trig_MouseTriggerActions takes nothing returns nothing
local integer int = 1
loop
exitwhen int == trackablenum
if GetTriggeringTrackable() == udg_trackables[int] then
set udg_X = GetLocationX(udg_trackablepoints[int])
set udg_Y = GetLocationY(udg_trackablepoints[int])
endif
set int = int + 1
endloop
endfunction
function InitTrig_MouseTrigger takes nothing returns nothing
set udg_MouseTrig = CreateTrigger()
local group trackableus GroupEnumUnitsOfPlayer(CreateGroup(), Player(PLAYER_NEUTRAL_PASSIVE), true)
local integer int 1
loop
local unit first FirstOfGroup(trackableus)
exitwhen unit == null
set udg_trackables[int] = CreateTrackable("", GetLocationX(GetUnitLoc(first)), GetLocationX(GetUnitLoc(first)), GetRandomInt(0, 360))
set udg_trackablepoints[int] = GetUnitLoc(first)
call GroupRemoveUnit(trackableus, first)
call RemoveUnit(first)
call TriggerRegisterTrackableTrackEvent(udg_MouseTrig, udg_trackables[int])
set int = int + 1
endloop
set trackablenum = int
set int = null
set first = null
call TriggerAddAction(udg_MouseTrig, function Trig_MouseTriggerActions)
endfunction
local group trackableus = GroupEnumUnitsOfPlayer(CreateGroup(), Player(PLAYER_NEUTRAL_PASSIVE), true)
globals //Expected end of line
trackable array udg_trackables //Expected end of line
location array udg_trackablepoints //Expected end of line
trigger udg_MouseTrig //Expected end of line
real udg_X //Expected end of line
real udg_Y //Expected end of line
integer udg_trackablenum //Expected end of line
endglobals
function Trig_MouseTriggerActions takes nothing returns nothing
local integer int = 1
loop
exitwhen int == udg_trackablenum //Expected a name
if GetTriggeringTrackable() == udg_trackables[int] then //Expected a name
set udg_X = GetLocationX(udg_trackablepoints[int]) //Expected a variable name
set udg_Y = GetLocationY(udg_trackablepoints[int]) //Expected a variable name
endif //Expected 'endloop'
set int = int + 1
endloop
endfunction
function InitTrig_MouseTrigger takes nothing returns nothing
local group trackableus = GroupEnumUnitsOfPlayer(CreateGroup(), Player(PLAYER_NEUTRAL_PASSIVE), true) //Invalid argument type (boolean), Expected ')' (boolean)
local integer int = 1
set udg_MouseTrig = CreateTrigger() //Expected a variable name (boolean), Expected a code statement (boolean)
local unit first
loop
set first = FirstOfGroup(trackableus) //Expected a variable name (boolean)
exitwhen first == null //Expected a name (boolean)
set udg_trackables[int] = CreateTrackable("", GetLocationX(GetUnitLoc(first)), GetLocationX(GetUnitLoc(first)), GetRandomInt(0, 360)) //Expected a variable name (boolean)
set udg_trackablepoints[int] = GetUnitLoc(first) //Expected a variable name (boolean)
call GroupRemoveUnit(trackableus, first) //Expected a name (boolean)
call RemoveUnit(first) //Expected a name (boolean)
call TriggerRegisterTrackableTrackEvent(udg_MouseTrig, udg_trackables[int]) //Expected a name (boolean)
set int = int + 1 //Expected a variable name (boolean)
endloop
set udg_trackablenum = int //Expected a variable name (boolean)
call TriggerAddAction(udg_MouseTrig, function Trig_MouseTriggerActions) //Expected a name (boolean)
endfunction
// And forever afterwards it says "Expected 'endloop' (boolean)"
local integer int = 1
set udg_MouseTrig = CreateTrigger() //Expected a variable name (boolean), Expected a code statement (boolean)
local unit first
loop
...
tags instead of PHP ones. It doesnt matter that much though
local group trackableus = GroupEnumUnitsOfPlayer(CreateGroup(), Player(PLAYER_NEUTRAL_PASSIVE), true)
OK, got Newgen, now it just says errors on this line: Can't convert boolean to boolexpr, and can't convert nothing to group.
JASS:local group trackableus = GroupEnumUnitsOfPlayer(CreateGroup(), Player(PLAYER_NEUTRAL_PASSIVE), true)
local group trackableus = GroupEnumUnitsOfPlayer(CreateGroup(), Player(PLAYER_NEUTRAL_PASSIVE), true)
function AntiLeak_True takes nothing returns boolean
return true
endfunction
GroupEnumUnitsOfPlayer
function takes some parameters but doesnt return any.local group trackableus = CreateGroup()
call GroupEnumUnitsOfPlayer(trackableus, Player(PLAYER_NEUTRAL_PASSIVE), Filter(function AntiLeak_True))