Limit Training Trigger Help

Leo

New Member
Reaction score
14
Hey,

So the following trigger is supposed to limit the training of a unit type for all players, yet in game I can still build an unlimited number of the unit, any idea why its not working?

HTML:
function Trig_test_Func002002 takes nothing returns nothing
    call SetPlayerTechMaxAllowedSwap( 'h01C', 2, GetEnumPlayer() )
endfunction

function Trig_test_Actions takes nothing returns nothing
    set udg_tempgroup = GetPlayersAll()
    call ForForce( udg_tempgroup, function Trig_test_Func002002 )
    call DestroyForce( udg_tempgroup )
endfunction

//===========================================================================
function InitTrig_test takes nothing returns nothing
    set gg_trg_test = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_test, 5 )
    call TriggerAddAction( gg_trg_test, function Trig_test_Actions )
endfunction
 
D

Down

Guest
Can you show me what the trigger looks like in non-custom text

However it looks like your trigger as no Event but your using a event Resond For the player your trying to set it to? i cant read custom text but i tryed looksing a a trigger written that way and it seems to be
 

Leo

New Member
Reaction score
14
here it is

Code:
test2
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Set tempgroup = (All players)
        Player Group - Pick every player in tempgroup and do (Player - Limit training of Dwarves to 2 for (Picked player))
        Custom script:   call DestroyForce( udg_tempgroup )
 
D

Down

Guest
Your gonna want to do this

Player Group - Pick every player in all Players and do (Player - Limit training of Dwarves to 2 for (Picked player))
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top