When the condition function "returns nothing" and employs "return", and if the function contains a function that returns a boolean value,whether it is called directly or used for judgment in an if statement,this will cause the TriggerEvaluate function to pass.
// condition
function Trig_UnnameTrigger_001Conditions takes nothing returns nothing // Note that it is "nothiing" here.
call BJDebugMsg("run condition")
// call IsPlayerAlly(Player(0),Player(0)) Replaceing the if statement with this will also cause TriggerEvaluate to pass.
if IsPlayerAlly(Player(0),Player(0)) then
endif
return
endfunction
// action
function Trig_UnnameTrigger_001Actions takes nothing returns nothing
call BJDebugMsg("run action")
endfunction
// init
function InitTrig_UnnameTrigger_001 takes nothing returns nothing
set gg_trg_UnnameTrigger_001 = CreateTrigger()
call TriggerAddCondition(gg_trg_UnnameTrigger_001, Condition(function Trig_UnnameTrigger_001Conditions))
call TriggerAddAction(gg_trg_UnnameTrigger_001, function Trig_UnnameTrigger_001Actions)
call ConditionalTriggerExecute(gg_trg_UnnameTrigger_001)
endfunction
In-game output(game version 1.27):
run condition
run action
if the condition function does not use "return" or does not use a statement that returns "boolean",the trigger action will not be excuted.
When the condition function "returns nothing" and employs "return", and if the function contains a function that returns a boolean value,whether it is called directly or used for judgment in an if statement,this will cause the TriggerEvaluate function to pass.
In-game output(game version 1.27):
run condition
run action
if the condition function does not use "return" or does not use a statement that returns "boolean",the trigger action will not be excuted.