- Joined
- Jan 1, 2005
- Messages
- 133
while working onmy new map updates i wanted 2 make a the terran bunker act more like the 1 in the starcraft game. The ability i had worked almost the same but i was only able 2 add 1 type of unit it at 1 time so only marines were allowed in the bunker. (battle station ability)
Wat i need is an ability that would allow for more then 1 type of unit to enter the bunker and wen a unit is in the bunker it can attack enemy units wen they come in range.
i was able to get a ability that enablked me 2 allow more then 1 type of unit but the bunker doesnt attack. it also came with a trigger which made dummies of the unit but i cant understand the point of it, unfortunately i cant test the trigger i got cuz it was from the Samurolosttemple map which is protected. but if any1 can understand the proper function of the trigger plz post ur advice or suggestions here
______________________________________________________
//===========================================================================
// Trigger: Enter marine
//===========================================================================
function Trig_Enter_marine_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTransportUnitBJ(), UNIT_TYPE_STRUCTURE) == true ) ) then
return false
endif
return true
endfunction
function Trig_Enter_marine_Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetLoadedUnitBJ()) == 'zmar' ) ) then
return false
endif
return true
endfunction
function Trig_Enter_marine_Actions takes nothing returns nothing
if ( Trig_Enter_marine_Func002C() ) then
call CreateNUnitsAtLoc( 1, 'z001', GetOwningPlayer(GetLoadedUnitBJ()), GetUnitLoc(GetTransportUnitBJ()), bj_UNIT_FACING )
else
endif
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "holdposition" )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Bunker_Dummys )
endfunction
//===========================================================================
function InitTrig_Enter_marine takes nothing returns nothing
set gg_trg_Enter_marine = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Enter_marine, EVENT_PLAYER_UNIT_LOADED )
call TriggerAddCondition( gg_trg_Enter_marine, Condition( function Trig_Enter_marine_Conditions ) )
call TriggerAddAction( gg_trg_Enter_marine, function Trig_Enter_marine_Actions )
endfunction
//===========================================================================
// Trigger: Enter firebat
//===========================================================================
function Trig_Enter_firebat_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTransportUnitBJ(), UNIT_TYPE_STRUCTURE) == true ) ) then
return false
endif
return true
endfunction
function Trig_Enter_firebat_Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetLoadedUnitBJ()) == 'zcso' ) ) then
return false
endif
return true
endfunction
function Trig_Enter_firebat_Actions takes nothing returns nothing
if ( Trig_Enter_firebat_Func002C() ) then
call CreateNUnitsAtLoc( 1, 'z000', GetOwningPlayer(GetLoadedUnitBJ()), GetUnitLoc(GetTransportUnitBJ()), bj_UNIT_FACING )
else
endif
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "holdposition" )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Bunker_Dummys )
endfunction
//===========================================================================
function InitTrig_Enter_firebat takes nothing returns nothing
set gg_trg_Enter_firebat = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Enter_firebat, EVENT_PLAYER_UNIT_LOADED )
call TriggerAddCondition( gg_trg_Enter_firebat, Condition( function Trig_Enter_firebat_Conditions ) )
call TriggerAddAction( gg_trg_Enter_firebat, function Trig_Enter_firebat_Actions )
endfunction
//===========================================================================
// Trigger: Exit marine
//
//
// ...bevor du fragst:
// Ja, das gehampel mit den Points WAR nötig :C
//===========================================================================
function Trig_Exit_marine_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("unload") ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'o000' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_marine_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetOrderTargetUnit()) == 'zmar' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_marine_Func005Func002C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(udg_Point[0], udg_Point[1]) <= 50.00 ) ) then
return false
endif
return true
endfunction
function Trig_Exit_marine_Func005A takes nothing returns nothing
set udg_Point[1] = GetUnitLoc(GetEnumUnit())
if ( Trig_Exit_marine_Func005Func002C() ) then
call RemoveUnit( GetEnumUnit() )
call RemoveLocation( udg_Point[0] )
call RemoveLocation( udg_Point[1] )
return
else
call RemoveLocation( udg_Point[1] )
endif
endfunction
function Trig_Exit_marine_Actions takes nothing returns nothing
set udg_Point[0] = GetUnitLoc(GetOrderedUnit())
// Legt fest welche Einheit den Bunker verlässt
if ( Trig_Exit_marine_Func003C() ) then
set udg_Dummy = 'z001'
else
endif
// Entfernt die oben festgelegte Einheit
call ForGroupBJ( GetUnitsOfTypeIdAll(udg_Dummy), function Trig_Exit_marine_Func005A )
call RemoveLocation( udg_Point[0] )
endfunction
//===========================================================================
function InitTrig_Exit_marine takes nothing returns nothing
set gg_trg_Exit_marine = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Exit_marine, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_Exit_marine, Condition( function Trig_Exit_marine_Conditions ) )
call TriggerAddAction( gg_trg_Exit_marine, function Trig_Exit_marine_Actions )
endfunction
//===========================================================================
// Trigger: Exit firebat
//
//
// ...bevor du fragst:
// Ja, das gehampel mit den Points WAR nötig :C
//===========================================================================
function Trig_Exit_firebat_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("unload") ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'o000' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_firebat_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetOrderTargetUnit()) == 'zcso' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_firebat_Func005Func002C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(udg_Point[0], udg_Point[1]) <= 50.00 ) ) then
return false
endif
return true
endfunction
function Trig_Exit_firebat_Func005A takes nothing returns nothing
set udg_Point[1] = GetUnitLoc(GetEnumUnit())
if ( Trig_Exit_firebat_Func005Func002C() ) then
call RemoveUnit( GetEnumUnit() )
call RemoveLocation( udg_Point[0] )
call RemoveLocation( udg_Point[1] )
return
else
call RemoveLocation( udg_Point[1] )
endif
endfunction
function Trig_Exit_firebat_Actions takes nothing returns nothing
set udg_Point[0] = GetUnitLoc(GetOrderedUnit())
// Legt fest welche Einheit den Bunker verlässt
if ( Trig_Exit_firebat_Func003C() ) then
set udg_Dummy = 'z000'
else
endif
// Entfernt die oben festgelegte Einheit
call ForGroupBJ( GetUnitsOfTypeIdAll(udg_Dummy), function Trig_Exit_firebat_Func005A )
call RemoveLocation( udg_Point[0] )
endfunction
//===========================================================================
function InitTrig_Exit_firebat takes nothing returns nothing
set gg_trg_Exit_firebat = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Exit_firebat, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_Exit_firebat, Condition( function Trig_Exit_firebat_Conditions ) )
call TriggerAddAction( gg_trg_Exit_firebat, function Trig_Exit_firebat_Actions )
endfunction
//===========================================================================
// Trigger: Destroy Copy
//
// Hier brauchst nix mehr ändern. Alle Bunkerdummys werden entfernt sobald er Bunker stirbt.
//===========================================================================
function Trig_Destroy_Copy_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'o000' ) ) then
return false
endif
return true
endfunction
function Trig_Destroy_Copy_Func004Func002C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(udg_Point[0], udg_Point[1]) <= 50.00 ) ) then
return false
endif
return true
endfunction
function Trig_Destroy_Copy_Func004A takes nothing returns nothing
set udg_Point[1] = GetUnitLoc(GetEnumUnit())
if ( Trig_Destroy_Copy_Func004Func002C() ) then
call RemoveUnit( GetEnumUnit() )
else
call RemoveLocation( udg_Point[1] )
endif
endfunction
function Trig_Destroy_Copy_Actions takes nothing returns nothing
set udg_Point[0] = GetUnitLoc(GetDyingUnit())
call ForGroupBJ( udg_Bunker_Dummys, function Trig_Destroy_Copy_Func004A )
call RemoveLocation( udg_Point[0] )
call RemoveLocation( udg_Point[1] )
endfunction
//===========================================================================
function InitTrig_Destroy_Copy takes nothing returns nothing
set gg_trg_Destroy_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Destroy_Copy, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Destroy_Copy, Condition( function Trig_Destroy_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Destroy_Copy, function Trig_Destroy_Copy_Actions )
endfunction
Varibles it uses
group - udg_Bunker_Dummys = null
location array - udg_Point
integer - udg_Dummy = 0
The varible info on the bunker dummys for me didnt end with null it only had 'Empty unit group' so i dunno if there is a difference.
Anyways i had 2 make 2 dummy units for the triggers and the bunkers attack had damage but it said use attack = none
if any1 can understand the point of this trigger and if i should use it plz post ur comments here.
Wat i need is an ability that would allow for more then 1 type of unit to enter the bunker and wen a unit is in the bunker it can attack enemy units wen they come in range.
i was able to get a ability that enablked me 2 allow more then 1 type of unit but the bunker doesnt attack. it also came with a trigger which made dummies of the unit but i cant understand the point of it, unfortunately i cant test the trigger i got cuz it was from the Samurolosttemple map which is protected. but if any1 can understand the proper function of the trigger plz post ur advice or suggestions here
______________________________________________________
//===========================================================================
// Trigger: Enter marine
//===========================================================================
function Trig_Enter_marine_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTransportUnitBJ(), UNIT_TYPE_STRUCTURE) == true ) ) then
return false
endif
return true
endfunction
function Trig_Enter_marine_Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetLoadedUnitBJ()) == 'zmar' ) ) then
return false
endif
return true
endfunction
function Trig_Enter_marine_Actions takes nothing returns nothing
if ( Trig_Enter_marine_Func002C() ) then
call CreateNUnitsAtLoc( 1, 'z001', GetOwningPlayer(GetLoadedUnitBJ()), GetUnitLoc(GetTransportUnitBJ()), bj_UNIT_FACING )
else
endif
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "holdposition" )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Bunker_Dummys )
endfunction
//===========================================================================
function InitTrig_Enter_marine takes nothing returns nothing
set gg_trg_Enter_marine = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Enter_marine, EVENT_PLAYER_UNIT_LOADED )
call TriggerAddCondition( gg_trg_Enter_marine, Condition( function Trig_Enter_marine_Conditions ) )
call TriggerAddAction( gg_trg_Enter_marine, function Trig_Enter_marine_Actions )
endfunction
//===========================================================================
// Trigger: Enter firebat
//===========================================================================
function Trig_Enter_firebat_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTransportUnitBJ(), UNIT_TYPE_STRUCTURE) == true ) ) then
return false
endif
return true
endfunction
function Trig_Enter_firebat_Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetLoadedUnitBJ()) == 'zcso' ) ) then
return false
endif
return true
endfunction
function Trig_Enter_firebat_Actions takes nothing returns nothing
if ( Trig_Enter_firebat_Func002C() ) then
call CreateNUnitsAtLoc( 1, 'z000', GetOwningPlayer(GetLoadedUnitBJ()), GetUnitLoc(GetTransportUnitBJ()), bj_UNIT_FACING )
else
endif
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "holdposition" )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Bunker_Dummys )
endfunction
//===========================================================================
function InitTrig_Enter_firebat takes nothing returns nothing
set gg_trg_Enter_firebat = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Enter_firebat, EVENT_PLAYER_UNIT_LOADED )
call TriggerAddCondition( gg_trg_Enter_firebat, Condition( function Trig_Enter_firebat_Conditions ) )
call TriggerAddAction( gg_trg_Enter_firebat, function Trig_Enter_firebat_Actions )
endfunction
//===========================================================================
// Trigger: Exit marine
//
//
// ...bevor du fragst:
// Ja, das gehampel mit den Points WAR nötig :C
//===========================================================================
function Trig_Exit_marine_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("unload") ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'o000' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_marine_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetOrderTargetUnit()) == 'zmar' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_marine_Func005Func002C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(udg_Point[0], udg_Point[1]) <= 50.00 ) ) then
return false
endif
return true
endfunction
function Trig_Exit_marine_Func005A takes nothing returns nothing
set udg_Point[1] = GetUnitLoc(GetEnumUnit())
if ( Trig_Exit_marine_Func005Func002C() ) then
call RemoveUnit( GetEnumUnit() )
call RemoveLocation( udg_Point[0] )
call RemoveLocation( udg_Point[1] )
return
else
call RemoveLocation( udg_Point[1] )
endif
endfunction
function Trig_Exit_marine_Actions takes nothing returns nothing
set udg_Point[0] = GetUnitLoc(GetOrderedUnit())
// Legt fest welche Einheit den Bunker verlässt
if ( Trig_Exit_marine_Func003C() ) then
set udg_Dummy = 'z001'
else
endif
// Entfernt die oben festgelegte Einheit
call ForGroupBJ( GetUnitsOfTypeIdAll(udg_Dummy), function Trig_Exit_marine_Func005A )
call RemoveLocation( udg_Point[0] )
endfunction
//===========================================================================
function InitTrig_Exit_marine takes nothing returns nothing
set gg_trg_Exit_marine = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Exit_marine, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_Exit_marine, Condition( function Trig_Exit_marine_Conditions ) )
call TriggerAddAction( gg_trg_Exit_marine, function Trig_Exit_marine_Actions )
endfunction
//===========================================================================
// Trigger: Exit firebat
//
//
// ...bevor du fragst:
// Ja, das gehampel mit den Points WAR nötig :C
//===========================================================================
function Trig_Exit_firebat_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("unload") ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'o000' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_firebat_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetOrderTargetUnit()) == 'zcso' ) ) then
return false
endif
return true
endfunction
function Trig_Exit_firebat_Func005Func002C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(udg_Point[0], udg_Point[1]) <= 50.00 ) ) then
return false
endif
return true
endfunction
function Trig_Exit_firebat_Func005A takes nothing returns nothing
set udg_Point[1] = GetUnitLoc(GetEnumUnit())
if ( Trig_Exit_firebat_Func005Func002C() ) then
call RemoveUnit( GetEnumUnit() )
call RemoveLocation( udg_Point[0] )
call RemoveLocation( udg_Point[1] )
return
else
call RemoveLocation( udg_Point[1] )
endif
endfunction
function Trig_Exit_firebat_Actions takes nothing returns nothing
set udg_Point[0] = GetUnitLoc(GetOrderedUnit())
// Legt fest welche Einheit den Bunker verlässt
if ( Trig_Exit_firebat_Func003C() ) then
set udg_Dummy = 'z000'
else
endif
// Entfernt die oben festgelegte Einheit
call ForGroupBJ( GetUnitsOfTypeIdAll(udg_Dummy), function Trig_Exit_firebat_Func005A )
call RemoveLocation( udg_Point[0] )
endfunction
//===========================================================================
function InitTrig_Exit_firebat takes nothing returns nothing
set gg_trg_Exit_firebat = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Exit_firebat, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_Exit_firebat, Condition( function Trig_Exit_firebat_Conditions ) )
call TriggerAddAction( gg_trg_Exit_firebat, function Trig_Exit_firebat_Actions )
endfunction
//===========================================================================
// Trigger: Destroy Copy
//
// Hier brauchst nix mehr ändern. Alle Bunkerdummys werden entfernt sobald er Bunker stirbt.
//===========================================================================
function Trig_Destroy_Copy_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'o000' ) ) then
return false
endif
return true
endfunction
function Trig_Destroy_Copy_Func004Func002C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(udg_Point[0], udg_Point[1]) <= 50.00 ) ) then
return false
endif
return true
endfunction
function Trig_Destroy_Copy_Func004A takes nothing returns nothing
set udg_Point[1] = GetUnitLoc(GetEnumUnit())
if ( Trig_Destroy_Copy_Func004Func002C() ) then
call RemoveUnit( GetEnumUnit() )
else
call RemoveLocation( udg_Point[1] )
endif
endfunction
function Trig_Destroy_Copy_Actions takes nothing returns nothing
set udg_Point[0] = GetUnitLoc(GetDyingUnit())
call ForGroupBJ( udg_Bunker_Dummys, function Trig_Destroy_Copy_Func004A )
call RemoveLocation( udg_Point[0] )
call RemoveLocation( udg_Point[1] )
endfunction
//===========================================================================
function InitTrig_Destroy_Copy takes nothing returns nothing
set gg_trg_Destroy_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Destroy_Copy, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Destroy_Copy, Condition( function Trig_Destroy_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Destroy_Copy, function Trig_Destroy_Copy_Actions )
endfunction
Varibles it uses
group - udg_Bunker_Dummys = null
location array - udg_Point
integer - udg_Dummy = 0
The varible info on the bunker dummys for me didnt end with null it only had 'Empty unit group' so i dunno if there is a difference.
Anyways i had 2 make 2 dummy units for the triggers and the bunkers attack had damage but it said use attack = none
if any1 can understand the point of this trigger and if i should use it plz post ur comments here.