HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help about trigger (enemy pass the gate)

12-07-2008, 04:01 PM#1
ronaldo
I have some problems to make this: When the gate is destroyed, and if enemy pass through it, the game end.
I have trigers like this:

first to check if gate dies:
Collapse JASS:
function Trig_gate_die_Copy_Actions takes nothing returns nothing
    call QuestMessageBJ( GetPlayersAll(), bj_QUESTMESSAGE_UPDATED, "TRIGSTR_3470" )
    call PolledWait( 12.00 )
    call TriggerExecute( gg_trg_Attack_Point_Counter )
endfunction

//===========================================================================
function InitTrig_gate_die_Copy takes nothing returns nothing
    set gg_trg_gate_die_Copy = CreateTrigger(  )
    call TriggerRegisterDeathEvent( gg_trg_gate_die_Copy, gg_dest_LTg2_0000 )
    call TriggerAddAction( gg_trg_gate_die_Copy, function Trig_gate_die_Copy_Actions )
endfunction

Second is run when the gate got destroyed, but the game ends in few seconds after that no matter if enemy unit passed through it.
Collapse JASS:
function Trig_Attack_Point_Counter_Copy_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Attack_Point_Counter_Copy_Actions takes nothing returns nothing
    set udg_unitsletthrough = ( udg_unitsletthrough + 1 )
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_3469" )
    call FogEnableOff(  )
    call PanCameraToTimedLocForPlayer( Player(0), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(1), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(2), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(3), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(4), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(5), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(6), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(7), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(8), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(9), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(10), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call PanCameraToTimedLocForPlayer( Player(11), GetRectCenter(gg_rct_Past_Gate), 5.00 )
    call TriggerSleepAction( 21.00 )
    call ConditionalTriggerExecute( gg_trg_Attack_Point_Check )
endfunction

//===========================================================================
function InitTrig_Attack_Point_Counter_Copy takes nothing returns nothing
    set gg_trg_Attack_Point_Counter_Copy = CreateTrigger(  )
    call DisableTrigger( gg_trg_Attack_Point_Counter_Copy )
    call TriggerRegisterEnterRectSimple( gg_trg_Attack_Point_Counter_Copy, gg_rct_Past_Gate )
    call TriggerAddCondition( gg_trg_Attack_Point_Counter_Copy, Condition( function Trig_Attack_Point_Counter_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Attack_Point_Counter_Copy, function Trig_Attack_Point_Counter_Copy_Actions )
endfunction


Can someone help me ?
Thanks.
12-07-2008, 04:50 PM#2
Kwah
Just put a region close to the other side of the gate.
12-07-2008, 05:45 PM#3
ronaldo
The region is 300 range from gate, so this is not the problem. Thanks.
12-07-2008, 06:24 PM#4
Kwah
So it works?
12-07-2008, 06:30 PM#5
ronaldo
No it dont. When enemy destroy the gate, the game ends few seconds latter no matter if they pass the gate or no.
I wannt to make it, that when they pass the gate then the game ends, but i dont know how.
12-07-2008, 06:42 PM#6
Kwah
Trigger the event off of when they enter the region BEHIND the gate.
12-07-2008, 07:40 PM#7
ronaldo
I fixed the problem it seems, the old trigger was bugged probably.
I had the event off till the gate was destroyed but the game still ended when the gate was destroyed. I now fixed it with simple trigger. Thanks for help anyway.

Now i need something else, how to create creeps at location, and that they goes till gate, without stoping, cause now, the creeps stops goes back and then forward, they do this many times till they come to the gate.

My trigger is like this:
Collapse JASS:
function Trig_levo_spodaj_Copy_2_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
        return false
    endif
    return true
endfunction

function Trig_levo_spodaj_Copy_2_Actions takes nothing returns nothing
    call IssuePointOrderLocBJ( GetTriggerUnit(), "attack", GetRectCenter(gg_rct_Region_017) )
endfunction

//===========================================================================
function InitTrig_levo_spodaj_Copy_2 takes nothing returns nothing
    set gg_trg_levo_spodaj_Copy_2 = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_levo_spodaj_Copy_2, gg_rct_Evil_Gate_Area )
    call TriggerAddCondition( gg_trg_levo_spodaj_Copy_2, Condition( function Trig_levo_spodaj_Copy_2_Conditions ) )
    call TriggerAddAction( gg_trg_levo_spodaj_Copy_2, function Trig_levo_spodaj_Copy_2_Actions )
endfunction
12-07-2008, 08:16 PM#8
Kwah
That's because of the Creep Camp range on the neutral hostile units. Change them to Player 12 Brown, or modify them in the object editor (It might be a gameplay constant too)
12-07-2008, 08:41 PM#9
ronaldo
I cannot change them to player 12, because this game is 12 players, so the enemy units are neutal hostile. I try to change some things in gameplay constants. Thanks
12-07-2008, 08:50 PM#10
Kwah
It is either a game play constant or just an attribute in the object editor on the unit.