I'm sorry it dawned on me sometime after that last post that I hadn't shown the flag script in this thread.
edit: Oops, yes I did, on the first page
Please bear with us as both Smithy and myself are new to scripting TOW objectives.
Code:
flagpole1:
$flag_pole1 nottriggerable
if( parm.other.dmteam == allies) // When an allied approaches the flagpole
{
if( $Obj_pole1.ControlledBy == 2) // If the flagpole is neutral, not controlled by either team
{
$Obj_pole1 TakeOver 1
$wally_flag1 waitthread move_object $post1_down 3 // Our "wally" flag is neutral, lower it then hide it
$wally_flag1 hide
$allies_flag1 show // Replace the flag for an allied flag, then raise it
$allies_flag1 waitthread move_object $post1_up 3
level.numAlliedObjectives-- // Remove this objective from the Allies list
iprintlnbold "Allies Control Base 1"
}
if( $Obj_pole1.ControlledBy == 0) // If the flagpole is controlled by axis team
{
$Obj_pole1 TakeOver 1
$axis_flag1 waitthread move_object $post1_down 3 // Lower the axis flag and hide it.
$axis_flag1 hide
level.numAxisObjectives++ // Add this objective from the Axis list
$allies_flag1 show // Replace the flag for an allied flag, then raise it
$allies_flag1 waitthread move_object $post1_up 3
level.numAlliedObjectives-- // Remove this objective from the Allies list
iprintlnbold "Allies Control Base 1"
}
}
else if( parm.other.dmteam == axis) // If an axis player approaches the flagpole
{
if( $Obj_pole1.ControlledBy == 2) // If the pole is neutral
{
$Obj_pole1 TakeOver 0
$wally_flag1 waitthread move_object $post1_down 3 // Lower the neutral flag
$wally_flag1 hide
$axis_flag1 show
$axis_flag1 waitthread move_object $post1_up 3 // Raise the axis flag
level.numAxisObjectives-- // Remove this objective from the Axis list
iprintlnbold "Axis Control Base 1"
}
if( $Obj_pole1.ControlledBy == 1) // If the pole is controlled by the allies
{
$Obj_pole1 TakeOver 0
$allies_flag1 waitthread move_object $post1_down 3 // Lower the allied flag
$allies_flag1 hide
level.numAlliedObjectives++ // Add this objective to the Allies list again
$axis_flag1 show
$axis_flag1 waitthread move_object $post1_up 3 // Raise the axis flag
level.numAxisObjectives-- // Remove this objective from the Axis list
iprintlnbold "Axis Control Base 1"
}
}
//Update team current objectives
thread set_objectives
waitthread Check_End_Match
$flag_pole1 triggerable
end
We repeat this for all of the required flagpole objectives, just change the numbers.