Dwood
September 6th, 2009, 10:29 AM
There are two ways to do this, One has to be with weapons, and therefore only works on CTF gametypes. 2nd, is with attaching vehicles to players.
Why? because it requires that you be able to track what team an individual player is on.
Okay, so let's begin with the outline of the idea. So you're an enterprising mapper and want to replicate tf2 with your own little twists.
Let's focus on Blue team.
We're going to want 1 boolean for each member of the blue team.
(global boolean reddoor1 false)
Repeat that code until you have 8 booleans, using the same scheme. This is going to tell us if the door is open or not. Now, you could go the extra step and kill a biped instead of using a boolean to tell everyone the certain door is open, but that's not for right now.
Beware, Halo Script is Case-sensitive.
Next up: ;; Volume test <REDDOOR#> for an object, <BLUE#>
REDDOOR# is a volume trigger, and BLUE# can be almost anything that syncs. BLUE# will be an object that we attach to the players in order to track them and be sure that RED team cannot activate blue's triggers.
In this case, Blue will be the attackers and red will be the defenders.
Start out the code as follows:
(script continuous doorcheckrate
(if (or
(volume_test_object REDDOOR1 BLUE1)
(volume_test_object REDDOOR1 BLUE2)
)
Repeat the Volume test object, changing BLUE1, BLUE2, BLUE3, on up to 18, just to be safe. (Two extra vehicles)
(set reddoor1 1))
If a member of blue team enters the volumes, then set the boolean for that specific door to 1. Which, as you will see later, will set the crusher vehicle to destroy the door. (would work to set a kill biped script but that's a lot of hassle considering how long the script will be)
In essence, you would wind up with the following script for door checkrate.
(script continuous doorcheckerate ;; Volume test <REDDOOR#> for an object, <BLUE#>
(if (or
(volume_test_object REDDOOR1 BLUE1)
(volume_test_object REDDOOR1 BLUE2)
(volume_test_object REDDOOR1 BLUE3)
(volume_test_object REDDOOR1 BLUE4)
(volume_test_object REDDOOR1 BLUE5)
(volume_test_object REDDOOR1 BLUE6)
(volume_test_object REDDOOR1 BLUE7)
(volume_test_object REDDOOR1 BLUE8)
(volume_test_object REDDOOR1 BLUE9)
(volume_test_object REDDOOR1 BLUE10)
(volume_test_object REDDOOR1 BLUE11)
(volume_test_object REDDOOR1 BLUE12)
(volume_test_object REDDOOR1 BLUE13)
(volume_test_object REDDOOR1 BLUE14)
(volume_test_object REDDOOR1 BLUE15)
(volume_test_object REDDOOR1 BLUE16)
(volume_test_object REDDOOR1 BLUE17)
(volume_test_object REDDOOR1 BLUE18)
)
(set reddoor1 1))
Keep doing that until you get all of the doors you want for red.
If you haven't noticed, this script is such that as Blue gets farther and farther vs Red, then Red gets better weapons.
(if (and (unit_get_health reddoor1biped) (= reddoor1 1)) (object_teleport crushervehiclereddoor1 <cutscene_flag>))
If reddoor1 (our boolean) = true, spawn crusher vehicle at the cutscene flag, killing our door.
To Be continued.
Multi teleporters and other things to be discussed in the next update.
Why? because it requires that you be able to track what team an individual player is on.
Okay, so let's begin with the outline of the idea. So you're an enterprising mapper and want to replicate tf2 with your own little twists.
Let's focus on Blue team.
We're going to want 1 boolean for each member of the blue team.
(global boolean reddoor1 false)
Repeat that code until you have 8 booleans, using the same scheme. This is going to tell us if the door is open or not. Now, you could go the extra step and kill a biped instead of using a boolean to tell everyone the certain door is open, but that's not for right now.
Beware, Halo Script is Case-sensitive.
Next up: ;; Volume test <REDDOOR#> for an object, <BLUE#>
REDDOOR# is a volume trigger, and BLUE# can be almost anything that syncs. BLUE# will be an object that we attach to the players in order to track them and be sure that RED team cannot activate blue's triggers.
In this case, Blue will be the attackers and red will be the defenders.
Start out the code as follows:
(script continuous doorcheckrate
(if (or
(volume_test_object REDDOOR1 BLUE1)
(volume_test_object REDDOOR1 BLUE2)
)
Repeat the Volume test object, changing BLUE1, BLUE2, BLUE3, on up to 18, just to be safe. (Two extra vehicles)
(set reddoor1 1))
If a member of blue team enters the volumes, then set the boolean for that specific door to 1. Which, as you will see later, will set the crusher vehicle to destroy the door. (would work to set a kill biped script but that's a lot of hassle considering how long the script will be)
In essence, you would wind up with the following script for door checkrate.
(script continuous doorcheckerate ;; Volume test <REDDOOR#> for an object, <BLUE#>
(if (or
(volume_test_object REDDOOR1 BLUE1)
(volume_test_object REDDOOR1 BLUE2)
(volume_test_object REDDOOR1 BLUE3)
(volume_test_object REDDOOR1 BLUE4)
(volume_test_object REDDOOR1 BLUE5)
(volume_test_object REDDOOR1 BLUE6)
(volume_test_object REDDOOR1 BLUE7)
(volume_test_object REDDOOR1 BLUE8)
(volume_test_object REDDOOR1 BLUE9)
(volume_test_object REDDOOR1 BLUE10)
(volume_test_object REDDOOR1 BLUE11)
(volume_test_object REDDOOR1 BLUE12)
(volume_test_object REDDOOR1 BLUE13)
(volume_test_object REDDOOR1 BLUE14)
(volume_test_object REDDOOR1 BLUE15)
(volume_test_object REDDOOR1 BLUE16)
(volume_test_object REDDOOR1 BLUE17)
(volume_test_object REDDOOR1 BLUE18)
)
(set reddoor1 1))
Keep doing that until you get all of the doors you want for red.
If you haven't noticed, this script is such that as Blue gets farther and farther vs Red, then Red gets better weapons.
(if (and (unit_get_health reddoor1biped) (= reddoor1 1)) (object_teleport crushervehiclereddoor1 <cutscene_flag>))
If reddoor1 (our boolean) = true, spawn crusher vehicle at the cutscene flag, killing our door.
To Be continued.
Multi teleporters and other things to be discussed in the next update.