Hello, I'm currently in the process of rewriting my old project from GUI to JASS (and learning it) and as in the title, the simple script doesn't create the unit. I have no idea what could be wrong, even after stripping the code to this simple form. Any guidelines appreciated.
JASS:
function Trig_Initial_units_Func001001001 takes nothing returns boolean
return GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER
endfunction
function Trig_Initial_units_Func001A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'hkni', GetEnumPlayer(), OffsetLocation(GetPlayerStartLocationLoc(GetEnumPlayer()), 0, 0.00), 270.00 )
endfunction
function Trig_Initial_units_Actions takes nothing returns boolean
call ForForce( GetPlayersMatching(Condition(function Trig_Initial_units_Func001001001)), function Trig_Initial_units_Func001A )
return true
endfunction
//===========================================================================
function InitTrig_Units takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerAddCondition( t, function Trig_Initial_units_Actions )
set t = null
endfunction