START_SCRIPT_FILE


##########Integer Variables##########

VDECL VINT SETUP          0
VDECL VINT CREATE1        0
VDECL VINT CREATE2        0
VDECL VINT CREATE_CONVOY  0

VDECL VINT ACTION_TIME         0
VDECL VINT SET_CONVOY_TIME     0
VDECL VINT CREATE_CONVOY_TIME  0

VDECL VINT FORTIFICATION    0
VDECL VINT CONVOY_STRENGTH  0
VDECL VINT WHICH_PAD        0
VDECL VINT FORT_CHANGE      0
VDECL VINT BUILD            0
VDECL VINT WHICH_BUILD      0

#Represnt the value of the cargo as well as the strength of the escort force
VDECL VINT AAA_STRENGTH  0
VDECL VINT BBB_STRENGTH  0
VDECL VINT CCC_STRENGTH  0
VDECL VINT DDD_STRENGTH  0
VDECL VINT EEE_STRENGTH  0
VDECL VINT FFF_STRENGTH  0

#Switches for creating the power-ups left behind at the site of a destroyed convoy
VDECL VINT AAA_PU  0
VDECL VINT BBB_PU  0
VDECL VINT CCC_PU  0
VDECL VINT DDD_PU  0
VDECL VINT EEE_PU  0
VDECL VINT FFF_PU  0

#Switching the gates on or off once (not consistantly) depending upon game state
VDECL VINT ALL_GATE_SWITCH    0
VDECL VINT NORTH_GATE_SWITCH  0
VDECL VINT EAST_GATE_SWITCH   0
VDECL VINT SOUTH_GATE_SWITCH  0
VDECL VINT WEST_GATE_SWITCH   0

#Switches and delays for removing the tanks after a given time if their convoy unit was destroyed
VDECL VINT AAA_ESCORT       0
VDECL VINT AAA_ESCORT_TIME  0
VDECL VINT BBB_ESCORT       0
VDECL VINT BBB_ESCORT_TIME  0
VDECL VINT CCC_ESCORT       0
VDECL VINT CCC_ESCORT_TIME  0
VDECL VINT DDD_ESCORT       0
VDECL VINT DDD_ESCORT_TIME  0
VDECL VINT EEE_ESCORT       0
VDECL VINT EEE_ESCORT_TIME  0
VDECL VINT FFF_ESCORT       0
VDECL VINT FFF_ESCORT_TIME  0

#Counts for rabble objects
VDECL VINT AITANK_GNRTR_COUNT  0
VDECL VINT SLDR_GNRTR_COUNT    0
VDECL VINT AAV_GNRTR_COUNT     0
VDECL VINT LIGHT_TURRET_COUNT  0
VDECL VINT HEAVY_TURRET_COUNT  0
VDECL VINT SAMS_COUNT          0

#Values for rabble objects, used to calculate fortification
VDECL VINT AITANK_GNRTR_VALUE  0
VDECL VINT SLDR_GNRTR_VALUE    0
VDECL VINT AAV_GNRTR_VALUE     0
VDECL VINT LIGHT_TURRET_VALUE  0
VDECL VINT HEAVY_TURRET_VALUE  0
VDECL VINT SAMS_VALUE          0

#Switches for what type of object to build
VDECL VINT LIGHT_TURRET  0
VDECL VINT HEAVY_TURRET  0
VDECL VINT SAMS          0
VDECL VINT INFANTRY      0
VDECL VINT TANK          0
VDECL VINT AAV           0

#For loop variables
VDECL VINT A  0
VDECL VINT B  0
VDECL VINT C  0
VDECL VINT D  0



##########Location Variables##########

VDECL VLOC CONVOY_PAD LOC ( 1, 1, 1 )
VDECL VLOC TANK1_PAD  LOC ( 1, 1, 1 )
VDECL VLOC TANK2_PAD  LOC ( 1, 1, 1 )

#Locations of cargo ship landing pads.  In order: 0-NW, 1-W, 2-SW, 3-SE, 4-E, 5-NE
VDECL VLOC PAD0_0 LOC ( 176, 232, 0 )
VDECL VLOC PAD0_1 LOC ( 172, 224, 0 )
VDECL VLOC PAD0_2 LOC ( 180, 224, 0 )
VDECL VLOC PAD1_0 LOC ( 236, 132, 0 )
VDECL VLOC PAD1_1 LOC ( 230, 132, 0 )
VDECL VLOC PAD1_2 LOC ( 242, 132, 0 )
VDECL VLOC PAD2_0 LOC ( 176,  28, 0 )
VDECL VLOC PAD2_1 LOC ( 180,  36, 0 )
VDECL VLOC PAD2_2 LOC ( 172,  36, 0 )
VDECL VLOC PAD3_0 LOC (  80,  28, 0 )
VDECL VLOC PAD3_1 LOC (  84,  36, 0 )
VDECL VLOC PAD3_2 LOC (  76,  36, 0 )
VDECL VLOC PAD4_0 LOC (  20, 132, 0 )
VDECL VLOC PAD4_1 LOC (  14, 132, 0 )
VDECL VLOC PAD4_2 LOC (  26, 132, 0 )
VDECL VLOC PAD5_0 LOC (  80, 232, 0 )
VDECL VLOC PAD5_1 LOC (  76, 224, 0 )
VDECL VLOC PAD5_2 LOC (  84, 224, 0 )

#Locations of convoy units
VDECL VLOC AAA_LOC  LOC  ( 1, 1, 1 )
VDECL VLOC BBB_LOC  LOC  ( 1, 1, 1 )
VDECL VLOC CCC_LOC  LOC  ( 1, 1, 1 )
VDECL VLOC DDD_LOC  LOC  ( 1, 1, 1 )
VDECL VLOC EEE_LOC  LOC  ( 1, 1, 1 )
VDECL VLOC FFF_LOC  LOC  ( 1, 1, 1 )

#Locations of the four gates and the teleport pad
VDECL VLOC NORTH_GATE LOC ( 128, 151, 0 )
VDECL VLOC EAST_GATE  LOC ( 149, 136, 0 )
VDECL VLOC SOUTH_GATE LOC ( 128, 117, 0 )
VDECL VLOC WEST_GATE  LOC ( 107, 136, 0 )
VDECL VLOC END        LOC ( 128, 128, 0 )


