Hi
I try to add "give 1 gold every second" and "set population to 100 after 60 seconds is elapsed" into a map.
I use the worldeditor GUI trigger editor to create the scripts and then convert it to custom text. Lastly, I copy and paste to war3map.j.
I tested the map but my additional scripts doesn't work.
Please help! Thanks.
I try to add "give 1 gold every second" and "set population to 100 after 60 seconds is elapsed" into a map.
I use the worldeditor GUI trigger editor to create the scripts and then convert it to custom text. Lastly, I copy and paste to war3map.j.
I tested the map but my additional scripts doesn't work.
scriptsfunction Trig_Give_Gold_Conditions takes nothing returns boolean
if ( not ( IsPlayerInForce(GetEnumPlayer(), GetPlayersAll()) == true ) ) then
return false
endif
return true
endfunction
function Trig_Give_Gold_Func001002 takes nothing returns nothing
call AdjustPlayerStateBJ( 1, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction
function Trig_Give_Gold_Actions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Trig_Give_Gold_Func001002 )
endfunction
//===========================================================================
function InitTrig_Give_Gold takes nothing returns nothing
set gg_trg_Give_Gold = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Give_Gold, 1.00 )
call TriggerAddCondition( gg_trg_Give_Gold, Condition( function Trig_Give_Gold_Conditions ) )
call TriggerAddAction( gg_trg_Give_Gold, function Trig_Give_Gold_Actions )
endfunction
function Trig_Food_Func001002 takes nothing returns nothing
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_FOOD_CAP, 100 )
endfunction
function Trig_Food_Actions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Trig_Food_Func001002 )
endfunction
//===========================================================================
function InitTrig_Food takes nothing returns nothing
set gg_trg_Food = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Food, 30.00 )
call TriggerAddAction( gg_trg_Food, function Trig_Food_Actions )
endfunction