- Joined
- Aug 1, 2007
- Messages
- 66
My movement system works fine as is, but I'm trying to make it more efficient. Right now I've got the whole map (it straight from top to bottom) layed out with regions like a football field and 3 triggers for movement.
Trigger 1:
Trigger 2:
Trigger 3:
The reason for the 2 longer triggers is to keep the bosses from being drug to the other side of the map, but I'm trying to fix that with locking guard positions. The main problem is the spawned units running back to the base.
Trigger 1:
JASS:
function Trig_Move_Conditions takes nothing returns boolean
if ( not MovementPrimaryConditionConditions() ) then
return false
endif
return true
endfunction
function Trig_Move_Actions takes nothing returns nothing
if ( MovementTriggeringUnitIsNonAncientKingNPC() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "attack", GetRectCenter(gg_rct_Queen_Target) )
else
endif
if ( MovementTriggeringUnitIsNonAncientQueenNPC() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "attack", GetRectCenter(gg_rct_King_Target) )
else
endif
endfunction
//===========================================================================
function InitTrig_Move takes nothing returns nothing
set gg_trg_Move = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_1 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_2 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_3 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_4 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_5 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_6 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_7 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_8 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_9 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_10 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_12 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_13 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_16 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_17 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_18 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_19 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_20 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_21 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_22 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Movd_23 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Move_24 )
call TriggerRegisterEnterRectSimple( gg_trg_Move, gg_rct_Movd_25 )
call TriggerAddCondition( gg_trg_Move, Condition( function Trig_Move_Conditions ) )
call TriggerAddAction( gg_trg_Move, function Trig_Move_Actions )
endfunction
Trigger 2:
JASS:
function MovementTriggeringUnitIsTheKing takes nothing returns boolean
return ( GetUnitTypeId(GetTriggerUnit()) == 'n000' )
endfunction
function MovementTriggeringUnitIsThePrince takes nothing returns boolean
return ( GetUnitTypeId(GetTriggerUnit()) == 'n00D' )
endfunction
function MovementTriggeringUnitIsTheDuke takes nothing returns boolean
return ( GetUnitTypeId(GetTriggerUnit()) == 'n00G' )
endfunction
function Trig_Move_11_Conditions takes nothing returns boolean
if ( not MovementPrimaryConditionConditions() ) then
return false
endif
return true
endfunction
function Trig_Move_11_Actions takes nothing returns nothing
if ( MovementTriggeringUnitIsNonAncientKingNPC() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "attack", GetRectCenter(gg_rct_Queen_Target) )
else
endif
if ( MovementTriggeringUnitIsNonAncientQueenNPC() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "attack", GetRectCenter(gg_rct_King_Target) )
else
endif
if ( MovementTriggeringUnitIsTheKing() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "move", GetRectCenter(gg_rct_The_King) )
else
endif
if ( MovementTriggeringUnitIsThePrince() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "move", GetRectCenter(gg_rct_The_Prince) )
else
endif
if ( MovementTriggeringUnitIsTheDuke() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "move", GetRectCenter(gg_rct_The_Duke) )
else
endif
endfunction
//===========================================================================
function InitTrig_Move_11 takes nothing returns nothing
set gg_trg_Move_11 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Move_11, gg_rct_Move_11 )
call TriggerRegisterEnterRectSimple( gg_trg_Move_11, gg_rct_Move_14 )
call TriggerAddCondition( gg_trg_Move_11, Condition( function Trig_Move_11_Conditions ) )
call TriggerAddAction( gg_trg_Move_11, function Trig_Move_11_Actions )
endfunction
Trigger 3:
JASS:
function MovementTriggeringUnitIsTheQueen takes nothing returns boolean
return ( GetUnitTypeId(GetTriggerUnit()) == 'n001' )
endfunction
function MovementTriggeringUnitIsThePrincess takes nothing returns boolean
return ( GetUnitTypeId(GetTriggerUnit()) == 'n00F' )
endfunction
function MovementTriggeringUnitIsTheBaron takes nothing returns boolean
return ( GetUnitTypeId(GetTriggerUnit()) == 'n00E' )
endfunction
function Trig_Move_15_Conditions takes nothing returns boolean
if ( not MovementPrimaryConditionConditions() ) then
return false
endif
return true
endfunction
function Trig_Move_15_Actions takes nothing returns nothing
if ( MovementTriggeringUnitIsNonAncientKingNPC() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "attack", GetRectCenter(gg_rct_Queen_Target) )
else
endif
if ( MovementTriggeringUnitIsNonAncientQueenNPC() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "attack", GetRectCenter(gg_rct_King_Target) )
else
endif
if ( MovementTriggeringUnitIsTheQueen() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "move", GetRectCenter(gg_rct_The_Queen) )
else
endif
if ( MovementTriggeringUnitIsThePrincess() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "move", GetRectCenter(gg_rct_The_Princess) )
else
endif
if ( MovementTriggeringUnitIsTheBaron() ) then
call IssuePointOrderLocBJ( GetTriggerUnit(), "move", GetRectCenter(gg_rct_The_Baron) )
else
endif
endfunction
//===========================================================================
function InitTrig_Move_15 takes nothing returns nothing
set gg_trg_Move_15 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Move_15, gg_rct_Move_15 )
call TriggerAddCondition( gg_trg_Move_15, Condition( function Trig_Move_15_Conditions ) )
call TriggerAddAction( gg_trg_Move_15, function Trig_Move_15_Actions )
endfunction
The reason for the 2 longer triggers is to keep the bosses from being drug to the other side of the map, but I'm trying to fix that with locking guard positions. The main problem is the spawned units running back to the base.