##########Setup Stuff##########

	IF ( VBL_TEST SETUP EQUAL 0 ) THEN
	(
		SET_USE_DEFAULT_VICTORY 0
		CHANGE_VBL ACTION_TIME SET GAME_TIME
		CHANGE_VBL ACTION_TIME ADD 1
		CHANGE_VBL SET_CONVOY_TIME SET GAME_TIME
		CHANGE_VBL SET_CONVOY_TIME ADD 5
		CHANGE_VBL CREATE_CONVOY_TIME SET SET_CONVOY_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 1
		CHANGE_VBL SETUP SET 1
	)


	#Inital AAV and Bomber attck on Imperium Citadel
	IF ( AND  (( VBL_TEST SETUP EQUAL 1 ) ( VBL_TEST CREATE1 EQUAL 0 )) ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL ACTION_TIME ) THEN
		(
			CREATE_UNIT AAV1 0 AAV LOC ( 132, 2, 0 ) YAW (0) NULL NULL
			CREATE_UNIT AAV2 0 AAV LOC ( 132, 2, 0 ) YAW (0) NULL NULL
			CREATE_UNIT AAV3 0 AAV LOC ( 132, 2, 0 ) YAW (0) NULL NULL
			SET_MOVEMENT_PATH AAV1 AAV1
			SET_MOVEMENT_PATH AAV2 AAV2
			SET_MOVEMENT_PATH AAV3 AAV3
			CHANGE_VBL ACTION_TIME SET GAME_TIME
			CHANGE_VBL ACTION_TIME ADD 1
			CHANGE_VBL CREATE1 SET 1
		)
	)



	IF ( AND (( VBL_TEST CREATE1 EQUAL 1 ) ( VBL_TEST CREATE2 EQUAL 0 )) ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL ACTION_TIME ) THEN
		(
			CREATE_UNIT AAV4 0 AAV LOC ( 140, 2, 0 ) YAW (115) NULL NULL
			CREATE_UNIT AAV5 0 AAV LOC ( 140, 2, 0 ) YAW (115) NULL NULL
			CREATE_UNIT AAV6 0 AAV LOC ( 140, 2, 0 ) YAW (115) NULL NULL
			SET_MOVEMENT_PATH AAV4 AAV4
			SET_MOVEMENT_PATH AAV5 AAV5
			SET_MOVEMENT_PATH AAV6 AAV6
			CHANGE_VBL CREATE2 SET 1
		)
	)


	#Setting locations for and strengths for the next created convoy/escort
	IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL SET_CONVOY_TIME ) THEN
	(
		CHANGE_VBL CONVOY_STRENGTH SET RANDOM_INT 6
		CHANGE_VBL WHICH_PAD SET RANDOM_INT 6


		#Setting variable CHOSEN_PAD
		IF ( VBL_TEST WHICH_PAD EQUAL 0 ) THEN
		(
			CHANGE_LOC_VBL CONVOY_PAD SET PAD0_0
			CHANGE_LOC_VBL TANK1_PAD  SET PAD0_1
			CHANGE_LOC_VBL TANK2_PAD  SET PAD0_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 1 ) THEN
		(
			CHANGE_LOC_VBL CONVOY_PAD SET PAD1_0
			CHANGE_LOC_VBL TANK1_PAD  SET PAD1_1
			CHANGE_LOC_VBL TANK2_PAD  SET PAD1_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 2 ) THEN
		(
			CHANGE_LOC_VBL CONVOY_PAD SET PAD2_0
			CHANGE_LOC_VBL TANK1_PAD  SET PAD2_1
			CHANGE_LOC_VBL TANK2_PAD  SET PAD2_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 3 ) THEN
		(
			CHANGE_LOC_VBL CONVOY_PAD SET PAD3_0
			CHANGE_LOC_VBL TANK1_PAD  SET PAD3_1
			CHANGE_LOC_VBL TANK2_PAD  SET PAD3_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 4 ) THEN
		(
			CHANGE_LOC_VBL CONVOY_PAD SET PAD4_0
			CHANGE_LOC_VBL TANK1_PAD  SET PAD4_1
			CHANGE_LOC_VBL TANK2_PAD  SET PAD4_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 5 ) THEN
		(
			CHANGE_LOC_VBL CONVOY_PAD SET PAD5_0
			CHANGE_LOC_VBL TANK1_PAD  SET PAD5_1
			CHANGE_LOC_VBL TANK2_PAD  SET PAD5_2
		)


		CHANGE_VBL SET_CONVOY_TIME SET GAME_TIME
		CHANGE_VBL SET_CONVOY_TIME ADD 28
		CHANGE_VBL CREATE_CONVOY_TIME SET GAME_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 2
	)


	#Creating convoy AAA and its escorts
	IF ( AND (( VBL_TEST CREATE_CONVOY EQUAL 0 ) ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL CREATE_CONVOY_TIME )) ) THEN
	(
		CREATE_UNIT AAA 4 CONVOY_TRUCK CONVOY_PAD YAW (0) NULL NULL
		CHANGE_VBL AAA_STRENGTH SET CONVOY_STRENGTH


		IF ( OR (( VBL_TEST AAA_STRENGTH EQUAL 2 ) ( VBL_TEST AAA_STRENGTH EQUAL 3 )) ) THEN
		(
			CREATE_UNIT AAATANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {AAA WITH 1}
		)


		IF ( OR (( VBL_TEST AAA_STRENGTH EQUAL 4 ) ( VBL_TEST AAA_STRENGTH EQUAL 5 )) ) THEN
		(
			CREATE_UNIT AAATANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			CREATE_UNIT AAATANK2 4 AI_TANK TANK2_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {AAA WITH 2}
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 0 ) THEN
		(
			SET_MOVEMENT_PATH AAA PATH0_0
			SET_MOVEMENT_PATH AAATANK1 PATH0_1
			SET_MOVEMENT_PATH AAATANK2 PATH0_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 1 ) THEN
		(
			SET_MOVEMENT_PATH AAA PATH1_0
			SET_MOVEMENT_PATH AAATANK1 PATH1_1
			SET_MOVEMENT_PATH AAATANK2 PATH1_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 2 ) THEN
		(
			SET_MOVEMENT_PATH AAA PATH2_0
			SET_MOVEMENT_PATH AAATANK1 PATH2_1
			SET_MOVEMENT_PATH AAATANK2 PATH2_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 3 ) THEN
		(
			SET_MOVEMENT_PATH AAA PATH3_0
			SET_MOVEMENT_PATH AAATANK1 PATH3_1
			SET_MOVEMENT_PATH AAATANK2 PATH3_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 4 ) THEN
		(
			SET_MOVEMENT_PATH AAA PATH4_0
			SET_MOVEMENT_PATH AAATANK1 PATH4_1
			SET_MOVEMENT_PATH AAATANK2 PATH4_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 5 ) THEN
		(
			SET_MOVEMENT_PATH AAA PATH5_0
			SET_MOVEMENT_PATH AAATANK1 PATH5_1
			SET_MOVEMENT_PATH AAATANK2 PATH5_2
		)

		CHANGE_VBL CREATE_CONVOY_TIME SET SET_CONVOY_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 1
		CHANGE_VBL CREATE_CONVOY SET 1
	)


	#Creating convoy BBB and its escorts
	IF ( AND (( VBL_TEST CREATE_CONVOY EQUAL 1 ) ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL CREATE_CONVOY_TIME )) ) THEN
	(
		CREATE_UNIT BBB 4 CONVOY_TRUCK CONVOY_PAD YAW (0) NULL NULL
		CHANGE_VBL BBB_STRENGTH SET CONVOY_STRENGTH


		IF ( OR (( VBL_TEST BBB_STRENGTH EQUAL 2 ) ( VBL_TEST BBB_STRENGTH EQUAL 3 )) ) THEN
		(
			CREATE_UNIT BBBTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {BBB WITH 1}
		)


		IF ( OR (( VBL_TEST BBB_STRENGTH EQUAL 4 ) ( VBL_TEST BBB_STRENGTH EQUAL 5 )) ) THEN
		(
			CREATE_UNIT BBBTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			CREATE_UNIT BBBTANK2 4 AI_TANK TANK2_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {BBB WITH 2}
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 0 ) THEN
		(
			SET_MOVEMENT_PATH BBB PATH0_0
			SET_MOVEMENT_PATH BBBTANK1 PATH0_1
			SET_MOVEMENT_PATH BBBTANK2 PATH0_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 1 ) THEN
		(
			SET_MOVEMENT_PATH BBB PATH1_0
			SET_MOVEMENT_PATH BBBTANK1 PATH1_1
			SET_MOVEMENT_PATH BBBTANK2 PATH1_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 2 ) THEN
		(
			SET_MOVEMENT_PATH BBB PATH2_0
			SET_MOVEMENT_PATH BBBTANK1 PATH2_1
			SET_MOVEMENT_PATH BBBTANK2 PATH2_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 3 ) THEN
		(
			SET_MOVEMENT_PATH BBB PATH3_0
			SET_MOVEMENT_PATH BBBTANK1 PATH3_1
			SET_MOVEMENT_PATH BBBTANK2 PATH3_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 4 ) THEN
		(
			SET_MOVEMENT_PATH BBB PATH4_0
			SET_MOVEMENT_PATH BBBTANK1 PATH4_1
			SET_MOVEMENT_PATH BBBTANK2 PATH4_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 5 ) THEN
		(
			SET_MOVEMENT_PATH BBB PATH5_0
			SET_MOVEMENT_PATH BBBTANK1 PATH5_1
			SET_MOVEMENT_PATH BBBTANK2 PATH5_2
		)

		CHANGE_VBL CREATE_CONVOY_TIME SET SET_CONVOY_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 1
		CHANGE_VBL CREATE_CONVOY SET 2
	)


	#Creating convoy CCC and its escorts
	IF ( AND (( VBL_TEST CREATE_CONVOY EQUAL 2 ) ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL CREATE_CONVOY_TIME )) ) THEN
	(
		CREATE_UNIT CCC 4 CONVOY_TRUCK CONVOY_PAD YAW (0) NULL NULL
		CHANGE_VBL CCC_STRENGTH SET CONVOY_STRENGTH


		IF ( OR (( VBL_TEST CCC_STRENGTH EQUAL 2 ) ( VBL_TEST CCC_STRENGTH EQUAL 3 )) ) THEN
		(
			CREATE_UNIT CCCTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {CCC WITH 1}
		)


		IF ( OR (( VBL_TEST CCC_STRENGTH EQUAL 4 ) ( VBL_TEST CCC_STRENGTH EQUAL 5 )) ) THEN
		(
			CREATE_UNIT CCCTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			CREATE_UNIT CCCTANK2 4 AI_TANK TANK2_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {CCC WITH 2}
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 0 ) THEN
		(
			SET_MOVEMENT_PATH CCC PATH0_0
			SET_MOVEMENT_PATH CCCTANK1 PATH0_1
			SET_MOVEMENT_PATH CCCTANK2 PATH0_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 1 ) THEN
		(
			SET_MOVEMENT_PATH CCC PATH1_0
			SET_MOVEMENT_PATH CCCTANK1 PATH1_1
			SET_MOVEMENT_PATH CCCTANK2 PATH1_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 2 ) THEN
		(
			SET_MOVEMENT_PATH CCC PATH2_0
			SET_MOVEMENT_PATH CCCTANK1 PATH2_1
			SET_MOVEMENT_PATH CCCTANK2 PATH2_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 3 ) THEN
		(
			SET_MOVEMENT_PATH CCC PATH3_0
			SET_MOVEMENT_PATH CCCTANK1 PATH3_1
			SET_MOVEMENT_PATH CCCTANK2 PATH3_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 4 ) THEN
		(
			SET_MOVEMENT_PATH CCC PATH4_0
			SET_MOVEMENT_PATH CCCTANK1 PATH4_1
			SET_MOVEMENT_PATH CCCTANK2 PATH4_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 5 ) THEN
		(
			SET_MOVEMENT_PATH CCC PATH5_0
			SET_MOVEMENT_PATH CCCTANK1 PATH5_1
			SET_MOVEMENT_PATH CCCTANK2 PATH5_2
		)

		CHANGE_VBL CREATE_CONVOY_TIME SET SET_CONVOY_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 1
		CHANGE_VBL CREATE_CONVOY SET 3
	)


	#Creating convoy DDD and its escorts
	IF ( AND (( VBL_TEST CREATE_CONVOY EQUAL 3 ) ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL CREATE_CONVOY_TIME )) ) THEN
	(
		CREATE_UNIT DDD 4 CONVOY_TRUCK CONVOY_PAD YAW (0) NULL NULL
		CHANGE_VBL DDD_STRENGTH SET CONVOY_STRENGTH


		IF ( OR (( VBL_TEST DDD_STRENGTH EQUAL 2 ) ( VBL_TEST DDD_STRENGTH EQUAL 3 )) ) THEN
		(
			CREATE_UNIT DDDTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {DDD WITH 1}
		)


		IF ( OR (( VBL_TEST DDD_STRENGTH EQUAL 4 ) ( VBL_TEST DDD_STRENGTH EQUAL 5 )) ) THEN
		(
			CREATE_UNIT DDDTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			CREATE_UNIT DDDTANK2 4 AI_TANK TANK2_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {DDD WITH 2}
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 0 ) THEN
		(
			SET_MOVEMENT_PATH DDD PATH0_0
			SET_MOVEMENT_PATH DDDTANK1 PATH0_1
			SET_MOVEMENT_PATH DDDTANK2 PATH0_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 1 ) THEN
		(
			SET_MOVEMENT_PATH DDD PATH1_0
			SET_MOVEMENT_PATH DDDTANK1 PATH1_1
			SET_MOVEMENT_PATH DDDTANK2 PATH1_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 2 ) THEN
		(
			SET_MOVEMENT_PATH DDD PATH2_0
			SET_MOVEMENT_PATH DDDTANK1 PATH2_1
			SET_MOVEMENT_PATH DDDTANK2 PATH2_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 3 ) THEN
		(
			SET_MOVEMENT_PATH DDD PATH3_0
			SET_MOVEMENT_PATH DDDTANK1 PATH3_1
			SET_MOVEMENT_PATH DDDTANK2 PATH3_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 4 ) THEN
		(
			SET_MOVEMENT_PATH DDD PATH4_0
			SET_MOVEMENT_PATH DDDTANK1 PATH4_1
			SET_MOVEMENT_PATH DDDTANK2 PATH4_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 5 ) THEN
		(
			SET_MOVEMENT_PATH DDD PATH5_0
			SET_MOVEMENT_PATH DDDTANK1 PATH5_1
			SET_MOVEMENT_PATH DDDTANK2 PATH5_2
		)

		CHANGE_VBL CREATE_CONVOY_TIME SET SET_CONVOY_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 1
		CHANGE_VBL CREATE_CONVOY SET 4
	)


	#Creating convoy EEE and its escorts
	IF ( AND (( VBL_TEST CREATE_CONVOY EQUAL 4 ) ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL CREATE_CONVOY_TIME )) ) THEN
	(
		CREATE_UNIT EEE 4 CONVOY_TRUCK CONVOY_PAD YAW (0) NULL NULL
		CHANGE_VBL EEE_STRENGTH SET CONVOY_STRENGTH


		IF ( OR (( VBL_TEST EEE_STRENGTH EQUAL 2 ) ( VBL_TEST EEE_STRENGTH EQUAL 3 )) ) THEN
		(
			CREATE_UNIT EEETANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {EEE WITH 1}
		)


		IF ( OR (( VBL_TEST EEE_STRENGTH EQUAL 4 ) ( VBL_TEST EEE_STRENGTH EQUAL 5 )) ) THEN
		(
			CREATE_UNIT EEETANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			CREATE_UNIT EEETANK2 4 AI_TANK TANK2_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {EEE WITH 2}
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 0 ) THEN
		(
			SET_MOVEMENT_PATH EEE PATH0_0
			SET_MOVEMENT_PATH EEETANK1 PATH0_1
			SET_MOVEMENT_PATH EEETANK2 PATH0_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 1 ) THEN
		(
			SET_MOVEMENT_PATH EEE PATH1_0
			SET_MOVEMENT_PATH EEETANK1 PATH1_1
			SET_MOVEMENT_PATH EEETANK2 PATH1_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 2 ) THEN
		(
			SET_MOVEMENT_PATH EEE PATH2_0
			SET_MOVEMENT_PATH EEETANK1 PATH2_1
			SET_MOVEMENT_PATH EEETANK2 PATH2_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 3 ) THEN
		(
			SET_MOVEMENT_PATH EEE PATH3_0
			SET_MOVEMENT_PATH EEETANK1 PATH3_1
			SET_MOVEMENT_PATH EEETANK2 PATH3_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 4 ) THEN
		(
			SET_MOVEMENT_PATH EEE PATH4_0
			SET_MOVEMENT_PATH EEETANK1 PATH4_1
			SET_MOVEMENT_PATH EEETANK2 PATH4_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 5 ) THEN
		(
			SET_MOVEMENT_PATH EEE PATH5_0
			SET_MOVEMENT_PATH EEETANK1 PATH5_1
			SET_MOVEMENT_PATH EEETANK2 PATH5_2
		)

		CHANGE_VBL CREATE_CONVOY_TIME SET SET_CONVOY_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 1
		CHANGE_VBL CREATE_CONVOY SET 5
	)


	#Creating convoy FFF and its escorts
	IF ( AND (( VBL_TEST CREATE_CONVOY EQUAL 5 ) ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL CREATE_CONVOY_TIME )) ) THEN
	(
		CREATE_UNIT FFF 4 CONVOY_TRUCK CONVOY_PAD YAW (0) NULL NULL
		CHANGE_VBL FFF_STRENGTH SET CONVOY_STRENGTH


		IF ( OR (( VBL_TEST FFF_STRENGTH EQUAL 2 ) ( VBL_TEST FFF_STRENGTH EQUAL 3 )) ) THEN
		(
			CREATE_UNIT FFFTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {FFF WITH 1}
		)


		IF ( OR (( VBL_TEST FFF_STRENGTH EQUAL 4 ) ( VBL_TEST FFF_STRENGTH EQUAL 5 )) ) THEN
		(
			CREATE_UNIT FFFTANK1 4 AI_TANK TANK1_PAD YAW (0) NULL NULL
			CREATE_UNIT FFFTANK2 4 AI_TANK TANK2_PAD YAW (0) NULL NULL
			SHOW_BILLBOARD {FFF WITH 2}
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 0 ) THEN
		(
			SET_MOVEMENT_PATH FFF PATH0_0
			SET_MOVEMENT_PATH FFFTANK1 PATH0_1
			SET_MOVEMENT_PATH FFFTANK2 PATH0_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 1 ) THEN
		(
			SET_MOVEMENT_PATH FFF PATH1_0
			SET_MOVEMENT_PATH FFFTANK1 PATH1_1
			SET_MOVEMENT_PATH FFFTANK2 PATH1_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 2 ) THEN
		(
			SET_MOVEMENT_PATH FFF PATH2_0
			SET_MOVEMENT_PATH FFFTANK1 PATH2_1
			SET_MOVEMENT_PATH FFFTANK2 PATH2_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 3 ) THEN
		(
			SET_MOVEMENT_PATH FFF PATH3_0
			SET_MOVEMENT_PATH FFFTANK1 PATH3_1
			SET_MOVEMENT_PATH FFFTANK2 PATH3_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 4 ) THEN
		(
			SET_MOVEMENT_PATH FFF PATH4_0
			SET_MOVEMENT_PATH FFFTANK1 PATH4_1
			SET_MOVEMENT_PATH FFFTANK2 PATH4_2
		)


		IF ( VBL_TEST WHICH_PAD EQUAL 5 ) THEN
		(
			SET_MOVEMENT_PATH FFF PATH5_0
			SET_MOVEMENT_PATH FFFTANK1 PATH5_1
			SET_MOVEMENT_PATH FFFTANK2 PATH5_2
		)

		CHANGE_VBL CREATE_CONVOY_TIME SET SET_CONVOY_TIME
		CHANGE_VBL CREATE_CONVOY_TIME ADD 1
		CHANGE_VBL CREATE_CONVOY SET 0
	)


	#This keeps the fortification level within 0%-100%.  Divide the number by 2 for the percentage that the base is fortified.



	#Switches for gates being up or down
	IF ( VBL_TEST FORTIFICATION GREATER_THAN_EQUAL 160 ) THEN
	(

		IF ( VBL_TEST ALL_GATE_SWITCH EQUAL 0 ) THEN
		(
			SET_GATE GATE_NORTH 0
			SET_GATE GATE_EAST 0
			SET_GATE GATE_SOUTH 0
			SET_GATE GATE_WEST 0
			IMP_GRAB_CITADEL 0
			SHOW_BILLBOARD {IMP GRABBED CITADEL \nALL GATES DROPPED}
			CHANGE_VBL ALL_GATE_SWITCH SET 1
		)
	)
	ELSE
	(
		CHANGE_VBL ALL_GATE_SWITCH SET 0

		#Droping or raising the North Gate
		IF ( OR (( OR (( CLOSE_PT AAA NORTH_GATE 5 ) ( CLOSE_PT BBB NORTH_GATE 5 )) ) ( OR (( CLOSE_PT CCC NORTH_GATE 5 ) ( CLOSE_PT DDD NORTH_GATE 5 )) )) ) THEN
		(

			IF ( VBL_TEST NORTH_GATE_SWITCH EQUAL 0 ) THEN
			(
				SET_GATE GATE_NORTH 0
				CHANGE_VBL NORTH_GATE_SWITCH SET 1
			)
		)
		ELSE
		(

			IF ( OR (( CLOSE_PT EEE NORTH_GATE 5 ) ( CLOSE_PT FFF NORTH_GATE 5 )) ) THEN
			(

				IF ( VBL_TEST NORTH_GATE_SWITCH EQUAL 0 ) THEN
				(
					SET_GATE GATE_NORTH 0
					CHANGE_VBL NORTH_GATE_SWITCH SET 1
				)
			)
			ELSE
			(

				IF ( VBL_TEST NORTH_GATE_SWITCH EQUAL 1 ) THEN
				(
					SET_GATE GATE_NORTH 1
					CHANGE_VBL NORTH_GATE_SWITCH SET 0
				)
			)
		)

		#Droping or raising the East Gate
		IF ( OR (( OR (( CLOSE_PT AAA EAST_GATE 5 ) ( CLOSE_PT BBB EAST_GATE 5 )) ) ( OR (( CLOSE_PT CCC EAST_GATE 5 ) ( CLOSE_PT DDD EAST_GATE 5 )) )) ) THEN
		(

			IF ( VBL_TEST EAST_GATE_SWITCH EQUAL 0 ) THEN
			(
				SET_GATE GATE_EAST 0
				CHANGE_VBL EAST_GATE_SWITCH SET 1
			)
		)
		ELSE
		(

			IF ( OR (( CLOSE_PT EEE EAST_GATE 5 ) ( CLOSE_PT FFF EAST_GATE 5 )) ) THEN
			(

				IF ( VBL_TEST EAST_GATE_SWITCH EQUAL 0 ) THEN
				(
					SET_GATE GATE_EAST 0
					CHANGE_VBL EAST_GATE_SWITCH SET 1
				)
			)
			ELSE
			(

				IF ( VBL_TEST EAST_GATE_SWITCH EQUAL 1 ) THEN
				(
					SET_GATE GATE_EAST 1
					CHANGE_VBL EAST_GATE_SWITCH SET 0
				)
			)
		)

		#Droping or raising the South Gate
		IF ( OR (( OR (( CLOSE_PT AAA SOUTH_GATE 5 ) ( CLOSE_PT BBB SOUTH_GATE 5 )) ) ( OR (( CLOSE_PT CCC SOUTH_GATE 5 ) ( CLOSE_PT DDD SOUTH_GATE 5 )) )) ) THEN
		(

			IF ( VBL_TEST SOUTH_GATE_SWITCH EQUAL 0 ) THEN
			(
				SET_GATE GATE_SOUTH 0
				CHANGE_VBL SOUTH_GATE_SWITCH SET 1
			)
		)
		ELSE
		(

			IF ( OR (( CLOSE_PT EEE SOUTH_GATE 5 ) ( CLOSE_PT FFF SOUTH_GATE 5 )) ) THEN
			(

				IF ( VBL_TEST SOUTH_GATE_SWITCH EQUAL 0 ) THEN
				(
					SET_GATE GATE_SOUTH 0
					CHANGE_VBL SOUTH_GATE_SWITCH SET 1
				)

			)
			ELSE
			(

				IF ( VBL_TEST SOUTH_GATE_SWITCH EQUAL 1 ) THEN
				(
					SET_GATE GATE_SOUTH 1
					CHANGE_VBL SOUTH_GATE_SWITCH SET 0
				)
			)
		)

		#Droping or raising the West Gate
		IF ( OR (( OR (( CLOSE_PT AAA WEST_GATE 5 ) ( CLOSE_PT BBB WEST_GATE 5 )) ) ( OR (( CLOSE_PT CCC WEST_GATE 5 ) ( CLOSE_PT DDD WEST_GATE 5 )) )) ) THEN
		(

			IF ( VBL_TEST WEST_GATE_SWITCH EQUAL 0 ) THEN
			(
				SET_GATE GATE_WEST 0
				CHANGE_VBL WEST_GATE_SWITCH SET 1
			)
		)
		ELSE
		(

			IF ( OR (( CLOSE_PT EEE WEST_GATE 5 ) ( CLOSE_PT FFF WEST_GATE 5 )) ) THEN
			(

				IF ( VBL_TEST WEST_GATE_SWITCH EQUAL 0 ) THEN
				(
					SET_GATE GATE_WEST 0
					CHANGE_VBL WEST_GATE_SWITCH SET 1
				)
			)
			ELSE
			(

				IF ( VBL_TEST WEST_GATE_SWITCH EQUAL 1 ) THEN
				(
					SET_GATE GATE_WEST 1
					CHANGE_VBL WEST_GATE_SWITCH SET 0
				)
			)
		)
	)


	#Setting AAA to move to the teleport pad
	IF ( OR (( CLOSE_PT AAA NORTH_GATE 5 ) ( CLOSE_PT AAA WEST_GATE 5 )) ) THEN
	(
		SET_MOVEMENT_PATH AAA END_WEST
		REMOVE_UNIT AAATANK1
		REMOVE_UNIT AAATANK2
	)
	IF ( CLOSE_PT AAA EAST_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH AAA END_EAST
		REMOVE_UNIT AAATANK1
		REMOVE_UNIT AAATANK2
	)
	IF ( CLOSE_PT AAA SOUTH_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH AAA END
		REMOVE_UNIT AAATANK1
		REMOVE_UNIT AAATANK2
	)


	#Setting BBB to move to the teleport pad
	IF ( OR (( CLOSE_PT BBB NORTH_GATE 5 ) ( CLOSE_PT BBB WEST_GATE 5 )) ) THEN
	(
		SET_MOVEMENT_PATH BBB END_WEST
		REMOVE_UNIT BBBTANK1
		REMOVE_UNIT BBBTANK2
	)
	IF ( CLOSE_PT BBB EAST_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH BBB END_EAST
		REMOVE_UNIT BBBTANK1
		REMOVE_UNIT BBBTANK2
	)
	IF ( CLOSE_PT BBB SOUTH_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH BBB END
		REMOVE_UNIT BBBTANK1
		REMOVE_UNIT BBBTANK2
	)


	#Setting CCC to move to the teleport pad
	IF ( OR (( CLOSE_PT CCC NORTH_GATE 5 ) ( CLOSE_PT CCC WEST_GATE 5 )) ) THEN
	(
		SET_MOVEMENT_PATH CCC END_WEST
		REMOVE_UNIT CCCTANK1
		REMOVE_UNIT CCCTANK2
	)
	IF ( CLOSE_PT CCC EAST_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH CCC END_EAST
		REMOVE_UNIT CCCTANK1
		REMOVE_UNIT CCCTANK2
	)
	IF ( CLOSE_PT CCC SOUTH_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH CCC END
		REMOVE_UNIT CCCTANK1
		REMOVE_UNIT CCCTANK2
	)


	#Setting DDD to move to the teleport pad
	IF ( OR (( CLOSE_PT DDD NORTH_GATE 5 ) ( CLOSE_PT DDD WEST_GATE 5 )) ) THEN
	(
		SET_MOVEMENT_PATH DDD END_WEST
		REMOVE_UNIT DDDTANK1
		REMOVE_UNIT DDDTANK2
	)
	IF ( CLOSE_PT DDD EAST_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH DDD END_EAST
		REMOVE_UNIT DDDTANK1
		REMOVE_UNIT DDDTANK2
	)
	IF ( CLOSE_PT DDD SOUTH_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH DDD END
		REMOVE_UNIT DDDTANK1
		REMOVE_UNIT DDDTANK2
	)


	#Setting EEE to move to the teleport pad
	IF ( OR (( CLOSE_PT EEE NORTH_GATE 5 ) ( CLOSE_PT EEE WEST_GATE 5 )) ) THEN
	(
		SET_MOVEMENT_PATH EEE END_WEST
		REMOVE_UNIT EEETANK1
		REMOVE_UNIT EEETANK2
	)
	IF ( CLOSE_PT EEE EAST_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH EEE END_EAST
		REMOVE_UNIT EEETANK1
		REMOVE_UNIT EEETANK2
	)
	IF ( CLOSE_PT EEE SOUTH_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH EEE END
		REMOVE_UNIT EEETANK1
		REMOVE_UNIT EEETANK2
	)


	#Setting FFF to move to the teleport pad
	IF ( OR (( CLOSE_PT FFF NORTH_GATE 5 ) ( CLOSE_PT FFF WEST_GATE 5 )) ) THEN
	(
		SET_MOVEMENT_PATH FFF END_WEST
		REMOVE_UNIT FFFTANK1
		REMOVE_UNIT FFFTANK2
	)
	IF ( CLOSE_PT FFF EAST_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH FFF END_EAST
		REMOVE_UNIT FFFTANK1
		REMOVE_UNIT FFFTANK2
	)
	IF ( CLOSE_PT FFF SOUTH_GATE 5 ) THEN
	(
		SET_MOVEMENT_PATH FFF END
		REMOVE_UNIT FFFTANK1
		REMOVE_UNIT FFFTANK2
	)


	#Increasing foritifcation for AAA making it to the base and teleporting out
	IF ( CLOSE_PT AAA END 2 ) THEN
	(
		REMOVE_UNIT AAA


		IF ( VBL_TEST AAA_STRENGTH EQUAL 0 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST AAA_STRENGTH EQUAL 1 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST AAA_STRENGTH EQUAL 2 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST AAA_STRENGTH EQUAL 3 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST AAA_STRENGTH EQUAL 4 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)


		IF ( VBL_TEST AAA_STRENGTH EQUAL 5 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)
	)


	#Increasing foritifcation for BBB making it to the base and teleporting out
	IF ( CLOSE_PT BBB END 2 ) THEN
	(
		REMOVE_UNIT BBB


		IF ( VBL_TEST BBB_STRENGTH EQUAL 0 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST BBB_STRENGTH EQUAL 1 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST BBB_STRENGTH EQUAL 2 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST BBB_STRENGTH EQUAL 3 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST BBB_STRENGTH EQUAL 4 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)


		IF ( VBL_TEST BBB_STRENGTH EQUAL 5 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)
	)


	#Increasing foritifcation for CCC making it to the base and teleporting out
	IF ( CLOSE_PT CCC END 2 ) THEN
	(
		REMOVE_UNIT CCC


		IF ( VBL_TEST CCC_STRENGTH EQUAL 0 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST CCC_STRENGTH EQUAL 1 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST CCC_STRENGTH EQUAL 2 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST CCC_STRENGTH EQUAL 3 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST CCC_STRENGTH EQUAL 4 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)


		IF ( VBL_TEST CCC_STRENGTH EQUAL 5 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)
	)


	#Increasing foritifcation for DDD making it to the base and teleporting out
	IF ( CLOSE_PT DDD END 2 ) THEN
	(
		REMOVE_UNIT DDD


		IF ( VBL_TEST DDD_STRENGTH EQUAL 0 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST DDD_STRENGTH EQUAL 1 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST DDD_STRENGTH EQUAL 2 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST DDD_STRENGTH EQUAL 3 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST DDD_STRENGTH EQUAL 4 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)


		IF ( VBL_TEST DDD_STRENGTH EQUAL 5 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)
	)


	#Increasing foritifcation for EEE making it to the base and teleporting out
	IF ( CLOSE_PT EEE END 2 ) THEN
	(
		REMOVE_UNIT EEE


		IF ( VBL_TEST EEE_STRENGTH EQUAL 0 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST EEE_STRENGTH EQUAL 1 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST EEE_STRENGTH EQUAL 2 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST EEE_STRENGTH EQUAL 3 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST EEE_STRENGTH EQUAL 4 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)


		IF ( VBL_TEST EEE_STRENGTH EQUAL 5 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)
	)


	#Increasing foritifcation for FFF making it to the base and teleporting out
	IF ( CLOSE_PT FFF END 2 ) THEN
	(
		REMOVE_UNIT FFF


		IF ( VBL_TEST FFF_STRENGTH EQUAL 0 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST FFF_STRENGTH EQUAL 1 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 10
		)


		IF ( VBL_TEST FFF_STRENGTH EQUAL 2 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST FFF_STRENGTH EQUAL 3 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 20
		)


		IF ( VBL_TEST FFF_STRENGTH EQUAL 4 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)


		IF ( VBL_TEST FFF_STRENGTH EQUAL 5 ) THEN
		(
			CHANGE_VBL FORTIFICATION ADD 30
		)
	)



	IF ( IS_ALIVE AAA ) THEN
	(
		CHANGE_VBL AAA_PU SET 0
		GET_LOCATION AAA AAA_LOC
	)



	IF ( VBL_TEST AAA_PU EQUAL 0 ) THEN
	(

		IF ( DIED_VIOLENT AAA ) THEN
		(

			IF ( VBL_TEST AAA_STRENGTH EQUAL 0 ) THEN
			(
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST AAA_STRENGTH EQUAL 1 ) THEN
			(
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST AAA_STRENGTH EQUAL 2 ) THEN
			(
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST AAA_STRENGTH EQUAL 3 ) THEN
			(
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST AAA_STRENGTH EQUAL 4 ) THEN
			(
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST AAA_STRENGTH EQUAL 5 ) THEN
			(
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 AAA_LOC PU_RANDOM 1
			)

			CHANGE_VBL AAA_ESCORT_TIME SET GAME_TIME
			CHANGE_VBL AAA_ESCORT_TIME ADD 30
			CHANGE_VBL AAA_ESCORT SET 0
			CHANGE_VBL AAA_PU SET 1
		)
	)



	IF ( VBL_TEST AAA_ESCORT EQUAL 0 ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL AAA_ESCORT_TIME ) THEN
		(
			REMOVE_UNIT AAATANK1
			REMOVE_UNIT AAATANK2
			CHANGE_VBL AAA_ESCORT SET 1
		)
	)



	IF ( IS_ALIVE BBB ) THEN
	(
		CHANGE_VBL BBB_PU SET 0
		GET_LOCATION BBB BBB_LOC
	)




	IF ( VBL_TEST BBB_PU EQUAL 0 ) THEN
	(

		IF ( DIED_VIOLENT BBB ) THEN
		(

			IF ( VBL_TEST BBB_STRENGTH EQUAL 0 ) THEN
			(
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST BBB_STRENGTH EQUAL 1 ) THEN
			(
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST BBB_STRENGTH EQUAL 2 ) THEN
			(
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST BBB_STRENGTH EQUAL 3 ) THEN
			(
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST BBB_STRENGTH EQUAL 4 ) THEN
			(
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST BBB_STRENGTH EQUAL 5 ) THEN
			(
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 BBB_LOC PU_RANDOM 1
			)

			CHANGE_VBL BBB_ESCORT_TIME SET GAME_TIME
			CHANGE_VBL BBB_ESCORT_TIME ADD 30
			CHANGE_VBL BBB_ESCORT SET 0
			CHANGE_VBL BBB_PU SET 1
		)
	)



	IF ( VBL_TEST BBB_ESCORT EQUAL 0 ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL BBB_ESCORT_TIME ) THEN
		(
			REMOVE_UNIT BBBTANK1
			REMOVE_UNIT BBBTANK2
			CHANGE_VBL BBB_ESCORT SET 1
		)
	)



	IF ( IS_ALIVE CCC ) THEN
	(
		CHANGE_VBL CCC_PU SET 0
		GET_LOCATION CCC CCC_LOC
	)




	IF ( VBL_TEST CCC_PU EQUAL 0 ) THEN
	(

		IF ( DIED_VIOLENT CCC ) THEN
		(

			IF ( VBL_TEST CCC_STRENGTH EQUAL 0 ) THEN
			(
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST CCC_STRENGTH EQUAL 1 ) THEN
			(
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST CCC_STRENGTH EQUAL 2 ) THEN
			(
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST CCC_STRENGTH EQUAL 3 ) THEN
			(
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST CCC_STRENGTH EQUAL 4 ) THEN
			(
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST CCC_STRENGTH EQUAL 5 ) THEN
			(
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 CCC_LOC PU_RANDOM 1
			)

			CHANGE_VBL CCC_ESCORT_TIME SET GAME_TIME
			CHANGE_VBL CCC_ESCORT_TIME ADD 30
			CHANGE_VBL CCC_ESCORT SET 0
			CHANGE_VBL CCC_PU SET 1
		)
	)



	IF ( VBL_TEST CCC_ESCORT EQUAL 0 ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL CCC_ESCORT_TIME ) THEN
		(
			REMOVE_UNIT CCCTANK1
			REMOVE_UNIT CCCTANK2
			CHANGE_VBL CCC_ESCORT SET 1
		)
	)



	IF ( IS_ALIVE DDD ) THEN
	(
		CHANGE_VBL DDD_PU SET 0
		GET_LOCATION DDD DDD_LOC
	)




	IF ( VBL_TEST DDD_PU EQUAL 0 ) THEN
	(

		IF ( DIED_VIOLENT DDD ) THEN
		(

			IF ( VBL_TEST DDD_STRENGTH EQUAL 0 ) THEN
			(
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST DDD_STRENGTH EQUAL 1 ) THEN
			(
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST DDD_STRENGTH EQUAL 2 ) THEN
			(
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST DDD_STRENGTH EQUAL 3 ) THEN
			(
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST DDD_STRENGTH EQUAL 4 ) THEN
			(
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST DDD_STRENGTH EQUAL 5 ) THEN
			(
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 DDD_LOC PU_RANDOM 1
			)

			CHANGE_VBL DDD_ESCORT_TIME SET GAME_TIME
			CHANGE_VBL DDD_ESCORT_TIME ADD 30
			CHANGE_VBL DDD_ESCORT SET 0
			CHANGE_VBL DDD_PU SET 1
		)
	)



	IF ( VBL_TEST DDD_ESCORT EQUAL 0 ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL DDD_ESCORT_TIME ) THEN
		(
			REMOVE_UNIT DDDTANK1
			REMOVE_UNIT DDDTANK2
			CHANGE_VBL DDD_ESCORT SET 1
		)
	)



	IF ( IS_ALIVE EEE ) THEN
	(
		CHANGE_VBL EEE_PU SET 0
		GET_LOCATION EEE EEE_LOC
	)



	IF ( VBL_TEST EEE_PU EQUAL 0 ) THEN
	(

		IF ( DIED_VIOLENT EEE ) THEN
		(

			IF ( VBL_TEST EEE_STRENGTH EQUAL 0 ) THEN
			(
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST EEE_STRENGTH EQUAL 1 ) THEN
			(
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST EEE_STRENGTH EQUAL 2 ) THEN
			(
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST EEE_STRENGTH EQUAL 3 ) THEN
			(
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST EEE_STRENGTH EQUAL 4 ) THEN
			(
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST EEE_STRENGTH EQUAL 5 ) THEN
			(
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 EEE_LOC PU_RANDOM 1
			)

			CHANGE_VBL EEE_ESCORT_TIME SET GAME_TIME
			CHANGE_VBL EEE_ESCORT_TIME ADD 30
			CHANGE_VBL EEE_ESCORT SET 0
			CHANGE_VBL EEE_PU SET 1
		)
	)



	IF ( VBL_TEST EEE_ESCORT EQUAL 0 ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL EEE_ESCORT_TIME ) THEN
		(
			REMOVE_UNIT EEETANK1
			REMOVE_UNIT EEETANK2
			CHANGE_VBL EEE_ESCORT SET 1
		)
	)



	IF ( IS_ALIVE FFF ) THEN
	(
		CHANGE_VBL FFF_PU SET 0
		GET_LOCATION FFF FFF_LOC
	)



	IF ( VBL_TEST FFF_PU EQUAL 0 ) THEN
	(

		IF ( DIED_VIOLENT FFF ) THEN
		(

			IF ( VBL_TEST FFF_STRENGTH EQUAL 0 ) THEN
			(
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST FFF_STRENGTH EQUAL 1 ) THEN
			(
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST FFF_STRENGTH EQUAL 2 ) THEN
			(
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST FFF_STRENGTH EQUAL 3 ) THEN
			(
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST FFF_STRENGTH EQUAL 4 ) THEN
			(
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
			)


			IF ( VBL_TEST FFF_STRENGTH EQUAL 5 ) THEN
			(
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
				CREATE_FIXED_PU NULL 0 FFF_LOC PU_RANDOM 1
			)

			CHANGE_VBL FFF_ESCORT_TIME SET GAME_TIME
			CHANGE_VBL FFF_ESCORT_TIME ADD 30
			CHANGE_VBL FFF_ESCORT SET 0
			CHANGE_VBL FFF_PU SET 1
		)
	)



	IF ( VBL_TEST FFF_ESCORT EQUAL 0 ) THEN
	(

		IF ( VBL_TEST GAME_TIME GREATER_THAN_EQUAL FFF_ESCORT_TIME ) THEN
		(
			REMOVE_UNIT FFFTANK1
			REMOVE_UNIT FFFTANK2
			CHANGE_VBL FFF_ESCORT SET 1
		)
	)



			##########Fortification of the Base##########

	#The following calculates the level of fortification
	COUNT_OBJECTS 5 AITANK_GNRTR_BLDG AITANK_GNRTR_COUNT
	COUNT_OBJECTS 5 SLDR_GNRTR_BLDG   SLDR_GNRTR_COUNT
	COUNT_OBJECTS 5 AAV_GNRTR_BLDG    AAV_GNRTR_COUNT
	COUNT_OBJECTS 5 LIGHT_TURRET      LIGHT_TURRET_COUNT
	COUNT_OBJECTS 5 HEAVY_TURRET      HEAVY_TURRET_COUNT
	COUNT_OBJECTS 5 SAMS              SAMS_COUNT

	CHANGE_VBL AITANK_GNRTR_VALUE SET AITANK_GNRTR_COUNT
	CHANGE_VBL SLDR_GNRTR_VALUE   SET SLDR_GNRTR_COUNT
	CHANGE_VBL AAV_GNRTR_VALUE    SET AAV_GNRTR_COUNT
	CHANGE_VBL LIGHT_TURRET_VALUE SET LIGHT_TURRET_COUNT
	CHANGE_VBL HEAVY_TURRET_VALUE SET HEAVY_TURRET_COUNT
	CHANGE_VBL SAMS_VALUE         SET SAMS_COUNT

	CHANGE_VBL AITANK_GNRTR_VALUE MUL 7
	CHANGE_VBL SLDR_GNRTR_VALUE   MUL 4
	CHANGE_VBL AAV_GNRTR_VALUE    MUL 6
	CHANGE_VBL LIGHT_TURRET_VALUE MUL 3
	CHANGE_VBL HEAVY_TURRET_VALUE MUL 5
	CHANGE_VBL SAMS_VALUE         MUL 3

	CHANGE_VBL FORT_CHANGE   SET FORTIFICATION
	CHANGE_VBL FORTIFICATION SET 0
	CHANGE_VBL FORTIFICATION ADD AITANK_GNRTR_VALUE
	CHANGE_VBL FORTIFICATION ADD SLDR_GNRTR_VALUE
	CHANGE_VBL FORTIFICATION ADD AAV_GNRTR_VALUE
	CHANGE_VBL FORTIFICATION ADD LIGHT_TURRET_VALUE
	CHANGE_VBL FORTIFICATION ADD HEAVY_TURRET_VALUE
	CHANGE_VBL FORTIFICATION ADD SAMS_VALUE
	CHANGE_VBL FORT_CHANGE   SUB FORTIFICATION

	#Build is the vbl used to decided what location on the map to place the created unit
	CHANGE_VBL BUILD SET RANDOM_INT 16


	IF ( VBL_TEST LIGHT_TURRET_COUNT LESS_THAN 16 ) THEN
	(
		CHANGE_VBL LIGHT_TURRET SET 0
		CHANGE_VBL SAMS         SET 1
		CHANGE_VBL HEAVY_TURRET SET 1
		CHANGE_VBL INFANTRY     SET 1
		CHANGE_VBL TANK         SET 1
		CHANGE_VBL AAV          SET 1
	)
	ELSE
	(

		IF ( VBL_TEST SAMS_COUNT LESS_THAN 4 ) THEN
		(
			CHANGE_VBL LIGHT_TURRET SET 1
			CHANGE_VBL SAMS         SET 0
			CHANGE_VBL HEAVY_TURRET SET 1
			CHANGE_VBL INFANTRY     SET 1
			CHANGE_VBL TANK         SET 1
			CHANGE_VBL AAV          SET 1
		)
		ELSE
		(

			IF ( VBL_TEST HEAVY_TURRET_COUNT LESS_THAN 12 ) THEN
			(
				CHANGE_VBL LIGHT_TURRET SET 1
				CHANGE_VBL SAMS         SET 1
				CHANGE_VBL HEAVY_TURRET SET 0
				CHANGE_VBL INFANTRY     SET 1
				CHANGE_VBL TANK         SET 1
				CHANGE_VBL AAV          SET 1
			)
			ELSE
			(
				SHOW_BILLBOARD {HEAVY TURRETS ARE BUILT!!}
			)
		)
	)




	#Creating light turrets
	IF ( VBL_TEST FORT_CHANGE GREATER_THAN_EQUAL 3 ) THEN
	(

		IF ( VBL_TEST LIGHT_TURRET EQUAL 0 ) THEN
		(

			IF ( VBL_TEST BUILD EQUAL 0 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO1_LT1 ) ) THEN
				(
					CREATE_UNIT RO1_LT1 5 LIGHT_TURRET LOC ( 112, 204, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 1 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO1_LT2 ) ) THEN
				(
					CREATE_UNIT RO1_LT2 5 LIGHT_TURRET LOC ( 144, 204, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 3 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO3_LT1 ) ) THEN
				(
					CREATE_UNIT RO3_LT1 5 LIGHT_TURRET LOC ( 200, 144, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 3 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO3_LT2 ) ) THEN
				(
					CREATE_UNIT RO3_LT2 5 LIGHT_TURRET LOC ( 200, 120, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 4 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO5_LT1 ) ) THEN
				(
					CREATE_UNIT RO5_LT1 5 LIGHT_TURRET LOC ( 144, 64, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 5 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO5_LT2 ) ) THEN
				(
					CREATE_UNIT RO5_LT2 5 LIGHT_TURRET LOC ( 112, 64, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 6 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO7_LT1 ) ) THEN
				(
					CREATE_UNIT RO7_LT1 5 LIGHT_TURRET LOC ( 56, 120, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 7 ) THEN
			(

				IF ( NOT ( IS_ALIVE RO7_LT2 ) ) THEN
				(
					CREATE_UNIT RO7_LT2 5 LIGHT_TURRET LOC ( 56, 144, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 8 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI1_LT1 ) ) THEN
				(
					CREATE_UNIT RI1_LT1 5 LIGHT_TURRET LOC ( 152, 172, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 9 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI1_LT2 ) ) THEN
				(
					CREATE_UNIT RI1_LT2 5 LIGHT_TURRET LOC ( 168, 160, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 10 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI2_LT1 ) ) THEN
				(
					CREATE_UNIT RI2_LT1 5 LIGHT_TURRET LOC ( 168, 112, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 11 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI2_LT2 ) ) THEN
				(
					CREATE_UNIT RI2_LT2 5 LIGHT_TURRET LOC ( 152, 96, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 12 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI3_LT1 ) ) THEN
				(
					CREATE_UNIT RI3_LT1 5 LIGHT_TURRET LOC ( 104, 96, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 13 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI3_LT2 ) ) THEN
				(
					CREATE_UNIT RI3_LT2 5 LIGHT_TURRET LOC ( 88, 112, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 14 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI4_LT1 ) ) THEN
				(
					CREATE_UNIT RI4_LT1 5 LIGHT_TURRET LOC ( 88, 160, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 15 ) THEN
			(

				IF ( NOT ( IS_ALIVE RI4_LT2 ) ) THEN
				(
					CREATE_UNIT RI4_LT2 5 LIGHT_TURRET LOC ( 104, 172, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL LIGHT_TURRET SET 1
				)
			)
		)


		#Creating SAMs
		IF ( VBL_TEST SAMS EQUAL 0 ) THEN
		(

			FOR A EQUAL 0 TO 3 DO
			(

				IF ( VBL_TEST BUILD EQUAL A ) THEN
				(

					IF ( NOT ( IS_ALIVE RI1_S ) ) THEN
					(
						CREATE_UNIT RI1_S 5 SAMS LOC ( 148, 156, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL SAMS SET 1
					)
				)
			)


			FOR B EQUAL 4 TO 7 DO
			(

				IF ( VBL_TEST BUILD EQUAL B ) THEN
				(

					IF ( NOT ( IS_ALIVE RI2_S ) ) THEN
					(
						CREATE_UNIT RI2_S 5 SAMS LOC ( 148, 112, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL SAMS SET 1
					)
				)
			)


			FOR C EQUAL 8 TO 11 DO
			(

				IF ( VBL_TEST BUILD EQUAL C ) THEN
				(

					IF ( NOT ( IS_ALIVE RI3_S ) ) THEN
					(
						CREATE_UNIT RI3_S 5 SAMS LOC ( 108, 112, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL SAMS SET 1
					)
				)
			)


			FOR D EQUAL 12 TO 15 DO
			(

				IF ( VBL_TEST BUILD EQUAL D ) THEN
				(

					IF ( NOT ( IS_ALIVE RI4_S ) ) THEN
					(
						CREATE_UNIT RI4_S 5 SAMS LOC ( 108, 156, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL SAMS SET 1
					)
				)
			)
		)
	)


	#Creating infantry generator buildings
	IF ( VBL_TEST FORT_CHANGE GREATER_THAN_EQUAL 4 ) THEN
	(

		IF ( VBL_TEST INFANTRY EQUAL 0 ) THEN
		(

			IF ( VBL_TEST SLDR_GNRTR_COUNT LESS_THAN 5 ) THEN
			(

				IF ( VBL_TEST BUILD EQUAL 0 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R01_BI ) ) ( OR (( NOT ( IS_ALIVE R01_BT ) ) ( NOT ( IS_ALIVE R01_BA ) )) )) ) THEN
					(
						CREATE_UNIT R01_BI 5 SLDR_GNRTR_BLDG LOC ( 128, 204, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 1 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R02_BI ) ) ( OR (( NOT ( IS_ALIVE R02_BT ) ) ( NOT ( IS_ALIVE R02_BA ) )) )) ) THEN
					(
						CREATE_UNIT R02_BI 5 SLDR_GNRTR_BLDG LOC ( 197, 180, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 2 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R03_BI ) ) ( OR (( NOT ( IS_ALIVE R03_BT ) ) ( NOT ( IS_ALIVE R03_BA ) )) )) ) THEN
					(
						CREATE_UNIT R03_BI 5 SLDR_GNRTR_BLDG LOC ( 201, 132, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 3 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R04_BI ) ) ( OR (( NOT ( IS_ALIVE R04_BT ) ) ( NOT ( IS_ALIVE R04_BA ) )) )) ) THEN
					(
						CREATE_UNIT R04_BI 5 SLDR_GNRTR_BLDG LOC ( 197, 84, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 4 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R05_BI ) ) ( OR (( NOT ( IS_ALIVE R05_BT ) ) ( NOT ( IS_ALIVE R05_BA ) )) )) ) THEN
					(
						CREATE_UNIT R05_BI 5 SLDR_GNRTR_BLDG LOC ( 128, 64, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 5 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R06_BI ) ) ( OR (( NOT ( IS_ALIVE R06_BT ) ) ( NOT ( IS_ALIVE R06_BA ) )) )) ) THEN
					(
						CREATE_UNIT R06_BI 5 SLDR_GNRTR_BLDG LOC ( 59, 84, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 6 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R07_BI ) ) ( OR (( NOT ( IS_ALIVE R07_BT ) ) ( NOT ( IS_ALIVE R07_BA ) )) )) ) THEN
					(
						CREATE_UNIT R07_BI 5 SLDR_GNRTR_BLDG LOC ( 55, 132, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 7 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R08_BI ) ) ( OR (( NOT ( IS_ALIVE R08_BT ) ) ( NOT ( IS_ALIVE R08_BA ) )) )) ) THEN
					(
						CREATE_UNIT R08_BI 5 SLDR_GNRTR_BLDG LOC ( 57, 180, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 8 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI1_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI1_BT1 ) ) ( NOT ( IS_ALIVE RI1_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI1_BI1 5 SLDR_GNRTR_BLDG LOC ( 141, 168, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 9 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI1_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI1_BT2 ) ) ( NOT ( IS_ALIVE RI1_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI1_BI2 5 SLDR_GNRTR_BLDG LOC ( 163, 148, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 10 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI2_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI2_BT1 ) ) ( NOT ( IS_ALIVE RI2_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI2_BI1 5 SLDR_GNRTR_BLDG LOC ( 163, 124, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 11 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI2_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI2_BT2 ) ) ( NOT ( IS_ALIVE RI2_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI2_BI2 5 SLDR_GNRTR_BLDG LOC ( 141, 100, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 12 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI3_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI3_BT1 ) ) ( NOT ( IS_ALIVE RI3_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI3_BI1 5 SLDR_GNRTR_BLDG LOC ( 115, 100, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 13 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI3_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI3_BT2 ) ) ( NOT ( IS_ALIVE RI3_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI3_BI2 5 SLDR_GNRTR_BLDG LOC ( 93, 124, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 14 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI4_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI4_BT1 ) ) ( NOT ( IS_ALIVE RI4_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI4_BI1 5 SLDR_GNRTR_BLDG LOC ( 93, 148, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 15 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI4_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI4_BT2 ) ) ( NOT ( IS_ALIVE RI4_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI4_BI2 5 SLDR_GNRTR_BLDG LOC ( 115, 168, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL INFANTRY SET 1
					)
				)
			)
			ELSE
			(
				CHANGE_VBL INFANTRY SET 1
			)
		)
	)



	IF ( VBL_TEST FORT_CHANGE GREATER_THAN_EQUAL 5 ) THEN
	(

		IF ( VBL_TEST HEAVY_TURRET EQUAL 0 ) THEN
		(

			IF ( VBL_TEST BUILD EQUAL 0 ) THEN
			(

				IF ( NOT ( IS_ALIVE R01_HT1 ) ) THEN
				(
					CREATE_UNIT R01_HT1 5 HEAVY_TURRET LOC ( 96, 232, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 1 ) THEN
			(

				IF ( NOT ( IS_ALIVE R01_HT2 ) ) THEN
				(
					CREATE_UNIT R01_HT2 5 HEAVY_TURRET LOC ( 166, 232, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( OR (( VBL_TEST BUILD EQUAL 2 ) ( VBL_TEST BUILD EQUAL 3 )) ) THEN
			(

				IF ( NOT ( IS_ALIVE R02_HT1 ) ) THEN
				(
					CREATE_UNIT R02_HT1 5 HEAVY_TURRET LOC ( 192, 232, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 4 ) THEN
			(

				IF ( NOT ( IS_ALIVE R03_HT1 ) ) THEN
				(
					CREATE_UNIT R03_HT1 5 HEAVY_TURRET LOC ( 228, 152, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 5 ) THEN
			(

				IF ( NOT ( IS_ALIVE R03_HT2 ) ) THEN
				(
					CREATE_UNIT R03_HT2 5 HEAVY_TURRET LOC ( 228, 112, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( OR (( VBL_TEST BUILD EQUAL 6 ) ( VBL_TEST BUILD EQUAL 7 )) ) THEN
			(

				IF ( NOT ( IS_ALIVE R04_HT1 ) ) THEN
				(
					CREATE_UNIT R04_HT1 5 HEAVY_TURRET LOC ( 192, 28, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 8 ) THEN
			(

				IF ( NOT ( IS_ALIVE R05_HT1 ) ) THEN
				(
					CREATE_UNIT R05_HT1 5 HEAVY_TURRET LOC ( 160, 28, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 9 ) THEN
			(

				IF ( NOT ( IS_ALIVE R05_HT2 ) ) THEN
				(
					CREATE_UNIT R05_HT2 5 HEAVY_TURRET LOC ( 96, 28, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( OR (( VBL_TEST BUILD EQUAL 10 ) ( VBL_TEST BUILD EQUAL 11 )) ) THEN
			(

				IF ( NOT ( IS_ALIVE R06_HT1 ) ) THEN
				(
					CREATE_UNIT R06_HT1 5 HEAVY_TURRET LOC ( 64, 28, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 12 ) THEN
			(

				IF ( NOT ( IS_ALIVE R07_HT1 ) ) THEN
				(
					CREATE_UNIT R07_HT1 5 HEAVY_TURRET LOC ( 28, 112, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( VBL_TEST BUILD EQUAL 13 ) THEN
			(

				IF ( NOT ( IS_ALIVE R07_HT2 ) ) THEN
				(
					CREATE_UNIT R07_HT2 5 HEAVY_TURRET LOC ( 28, 152, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)


			IF ( AND (( VBL_TEST BUILD EQUAL 14 ) ( VBL_TEST BUILD EQUAL 15 )) ) THEN
			(

				IF ( NOT ( IS_ALIVE R08_HT1 ) ) THEN
				(
					CREATE_UNIT R08_HT1 5 HEAVY_TURRET LOC ( 64, 232, 0 ) YAW (0) NULL NULL
				)
				ELSE
				(
					CHANGE_VBL HEAVY_TURRET SET 1
				)
			)
		)
		ELSE
		(
			CHANGE_VBL HEAVY_TURRET SET 1
		)
	)



	#Creating AAV generator buildings
	IF ( VBL_TEST FORT_CHANGE GREATER_THAN_EQUAL 6 ) THEN
	(

		IF ( VBL_TEST AAV EQUAL 0 ) THEN
		(

			IF ( VBL_TEST AAV_GNRTR_COUNT LESS_THAN 5 ) THEN
			(

				IF ( VBL_TEST BUILD EQUAL 0 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R01_BI ) ) ( OR (( NOT ( IS_ALIVE R01_BT ) ) ( NOT ( IS_ALIVE R01_BA ) )) )) ) THEN
					(
						CREATE_UNIT R01_BA 5 AAV_GNRTR_BLDG LOC ( 128, 204, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 1 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R02_BI ) ) ( OR (( NOT ( IS_ALIVE R02_BT ) ) ( NOT ( IS_ALIVE R02_BA ) )) )) ) THEN
					(
						CREATE_UNIT R02_BA 5 AAV_GNRTR_BLDG LOC ( 197, 180, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 2 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R03_BI ) ) ( OR (( NOT ( IS_ALIVE R03_BT ) ) ( NOT ( IS_ALIVE R03_BA ) )) )) ) THEN
					(
						CREATE_UNIT R03_BA 5 AAV_GNRTR_BLDG LOC ( 201, 132, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 3 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R04_BI ) ) ( OR (( NOT ( IS_ALIVE R04_BT ) ) ( NOT ( IS_ALIVE R04_BA ) )) )) ) THEN
					(
						CREATE_UNIT R04_BA 5 AAV_GNRTR_BLDG LOC ( 197, 84, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 4 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R05_BI ) ) ( OR (( NOT ( IS_ALIVE R05_BT ) ) ( NOT ( IS_ALIVE R05_BA ) )) )) ) THEN
					(
						CREATE_UNIT R05_BA 5 AAV_GNRTR_BLDG LOC ( 128, 64, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 5 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R06_BI ) ) ( OR (( NOT ( IS_ALIVE R06_BT ) ) ( NOT ( IS_ALIVE R06_BA ) )) )) ) THEN
					(
						CREATE_UNIT R06_BA 5 AAV_GNRTR_BLDG LOC ( 59, 84, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 6 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R07_BI ) ) ( OR (( NOT ( IS_ALIVE R07_BT ) ) ( NOT ( IS_ALIVE R07_BA ) )) )) ) THEN
					(
						CREATE_UNIT R07_BA 5 AAV_GNRTR_BLDG LOC ( 55, 132, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 7 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R08_BI ) ) ( OR (( NOT ( IS_ALIVE R08_BT ) ) ( NOT ( IS_ALIVE R08_BA ) )) )) ) THEN
					(
						CREATE_UNIT R08_BA 5 AAV_GNRTR_BLDG LOC ( 57, 180, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 8 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI1_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI1_BT1 ) ) ( NOT ( IS_ALIVE RI1_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI1_BA1 5 AAV_GNRTR_BLDG LOC ( 141, 168, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 9 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI1_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI1_BT2 ) ) ( NOT ( IS_ALIVE RI1_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI1_BA2 5 AAV_GNRTR_BLDG LOC ( 163, 148, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 10 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI2_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI2_BT1 ) ) ( NOT ( IS_ALIVE RI2_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI2_BA1 5 AAV_GNRTR_BLDG LOC ( 163, 124, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 11 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI2_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI2_BT2 ) ) ( NOT ( IS_ALIVE RI2_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI2_BA2 5 AAV_GNRTR_BLDG LOC ( 141, 100, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 12 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI3_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI3_BT1 ) ) ( NOT ( IS_ALIVE RI3_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI3_BA1 5 AAV_GNRTR_BLDG LOC ( 115, 100, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 13 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI3_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI3_BT2 ) ) ( NOT ( IS_ALIVE RI3_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI3_BA2 5 AAV_GNRTR_BLDG LOC ( 93, 124, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 14 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI4_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI4_BT1 ) ) ( NOT ( IS_ALIVE RI4_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI4_BA1 5 AAV_GNRTR_BLDG LOC ( 93, 148, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 15 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI4_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI4_BT2 ) ) ( NOT ( IS_ALIVE RI4_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI4_BA2 5 AAV_GNRTR_BLDG LOC ( 115, 168, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL AAV SET 1
					)
				)
			)
			ELSE
			(
				CHANGE_VBL AAV SET 1
			)
		)
	)

	#Creating tank generator buildings
	IF ( VBL_TEST FORT_CHANGE GREATER_THAN_EQUAL 7 ) THEN
	(

		IF ( VBL_TEST TANK EQUAL 0 ) THEN
		(

			IF ( VBL_TEST AITANK_GNRTR_COUNT LESS_THAN 5 ) THEN
			(

				IF ( VBL_TEST BUILD EQUAL 0 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R01_BI ) ) ( OR (( NOT ( IS_ALIVE R01_BT ) ) ( NOT ( IS_ALIVE R01_BA ) )) )) ) THEN
					(
						CREATE_UNIT R01_BT 5 AITANK_GNRTR_BLDG LOC ( 128, 204, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 1 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R02_BI ) ) ( OR (( NOT ( IS_ALIVE R02_BT ) ) ( NOT ( IS_ALIVE R02_BA ) )) )) ) THEN
					(
						CREATE_UNIT R02_BT 5 AITANK_GNRTR_BLDG LOC ( 197, 180, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 2 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R03_BI ) ) ( OR (( NOT ( IS_ALIVE R03_BT ) ) ( NOT ( IS_ALIVE R03_BA ) )) )) ) THEN
					(
						CREATE_UNIT R03_BT 5 AITANK_GNRTR_BLDG LOC ( 201, 132, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 3 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R04_BI ) ) ( OR (( NOT ( IS_ALIVE R04_BT ) ) ( NOT ( IS_ALIVE R04_BA ) )) )) ) THEN
					(
						CREATE_UNIT R04_BT 5 AITANK_GNRTR_BLDG LOC ( 197, 84, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 4 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R05_BI ) ) ( OR (( NOT ( IS_ALIVE R05_BT ) ) ( NOT ( IS_ALIVE R05_BA ) )) )) ) THEN
					(
						CREATE_UNIT R05_BT 5 AITANK_GNRTR_BLDG LOC ( 128, 64, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 5 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R06_BI ) ) ( OR (( NOT ( IS_ALIVE R06_BT ) ) ( NOT ( IS_ALIVE R06_BA ) )) )) ) THEN
					(
						CREATE_UNIT R06_BT 5 AITANK_GNRTR_BLDG LOC ( 59, 84, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 6 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R07_BI ) ) ( OR (( NOT ( IS_ALIVE R07_BT ) ) ( NOT ( IS_ALIVE R07_BA ) )) )) ) THEN
					(
						CREATE_UNIT R07_BT 5 AITANK_GNRTR_BLDG LOC ( 55, 132, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 7 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE R08_BI ) ) ( OR (( NOT ( IS_ALIVE R08_BT ) ) ( NOT ( IS_ALIVE R08_BA ) )) )) ) THEN
					(
						CREATE_UNIT R08_BT 5 AITANK_GNRTR_BLDG LOC ( 57, 180, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 8 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI1_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI1_BT1 ) ) ( NOT ( IS_ALIVE RI1_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI1_BT1 5 AITANK_GNRTR_BLDG LOC ( 141, 168, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 9 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI1_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI1_BT2 ) ) ( NOT ( IS_ALIVE RI1_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI1_BT2 5 AITANK_GNRTR_BLDG LOC ( 163, 148, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 10 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI2_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI2_BT1 ) ) ( NOT ( IS_ALIVE RI2_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI2_BT1 5 AITANK_GNRTR_BLDG LOC ( 163, 124, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 11 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI2_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI2_BT2 ) ) ( NOT ( IS_ALIVE RI2_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI2_BT2 5 AITANK_GNRTR_BLDG LOC ( 141, 100, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 12 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI3_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI3_BT1 ) ) ( NOT ( IS_ALIVE RI3_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI3_BT1 5 AITANK_GNRTR_BLDG LOC ( 115, 100, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 13 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI3_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI3_BT2 ) ) ( NOT ( IS_ALIVE RI3_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI3_BT2 5 AITANK_GNRTR_BLDG LOC ( 93, 124, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 14 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI4_BI1 ) ) ( OR (( NOT ( IS_ALIVE RI4_BT1 ) ) ( NOT ( IS_ALIVE RI4_BA1 ) )) )) ) THEN
					(
						CREATE_UNIT RI4_BT1 5 AITANK_GNRTR_BLDG LOC ( 93, 148, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)


				IF ( VBL_TEST BUILD EQUAL 15 ) THEN
				(

					IF ( OR (( NOT ( IS_ALIVE RI4_BI2 ) ) ( OR (( NOT ( IS_ALIVE RI4_BT2 ) ) ( NOT ( IS_ALIVE RI4_BA2 ) )) )) ) THEN
					(
						CREATE_UNIT RI4_BT2 5 AITANK_GNRTR_BLDG LOC ( 115, 168, 0 ) YAW (0) NULL NULL
					)
					ELSE
					(
						CHANGE_VBL TANK SET 1
					)
				)
			)
			ELSE
			(
				CHANGE_VBL TANK SET 1
			)
		)
	)


END_SCRIPT_FILE








			ELSE
			(

				IF ( VBL_TEST SLDR_GNRTR_COUNT LESS_THAN 5 ) THEN
				(
					CHANGE_VBL LIGHT_TURRET SET 1
					CHANGE_VBL SAMS         SET 1
					CHANGE_VBL HEAVY_TURRET SET 1
					CHANGE_VBL INFANTRY     SET 0
					CHANGE_VBL TANK         SET 1
					CHANGE_VBL AAV          SET 1
				)
				ELSE
				(

					IF ( VBL_TEST AITANK_GNRTR_COUNT LESS_THAN 7 ) THEN
					(
						CHANGE_VBL LIGHT_TURRET SET 1
						CHANGE_VBL SAMS         SET 1
						CHANGE_VBL HEAVY_TURRET SET 1
						CHANGE_VBL INFANTRY     SET 1
						CHANGE_VBL TANK         SET 0
						CHANGE_VBL AAV          SET 1
					)
					ELSE
					(

						IF ( VBL_TEST AAV_GNRTR_COUNT LESS_THAN 3 ) THEN
						(
							CHANGE_VBL LIGHT_TURRET SET 1
							CHANGE_VBL SAMS         SET 1
							CHANGE_VBL HEAVY_TURRET SET 1
							CHANGE_VBL INFANTRY     SET 1
							CHANGE_VBL TANK         SET 1
							CHANGE_VBL AAV          SET 0
						)
						ELSE
						(
							SHOW_BILLBOARD {FUCKING DONE!!!}
						)
					)
				)
			)
		)
	)
