Scripted Conquest Game Mode
by Brian Jansen · 06/20/2007 (8:41 am) · 21 comments
It's been a while since I've submitted a resource and I've decided to write on for my recreation of the conquest game mode. This tutorial will show you how to do alot of things other than the conquest mode also. Well, lets get started.
First of all I need to explain conquest. In conquest two teams fight each other to capture all of the command posts on the map. Command posts are spawn points specific to the team that has control over it. To capture a command post you must stand in the vicinity of it for 15 seconds and once captured you can now spawn from that area. To win either kill all of the players on the team until they die a total of 75 times or hold all of the command posts for 15 seconds.
Now for the Code:
BE SURE TO MAKE A BACKUP BEFORE CHANGING A FILE
Step 1)
Create a file in ~/server/scripts called invasion.cs and insert the following code as it's contents:
Step 2)
In the same folder open game.cs and do the following:
Find the following code:
Next add the following line of code to the beggining of the startgame() function
You should then find the function Oncyclepauseend and replace it with the following code:
Replace onClientEnterGame(%this) with the following
There are alot of changes to the ondeath function so I have the main stuff in bold.
Add the following functions after the spawnplayer function.
Add the following to the top of the onConnect function.
Replace the following line
Add the following after the createplayer function.
Replace the Pickspawnpoint function with the following.
and below it add the following.
Step 3)
In the same folder open camera.cs and in the ontrigger function replace
Step 4)
Next open ~/client/ui and open the file playgui.gui. Add the following code to the very beggining of the file.
Find the following code.
and add the following after the above.
That's it for Playgui.gui
Step 5)
Create a new file called team.gui and have the following as it's contents.
Step 6)
Next create a file called Spawngui.gui and put the following as it's contents.
Step 7)
Goto ~/client/scripts and open playgui.cs then add the following to the bottom.
Step 8)
Next open optionsdlg.cs and after
[code[$RemapName[$RemapCount] = "Open Options Window";
$RemapCmd[$RemapCount] = "openOptionsWindow";
$RemapCount++;[/code]
add
Add the following to the very bottom.
Step 9)
Next open ~/client/ and in the file init.cs after
Then after
That concludes the part where we make the changes to the scripts. We now still need to configure the conquest mode. Experiment with variables at your own discretion.
Now we have gotten to map configuration which at the moment is kind of tedious so if anyone has any suggestions of how to make it easier.
I have included a working map which is already configured. Click here to dowload it.
The code above is the actual placement of the triggers that are the Command Posts. Notice there isn't code for the objects that are placed to show the location of each command post because when the game starts they are created automatically.
Not much is needed to be addressed except the two variables that are in the trigger datablocks.
Fury
supporting = "1";
supportingt = "team1";
Rage
supporting = "2";
supportingt = "team2";
Neutral
supporting = "3";
supportingt = "team3";
This Concludes this tutorial. I havn't worked on this in a while so I might have missed something so let me know. If anyone has a way to improve upon this please let me know and I'll add it.
First of all I need to explain conquest. In conquest two teams fight each other to capture all of the command posts on the map. Command posts are spawn points specific to the team that has control over it. To capture a command post you must stand in the vicinity of it for 15 seconds and once captured you can now spawn from that area. To win either kill all of the players on the team until they die a total of 75 times or hold all of the command posts for 15 seconds.
Now for the Code:
BE SURE TO MAKE A BACKUP BEFORE CHANGING A FILE
Step 1)
Create a file in ~/server/scripts called invasion.cs and insert the following code as it's contents:
//Variables
$outpostct = 6;
$wintime = 10000;
$wintimesecs = 15;
$aliens = 0;
$tn[1] = "Fury";
$tn[2] = "Rage";
$tn[3] = "Neutral";
$outpost[1 @ " " @ 1] = 15;
$outpost[1 @ " " @ 2] = 0;
$outpost[1 @ " " @ 3] = 0;
$outpost[1 @ " " @ 4] = 0;
$outpost[1 @ " " @ 5] = 0;
$outpost[1 @ " " @ 6] = 0;
$outpost[2 @ " " @ 1] = 0;
$outpost[2 @ " " @ 2] = 0;
$outpost[2 @ " " @ 3] = 0;
$outpost[2 @ " " @ 4] = 15;
$outpost[2 @ " " @ 5] = 0;
$outpost[2 @ " " @ 6] = 0;
$outpost[3 @ " " @ 1] = 0;
$outpost[3 @ " " @ 2] = 15;
$outpost[3 @ " " @ 3] = 15;
$outpost[3 @ " " @ 4] = 0;
$outpost[3 @ " " @ 5] = 15;
$outpost[3 @ " " @ 6] = 15;
$outpost[1] = f;
$outpost[2] = n;
$outpost[3] = n;
$outpost[4] = r;
$outpost[5] = n;
$outpost[6] = n;
$brick[0] = 0;
$brick[1] = 0;
$brick[2] = 0;
$brick[3] = 0;
$brick[4] = 0;
$brick[5] = 0;
$brick[6] = 0;
$brick[7] = 0;
$msgcount = 0;
$msgnum[$msgcount++] = "Team %1 hope you remember how to subtract LOL";
$msgnum[$msgcount++] = "Team %1 stop raping each other and defend the outposts";
$msgnum[$msgcount++] = "Team %1 your tampons fell out";
$msgnum[$msgcount++] = "Stop crying Team %1";
$msgnum[$msgcount++] = "Your a bunch of pussies Team %1";
$msgnum[$msgcount++] = "Team %1 guess what? You lost a Outpost :p";
$msgnum[$msgcount++] = "Team %1 my foot will be in your ass if you keep losing Outposts";
//sounds
//datablock AudioProfile(InvasionRepend)
//{
// filename = "~/data/sound/evade.wav";
// description = "triggersound";
// preload = false;
//};
//datablock AudioProfile(InvasionImpend)
//{
// filename = "~/data/sound/invade.wav";
// description = "triggersound";
// preload = false;
//};
//Game Preferences
$gameconfig = new ScriptObject()
{
outpostct = 6;
respawnwait = "5 * 1000";
maxplayerpt = 8;
wintime = "15 * 1000";
maxdeaths = 75;
};
//Team Script Objects
$Team1 = new ScriptObject()
{
teamId = 1;
name = Fury;
score = 0;
numPlayers = 0;
Outpostcount = 1;
color = red;
kings = 0;
spawndb = Redspawn;
outident = 1;
marker = f;
deaths = 0;
nametag = "[FURY]";
ind = "madfury";
a = 1;
b = 0;
c = 0;
d = 0;
e = 0;
f = 0;
};
$Team2 = new ScriptObject()
{
teamId = 2;
name = Rage;
score = 0;
Outpostcount = 1;
numPlayers = 0;
color = blue;
outident = 2;
kings = 0;
spawndb = Bluespawn;
marker = r;
deaths = 0;
nametag = "[RAGE]";
ind = "madrage";
a = 0;
b = 0;
c = 0;
d = 1;
e = 0;
f = 0;
};
$Team3 = new ScriptObject()
{
teamId = 3;
outident = 3;
name = Neutral;
score = 0;
numPlayers = 0;
invincible = 1;
Outpostcount = 4;
color = grey;
marker = n;
deaths = 0;
nametag = "[Nut]";
ind = "madneutral";
a = 0;
b = 1;
c = 1;
d = 0;
e = 1;
f = 1;
};
//Trigger Datablock
datablock TriggerData(invasionTrigger)
{
tickPeriodMS = 1000;
capturetime = 15;
};
//Onentertrigger: This is called when you enter a trigger
function invasionTrigger::onEnterTrigger(%this,%trigger,%obj)
{
if (%obj.client.team.teamid != 3)
{
%outpostnum = %trigger.getName();
if (%trigger.supporting != %obj.client.team.teamid)
{
msgclient(%obj.client,"You have entered " @ %trigger.supportingt.name @ " Outpost " @ %outpostnum);
%trigger.alienteam = %obj.client.team;
%trigger.alienclient = %obj.client;
$aliens++;
%obj.client.invading = true;
}
if ($outpost[%obj.client.team.outident @ " " @ %outpostnum] < %this.capturetime &&
%obj.client.team.teamid == %trigger.supporting)
{
msgclient(%obj.client,"You have entered an Allied Outpost " @ %outpostnum);
}
else if ($outpost[%obj.client.team.outident @ " " @ %outpostnum] == %time &&
%obj.client.team.teamid == %trigger.supporting)
{
%obj.client.invading = false;
}
}
}
//Onleavetrigger: This is handled when you leave the trigger
function invasionTrigger::onLeaveTrigger(%this,%trigger,%obj)
{
commandtoclient(%obj.client,'captprog',"false",0,0,0);
if (%trigger.alienteam)
{
if (%trigger.supporting != %obj.client.team.teamid)
{
$aliens--;
%obj.client.invading = false;
%trigger.alienteam = none;
%trigger.alienclient = none;
}
%obj.client.invading = false;
}
}
//onticktrigger: Is called every second to change things
function invasionTrigger::onTickTrigger(%this,%trigger,%obj)
{
if (%trigger.alienteam)
{
%pos = %trigger.position;
%targetpos = %trigger.getWorldBoxCenter();
%x = getWord(%targetPos, 0);
%y = getWord(%targetPos, 1);
%z = getWord(%pos, 2);
%trigpos = %x SPC %y SPC %z;
%team = %trigger.alienteam;
%client = %trigger.alienclient;
%num = %trigger.getName();
if (%team.teamid != %trigger.supporting)
secondcap(%team,%trigger.supportingt,%num,%trigpos,%this.capturetime,%trigger,%team.teamid,%client);
if (%team.teamid == %trigger.supporting)
secondcap(%trigger.supportingt,%team,%num,%trigpos,%this.capturetime,%trigger,%team.teamid,%client);
}
}
//secondcap: is called every second to handle the seconds put into the outposts
function secondcap(%opposing,%supporting,%outpostnum,%pos,%time,%outpost,%teamid,%client)
{
if ($outpost[%opposing.outident @ " " @ %outpostnum] <= %time && $outpost[%supporting.outident
@ " " @ %outpostnum] >= 0 && %opposing != "")
{
$outpost[%opposing.outident @ " " @ %outpostnum]++;
$outpost[%supporting.outident @ " " @ %outpostnum]--;
commandtoclient(%client,'captprog',"true",$outpost[%opposing.outident @ " " @ %outpostnum],$wintimesecs,%outpost.brick.getshapename());
echo("SERVER:" SPC %client SPC $outpost[%opposing.outident @ " " @ %outpostnum] SPC $wintimesecs SPC %outpost.brick.getshapename());
if ($outpost[%supporting.outident @ " " @ %outpostnum] <= 5)
{
msgall("Enemy: " @ $outpost[%supporting.outident @ " " @ %outpostnum] @ " You: " @
$outpost[%opposing.outident @ " " @ %outpostnum]);
}
}
else
{
if(%opposing != %supporting)
{
return;
}
}
if ($outpost[%opposing.outident @ " " @ %outpostnum] == %time && %opposing != "" && %opposing
!= %supporting && %supporting != "")
{
outpostcap(%outpost,%opposing,%pos);
}
}
//Jointeam: Self Explanitory
function serverCmdJoinTeam(%client, %teamid)
{
%client.joinTeam(%teamid);
}
function serverCmdspawnPlayerchose(%client, %chosen)
{
%client.spawnPlayerchose(%chosen);
}
function MsgAll(%msg)
{
// useful function for admins to msg everyone
messageAll('MsgGlobal', '%1', %msg);
echo("%1",%msg);
}
function Msgclient(%client,%msg)
{
messageclient(%client,'Msgclient', '%1', %msg);
echo("%1",%msg);
}
//Outpostcap: Handles the capture of the outpost
function outpostcap(%outpost,%team,%pos)
{
$old = %outpost.supportingt;
$new = %team;
if(%outpost.supportingt != %team)
{
%outpost.supportingt.outpostcount--;
//%obj = new ParticleEmitterNode() {
// dataBlock = %team.spawndb @ "EmitterNode";
// emitter = %team.spawndb @ "Emitter";
// };
//%obj.setTransform(%pos);
//%objb = new ParticleEmitterNode() {
// dataBlock = "teleportEmitterNode";
// emitter = "teleportEmitter";
// };
//%objb.setTransform(%pos);
//%obj.schedule(2900, "delete");
//%objb.schedule(2900, "delete");
%outpost.supporting = %team.outident;
%outpost.supportingt = %team;
%team.outpostcount++;
%outname = %outpost.getname();
$brick[%outname].setSkinName(%team.color);
$brick[%outname].setshapename(%team.name @ " Outpost " @ %outname);
$outpost[%outname] = %team.marker;
if (%outname == 1)
{
$old.a = 0;
$new.a = 1;
}
if (%outname == 2)
{
$old.b = 0;
$new.b = 1;
}
if (%outname == 3)
{
$old.c = 0;
$new.c = 1;
}
if (%outname == 4)
{
$old.d = 0;
$new.d = 1;
}
if (%outname == 5)
{
$old.e = 0;
$new.e = 1;
}
if (%outname == 6)
{
$old.f = 0;
$new.f = 1;
}
if ($new == $team1)
updatecpct($new,$old,%outpost,$new,$old);
if ($new == $team2)
updatecpct($old,$new,%outpost,$new,$old);
if (%team.teamid == "1")
catoutofbag("2");
if (%team.teamid == "2")
catoutofbag("1");
if (%team.outpostcount == $outpostct)
{
msgall("Team " @ %team.name @ " will win in " @ $wintimesecs @ " Seconds");
win(%team);
}
}
}
$countdown = 15;
//Win: Declares the winner and ends the game
function win(%team)
{
if($countdown > 0)
{
$countdown--;
msgall($countdown);
schedule(1000,0,"win",%team);
}
else if($countdown == 0)
{
$countdown = 10;
cycleGame();
}
else
{
msgall("You lost a Command Post HaHa");
}
}
//CatoutoftheBag: Makes fun of people
function catoutofbag(%teamid)
{
$randommsg = getrandom(1,$msgcount);
%string = Strreplace( $msgnum[$randommsg], "%1", $tn[%teamid] );
msgall(%string);
}
function testa()
{
$this = 5;
$that = 20;
$then = $this|$that;
$there = $that|$this;
echo($this @ " " @ $that @ " " @ $then @ " " @ $there);
}
$num = 0;
function spawnnotificationbrick(%trig)
{
%teamname = Strreplace( %trig.supportingt, "team1", $team1 );
%teamname = Strreplace( %teamname, "team2", $team2 );
%teamname = Strreplace( %teamname, "team3", $team3 );
%trig.supportingt = %teamname;
%color = %trig.supportingt.color;
%pos = %trig.position;
%targetpos = %trig.getWorldBoxCenter();
%x = getWord(%targetPos, 0);
%y = getWord(%targetPos, 1);
%z = getWord(%pos, 2);
%finalPos = %x SPC %y SPC %z;
%obj = new StaticShape() {
[b]dataBlock = ''; //assign a datablock here[/b]
};
%obj.setTransform(%finalpos);
%obj.setSkinName(%color);
%obj.setScale("2 2 2");
%obj.setshapename(%trig.supportingt.name @ " Outpost " @ %trig.getname());
$num++;
$brick[$num] = %obj;
%trig.brick = %obj;
error("Triggername: " @ %trig.getname() @ " <> $brick[" @ $num @ "] = " @ $brick[$num]);
}
function nbricks()
{
%dataGroup = "MissionGroup/outposts";
for(%i = 0; %i < %dataGroup.getCount(); %i++)
{
%obj = %dataGroup.getObject(%i);
if(%obj.getClassName() !$= "Trigger")
{
continue;
}
if(isObject(%obj))
{
spawnnotificationbrick(%obj);
}
}
}
function updatecpct(%fury,%rage,%outpost,%new,%old)
{
%oname = "o" @ %outpost.getname();
%oind = "ind" @ %outpost.getname();
%count = ClientGroup.getCount();
for(%cl = 0; %cl < %count; %cl++)
{
%client = ClientGroup.getObject(%cl);
if (%client.team == %new)
commandtoclient(%client, 'gainop', %oname, %new.ind, %oind);
if (%client.team == %old)
commandtoclient(%client, 'loseop', %oname, %new.ind, %oind);
commandtoclient(%client, 'updateopct', $team1.outpostcount, $team2.outpostcount, $gameconfig.outpostct);
commandtoclient(%client, 'deathkeep', $team1.deaths, $team2.deaths, $gameconfig.maxdeaths);
}
}
function updatedeaths()
{
%count = ClientGroup.getCount();
for(%cl = 0; %cl < %count; %cl++)
{
%client = ClientGroup.getObject(%cl);
commandtoclient(%client, 'deathkeep', $team1.deaths, $team2.deaths, $gameconfig.maxdeaths);
}
}
////This was Coded by BJway Bandit/////Step 2)
In the same folder open game.cs and do the following:
Find the following code:
exec("./aiplayer.cs");and add the following after that line of code:exec("./invasion.cs");Next add the following line of code to the beggining of the startgame() function
nbricks();This will load place the spawn points at specified places
You should then find the function Oncyclepauseend and replace it with the following code:
function onCyclePauseEnd()
{
$Game::Cycling = false;
// Just cycle through the missions for now.
//%search = $Server::MissionFileSpec;
//for (%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search)) {
// if (%file $= $Server::MissionFile) {
// Get the next one, back to the first if there
// is no next.
// %file = findNextFile(%search);
//if (%file $= "")
// %file = findFirstFile(%search);
//break;
//}
//}
loadMission($server::Missionfile);
}This prevents switching to a map that isn't set up for conquest by staying at the chosen map.Replace onClientEnterGame(%this) with the following
function GameConnection::onClientEnterGame(%this)
{
%count = ClientGroup.getCount();
%cl = getrandom(%count);
%client = ClientGroup.getObject(%cl);
commandToClient(%this, 'SyncClock', $Sim::Time - $Game::StartTime);
// Create a new camera object.
%this.camera = new Camera() {
dataBlock = Observer;
};
MissionCleanup.add( %this.camera );
%this.camera.scopeToClient(%this);
// Setup game parameters, the onConnect method currently starts
// everyone with a 0 score.
%this.score = 0;
%this.team = $team3; //default team is 0 (observer)
//Spawn a camera by default on a observer point
//if (!$Game::Running) {
%this.cspawnplayer();
//}
//commandtoserver('jointeam',3);
}this code assigns people that are joining the game to the neutral team.There are alot of changes to the ondeath function so I have the main stuff in bold.
function GameConnection::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc)
{
[b]updatedeaths();[/b] //Add this
%player = %this.player;
// Clear out the name on the corpse
%player.setShapeName("A Poor Dead Basterd");
//remove player's temp brick
if(isObject(%player.tempBrick))
{
%player.tempBrick.delete();
%player.tempBrick = "";
}
// Switch the client over to the death cam and unhook the player object.
if (isObject(%this.camera) && isObject(%this.player)) {
%this.camera.setMode("Corpse",%this.player);
%this.setControlObject(%this.camera);
}
%this.player = 0;
// Doll out points and display an appropriate message
if (%damageType $= "Suicide" || %sourceClient == %this) {
[b]//%this.incScore(-1);
//Disable Personal Scoring and add team scoring and stats
%this.team.deaths++;
$Game::TeamSuicides[%sourceClient.team.teamid]++;
messageAll('MsgClientKilled','%1 takes his own life!',%this.name);
if (%this.team.deaths >= $Gameconfig.maxdeaths)
cycleGame();
updatedeaths();[/b]
}
else if(isObject(%sourceClient)) {
[b]//%this.incScore(1);
//Disable Personal Scoring and add team scoring and stats
%this.team.deaths++;
messageAll('MsgClientKilled','%1 gets nailed by %3!',%this.name,%damLoc,%sourceClient.name);
if (%this.team.deaths >= $Gameconfig.maxdeaths)
cycleGame();
updatedeaths();[/b]
}
else
{
[b]//%this.incScore(-1);
//Disable Personal Scoring and add team scoring and stats
$Game::Teammiscdeaths[%sourceClient.team.teamid]++;
messageAll('MsgClientKilled','%1 dies.',%this.name);
%this.team.deaths++;
if (%this.team.deaths >= $Gameconfig.maxdeaths)
cycleGame();
updatedeaths();
[/b]
}
}Pay close attention to replaceif (%sourceClient.score >= $Game::EndGameScore)with
if (%this.team.deaths >= $Gameconfig.maxdeaths)
Add the following functions after the spawnplayer function.
function GameConnection::cspawnPlayer(%this)
{
commandtoclient(%this,'openspawngui');
}
function GameConnection::spawnPlayerchose(%this,%chosen)
{
%spawnPoint = pickchosenSpawnPoint(%this,%chosen);
%this.createPlayer(%spawnPoint);
}Add the following to the top of the onConnect function.
sendmapdata(%client);
Replace the following line
%player.setShapeName(%this.name);in the createplayer function with
%player.setShapeName(%this.team.nametag @ "" @ %this.namebase);This will make it so you can see what team other players are on.
Add the following after the createplayer function.
function GameConnection::joinTeam(%this, %teamid)
{
//We only have 2 teams so if team is greater than 2 or less than 0 its invalid.
if (%teamid > 3 || %teamid <= 0)
return false;
//If we already are on that team return.
if (%teamid == %this.team.teamId)
return false;
%this.leaveTeam();
if (%teamid == 1)
{
%this.team = $Team1;
}
if (%teamid == 2)
{
%this.team = $Team2;
}
if (%teamid == 3)
{
%this.team = $Team3;
}
MessageAll('MsgClientJoinTeam', '\c4%1 joined Team %2',
%this.name,
%this.team.name,
%this.team.teamId,
%this,
%this.sendGuid,
%this.score,
%this.isAiControlled(),
%this.isAdmin,
%this.isSuperAdmin);
%this.team.numplayers++;
%this.cspawnPlayer();
}
function GameConnection::leaveTeam(%client, %teamid)
{
%this.score = 0;
if (%client.team.name)
messageAll('MsgClientLeaveTeam', '\c2%1 left Team %2.',
%client.name,
%client.team.name,
%client);
%client.team.numplayers--;
if (%client.player)
%client.player.delete();
}
function sendmapdata( %client )
{
commandtoclient( %client, 'missioninit', MissionInfo.c1, MissionInfo.c2, MissionInfo.c3, MissionInfo.c4, MissionInfo.c5, MissionInfo.c6, MissionInfo.c1p, MissionInfo.c2p, MissionInfo.c3p, MissionInfo.c4p, MissionInfo.c5p, MissionInfo.c6p, MissionInfo.m1pic, MissionInfo.m1v, MissionInfo.m2pic, MissionInfo.m2v, MissionInfo.m3pic, MissionInfo.m3v );
commandtoclient( %client, 'teamguistuff');
}Replace the Pickspawnpoint function with the following.
function pickSpawnPoint(%client)
{
%groupName = "MissionGroup/outposts";
%group = nameToID(%groupName);
if (%group != -1) {
// We have a group, so let's create an array of spawns.
// This'll eliminate that second function and hopefully the error.
echo("Group found, creating the array of teamspawns.");
%objcount = %group.getcount();
%spawncount = -1;
for(%i = 0; %i < %objcount; %i++) {
%obj = %group.getObject(%i);
echo("Checking object #" @ %i @ " for spawnage. Classname: " @ %obj.getClassName() @ " Name: " @ %obj.getName() @ " Supporting teams: " @ %obj.supporting);
if (isObject(%obj) &&
%obj.getClassName() $= "Trigger" &&
strstr(%obj.supportingt, %client.team) != -1) // Note: I don't like this last check, use delimits like teamid.teamid.teamid
{
%spawns[%spawncount++] = %obj;
}
}
// Debug loop:
for (%i = 0; %i <= %spawncount; %i++) {
echo("[SpawnArray]: " @ %i @ " is named " @ %spawns[%i].getName() @ " and at " @ %spawns[%i].position);
}
if (%spawncount > -1 && %spawncount <= %objcount) {
%index = getRandom(%spawncount);
%spawn = %spawns[%index];
// the isobject() check is redundant, we know they're objects.
echo("Chose spawn #" @ %index @ " with pos " @ %spawn.position);
%trans = %spawn.getworldboxcenter();
%X = getWord(%trans, 0);
%Y = getWord(%trans, 1);
%Z = getWord(%trans, 2) + 5;
// the teamid check is also redunant, all we have are proper team spawns
return %X SPC %Y SPC %Z;
}
else {
// No team spawns found :(
echo("No team spawn points found, spawning at worldcenter");
picknormspawnpoint(%client);
//return "0 0 300 1 0 0 0";
}
}
// Could be no spawn points, in which case we'll stick the
// player at the center of the world.
echo("No group found, check your map. Spawning player at worldcenter instead.");
picknormspawnpoint(%client);
//return "0 0 300 1 0 0 0";
}and below it add the following.
function picknormSpawnPoint(%client)
{
%groupName = "MissionGroup/" @ %client.team.name @ "TeamDropPoints";
%group = nameToID(%groupName);
if (%group != -1) {
%count = %group.getCount();
if (%count != 0) {
%index = getRandom(%count-1);
%spawn = %group.getObject(%index);
return %spawn.getTransform();
}
else
error("No " @ %client.team.name @ " team spawn points found in " @ %groupName);
}
else
error("Missing " @ %client.team.name @ " team spawn points group " @ %groupName);
// Could be no spawn points, in which case we'll stick the
// player at the center of the world.
return "0 0 300 1 0 0 0";
}
function pickchosenSpawnPoint(%client,%chosen)
{
%groupName = "MissionGroup/outposts";
%group = nameToID(%groupName);
if (%group != -1) {
// We have a group, so let's create an array of spawns.
// This'll eliminate that second function and hopefully the error.
echo("Group found, creating the array of teamspawns.");
%objcount = %group.getcount();
%spawncount = -1;
for(%i = 0; %i < %objcount; %i++) {
%obj = %group.getObject(%i);
echo("Checking object #" @ %i @ " for spawnage. Classname: " @ %obj.getClassName() @ " Name: " @ %obj.getName() @ " Supporting teams: " @ %obj.supporting);
if (isObject(%obj) &&
%obj.getClassName() $= "Trigger" &&
strstr(%obj.supportingt, %client.team) != -1 && strstr(%obj.getname(), %chosen) != -1 ) // Note: I don't like this last check, use delimits like teamid.teamid.teamid
{
%spawns[%spawncount++] = %obj;
}
}
// Debug loop:
for (%i = 0; %i <= %spawncount; %i++) {
echo("[SpawnArray]: " @ %i @ " is named " @ %spawns[%i].getName() @ " and at " @ %spawns[%i].position);
}
if (%spawncount > -1 && %spawncount <= %objcount) {
%index = getRandom(%spawncount);
%spawn = %spawns[%index];
// the isobject() check is redundant, we know they're objects.
echo("Chose spawn #" @ %index @ " with pos " @ %spawn.position);
%trans = %spawn.getworldboxcenter();
%X = getWord(%trans, 0);
%Y = getWord(%trans, 1);
%Z = getWord(%trans, 2) + 5;
// the teamid check is also redunant, all we have are proper team spawns
return %X SPC %Y SPC %Z;
}
else {
// No team spawns found :(
echo("No team spawn points found, spawning at worldcenter");
picknormspawnpoint(%client);
//return "0 0 300 1 0 0 0";
}
}
// Could be no spawn points, in which case we'll stick the
// player at the center of the world.
echo("No group found, check your map. Spawning player at worldcenter instead.");
picknormspawnpoint(%client);
//return "0 0 300 1 0 0 0";
}
function pickObserverPoint(%client)
{
%groupName = "MissionGroup/observerDropPoints";
%group = nameToID(%groupName);
if (%group != -1) {
%count = %group.getCount();
if (%count != 0) {
%index = getRandom(%count-1);
%spawn = %group.getObject(%index);
return %spawn.getTransform();
}
else
error("No observer spawn points found in " @ %groupName);
}
else
error("Missing observer spawn points group " @ %groupName);
// Could be no spawn points, in which case we'll stick the
// player at the center of the world.
return "0 0 300 1 0 0 0";
}This allows you to chose a Command post for a spawn point on a map. That's it for game.cs.Step 3)
In the same folder open camera.cs and in the ontrigger function replace
%client.spawnPlayer();with
%client.cspawnPlayer();
Step 4)
Next open ~/client/ui and open the file playgui.gui. Add the following code to the very beggining of the file.
new GuiControlProfile ("LoadingGuiContentProfile")
{
opaque = true;
fillColor = "200 200 200";
border = true;
borderColor = "0 0 0";
};Find the following code.
new GuiHealthBarHud() {
profile = "GuiDefaultProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "451 31";
extent = "184 7";
minExtent = "8 2";
visible = "1";
helpTag = "0";
fillColor = "0.000000 0.000000 0.000000 0.500000";
frameColor = "1.000000 1.000000 1.000000 1.000000";
damageFillColor = "0.000000 0.000000 1.000000 1.000000";
pulseRate = "0";
pulseThreshold = "0.3";
showFill = "1";
showFrame = "0";
displayEnergy = "1";
};(if you can not find the above add the below code right after the shapename instance.)and add the following after the above.
new GuiTextCtrl(regscore) {
profile = "GuiTextProfile";
horizSizing = "relative";
vertSizing = "relative";
position = "380 40";
extent = "79 11";
minExtent = "8 2";
visible = "1";
helpTag = "0";
text = "Press M to pick your Team";
maxLength = "255";
};
new GuiProgressCtrl(captprog) {
profile = "GuiProgressProfile";
horizSizing = "center";
vertSizing = "top";
position = "161 408";
extent = "274 25";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiTextCtrl(captprogtext) {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "6 2";
extent = "90 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Capture Progress";
maxLength = "255";
};
};
new GuiProgressCtrl(furydeaths) {
profile = "GuiProgressProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "468 86";
extent = "144 25";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiTextCtrl(furydeathstext) {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "6 2";
extent = "59 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Fury Deaths";
maxLength = "255";
};
};
new GuiProgressCtrl(ragedeaths) {
profile = "GuiProgressProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "468 54";
extent = "144 25";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiTextCtrl(ragedeathstext) {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "6 2";
extent = "62 18";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Rage Deaths";
maxLength = "255";
};
}; That's it for Playgui.gui
Step 5)
Create a new file called team.gui and have the following as it's contents.
//--- OBJECT WRITE BEGIN ---
new GameTSCtrl(TeamSelectDlg) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "159 155";
extent = "321 170";
minExtent = "8 8";
visible = "1";
helpTag = "0";
maxLength = "255";
resizeWidth = "1";
resizeHeight = "1";
closeCommand = "Canvas.popDialog(TeamSelectDlg);";
new GuiTextCtrl() {
profile = "GuiBigTextProfile";
horizSizing = "center";
vertSizing = "relative";
position = "32 30";
extent = "257 40";
minExtent = "8 8";
visible = "1";
helpTag = "0";
text = "Choose your team";
maxLength = "255";
};
new GuiButtonCtrl(RedTeam) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 130";
extent = "140 30";
minExtent = "8 8";
visible = "1";
command = "jointeam(1);";
helpTag = "0";
text = "Team Fury";
groupNum = "-1";
buttonType = "PushButton";
};
new GuiButtonCtrl(BlueTeam) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "170 130";
extent = "140 30";
minExtent = "8 8";
visible = "1";
command = "jointeam(2);";
helpTag = "0";
text = "Team Rage";
groupNum = "-1";
buttonType = "PushButton";
};
};
};
//--- OBJECT WRITE END ---
function jointeam(%teamid)
{
commandtoserver('JoinTeam', %teamid);
Canvas.popDialog(TeamSelectDlg); //Hide the dialog once selection was made
ragescore.setText("");
furyscore.setText("");
}Step 6)
Next create a file called Spawngui.gui and put the following as it's contents.
//--- OBJECT WRITE BEGIN ---
new GameTSCtrl(SpawnGUI) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 2";
visible = "1";
helpTag = "0";
new GuiControl(spawnwin) {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "-614 393";
extent = "614 393";
minExtent = "8 2";
visible = "1";
helpTag = "0";
text = "Spawn GUI";
maxLength = "255";
resizeWidth = "0";
resizeHeight = "0";
canMove = "0";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "Canvas.popDialog(spawngui);";
new GuiBitmapCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "18 46";
extent = "416 314";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./gui1";
wrap = "0";
};
new GuiBitmapCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "475 50";
extent = "106 96";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./gui2";
wrap = "0";
};
new GuiBitmapCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "475 167";
extent = "106 96";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./gui3";
wrap = "0";
};
new GuiRadioCtrl(O3) {
profile = "GuiRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "498 237";
extent = "64 30";
minExtent = "8 2";
visible = "1";
helpTag = "0";
text = "\c3Outpost 3";
groupNum = "-1";
buttonType = "RadioButton";
outpost = "3";
ind = "ind3";
};
new GuiRadioCtrl(O2) {
profile = "GuiRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "500 109";
extent = "64 30";
minExtent = "8 2";
visible = "1";
helpTag = "0";
text = "\c3Outpost 2";
groupNum = "-1";
buttonType = "RadioButton";
outpost = "2";
ind = "ind2";
};
new GuiRadioCtrl(o1) {
profile = "GuiRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "256 274";
extent = "71 30";
minExtent = "8 2";
visible = "0";
helpTag = "0";
text = "\c3Outpost 1";
groupNum = "-1";
buttonType = "RadioButton";
outpost = "1";
ind = "ind1";
};
new GuiRadioCtrl(o6) {
profile = "GuiRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "325 317";
extent = "72 30";
minExtent = "8 2";
visible = "1";
helpTag = "0";
text = "\c3Outpost 6";
groupNum = "-1";
buttonType = "RadioButton";
outpost = "6";
ind = "ind6";
};
new GuiRadioCtrl(o5) {
profile = "GuiRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "50 315";
extent = "66 30";
minExtent = "8 2";
visible = "1";
helpTag = "0";
text = "\c3Outpost 5";
groupNum = "-1";
buttonType = "RadioButton";
outpost = "5";
ind = "ind5";
};
new GuiRadioCtrl(o4) {
profile = "GuiRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "320 190";
extent = "64 30";
minExtent = "8 2";
visible = "0";
helpTag = "0";
text = "\c3Outpost 4";
groupNum = "-1";
buttonType = "RadioButton";
outpost = "4";
ind = "ind4";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "455 300";
extent = "140 30";
minExtent = "8 2";
visible = "1";
command = "spawncheck();";
helpTag = "0";
text = "Spawn";
groupNum = "-1";
buttonType = "PushButton";
};
new GuiBitmapCtrl(ind4) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "349 178";
extent = "21 21";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./madrage";
wrap = "1";
};
new GuiBitmapCtrl(ind1) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "249 258";
extent = "21 21";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./madfury";
wrap = "1";
};
new GuiBitmapCtrl(ind5) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "22 318";
extent = "21 21";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./madneutral";
wrap = "1";
};
new GuiBitmapCtrl(ind6) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "392 320";
extent = "21 21";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./madneutral";
wrap = "1";
};
new GuiBitmapCtrl(ind3) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "478 170";
extent = "21 21";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./madneutral";
wrap = "1";
};
new GuiBitmapCtrl(ind2) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "478 52";
extent = "21 21";
minExtent = "8 2";
visible = "1";
helpTag = "0";
bitmap = "./madneutral";
wrap = "1";
};
};
};
//--- OBJECT WRITE END ---
function clientCmdgainop(%name,%teamind,%nameind)
{
%name.setvisible(true);
%nameind.setbitmap("~/client/ui/" @ %teamind @ ".jpg");
}
function clientCmdloseop(%name,%teamind,%nameind)
{
%name.setvisible(false);
%nameind.setbitmap("~/client/ui/" @ %teamind @ ".jpg");
}
function spawn(%chosen)
{
commandtoserver('spawnPlayerchose', %chosen);
closespawngui(0); //Hide the dialog once selection was made
}
function spawncheck()
{
if (o1.getvalue() == 1)
spawn(o1.outpost);
if (o2.getvalue() == 1)
spawn(o2.outpost);
if (o3.getvalue() == 1)
spawn(o3.outpost);
if (o4.getvalue() == 1)
spawn(o4.outpost);
if (o5.getvalue() == 1)
spawn(o5.outpost);
if (o6.getvalue() == 1)
spawn(o6.outpost);
}
function clientCmdfuryinit(%name)
{
o1.setvisible(true);
o2.setvisible(false);
o3.setvisible(false);
o4.setvisible(false);
o5.setvisible(false);
o6.setvisible(false);
}
function clientCmdrageinit(%name)
{
o1.setvisible(false);
o2.setvisible(false);
o3.setvisible(false);
o4.setvisible(true);
o5.setvisible(false);
o6.setvisible(false);
}
function clientCmdneutralinit(%name)
{
o1.setvisible(false);
o2.setvisible(true);
o3.setvisible(true);
o4.setvisible(false);
o5.setvisible(true);
o6.setvisible(true);
}
function clientCmdteaminit(%marker,%a,%b,%c,%d,%e,%f)
{
o1.setvisible(%a);
o2.setvisible(%b);
o3.setvisible(%c);
o4.setvisible(%d);
o5.setvisible(%e);
o6.setvisible(%f);
}
$start = 1;
function clientCmdopenspawngui(%name)
{
Canvas.pushDialog(spawngui);
schedule(100,0,"openspawnguia",0);
}
function openspawnguia(%i)
{
%speed = 1;
%ext = 614;
%neg = -614;
%position = Spawnwin.position;
%x = getword(%position,0);
%y = getword(%position,1);
if(%i <= %ext && %x <= 0 && %x >= -616) {
%i++;
%x = %x + 1;
spawnwin.position = %x SPC %y;
schedule(1,0,"openspawnguia",%i);
}
}
function closespawngui(%i)
{
%ext = 614;
%position = Spawnwin.position;
%x = getword(%position,0);
%y = getword(%position,1);
if(%i <= %ext && %x <= 2 && %x >= -614) {
%i++;
%x = %x - 1;
spawnwin.position = %x SPC %y;
schedule(1,0,"closespawngui",%i);
}
else
{
Canvas.popDialog(spawngui);
}
}
function clientCmdmissioninit(%a,%b,%c,%d,%e,%f,%ab,%bb,%cb,%db,%eb,%fb,%ma,%mapos,%mb,%mbpos,%mc,%mcpos)
{
o1.position = %a;
o2.position = %b;
o3.position = %c;
o4.position = %d;
o5.position = %e;
o6.position = %f;
ind1.position = %ab;
ind2.position = %bb;
ind3.position = %cb;
ind4.position = %db;
ind5.position = %eb;
ind6.position = %fb;
m1.setbitmap(%ma);
m1.setvisible(%mapos);
m2.setbitmap(%mb);
m2.setvisible(%mbpos);
m3.setbitmap(%mc);
m3.setvisible(%mcpos);
}The bottom code animates and updates the spawngui.Step 7)
Goto ~/client/scripts and open playgui.cs then add the following to the bottom.
function clientCmdupdateopct(%fury,%rage)
{
regscore.setText("\c4Team Rage\c3 " @ %rage @ "/6 <> \c4Team Fury\c3 " @ %fury @ "/6");
}
$omg = 0;
function clientCmdcaptprog(%vis,%capa,%capb,%name)
{
//if (%vis == true && $omg == 1)
//schedule(1,0,"opencaptprog",0);
//if (%vis == false && $omg == 0)
//schedule(1,0,"closecaptprog",0);
//echo("passa");
//}
echo(%vis);
captprog.setvisible(%vis);
captprogtext.setvisible(%vis);
captprog.setValue(%capa / %capb);
captprogtext.settext("Capturing " @ %Name @ " (" @ %capa @ "/" @ %capb @ " Seconds)");
}
function clientCmddeathkeep(%fury,%rage,%max)
{
echo("CLIENT:" SPC %vis SPC %capa SPC %capb SPC %name);
ragedeaths.setValue(%rage / %max);
ragedeathstext.settext(%rage @ "/" @ %max @ " Deaths (Rage)");
furydeaths.setValue(%fury / %max);
furydeathstext.settext(%fury @ "/" @ %max @ " Deaths (Fury)");
}
function opencaptprog(%i)
{
$omg = 1;
%ext = 286;
//%ext = 273;
%position = captprog.position;
%x = getword(%position,0);
%y = getword(%position,1);
echo(%x);
if (%x > 0)
%x = 0;
if(%i <= %ext && %x <= -1 && %x >= -287) {
%i++;
%x++;
captprog.position = %x SPC %y;
schedule(5,0,"opencaptprog",%i);
}
}
function closecaptprog(%i)
{
$omg = 0;
%ext = 286;
//%ext = 273;
%negext = -274;
%position = captprog.position;
%x = getword(%position,0);
%y = getword(%position,1);
echo(%x);
if (%x > 0)
%x = 0;
if(%i <= %ext && %x <= 2 && %x >= -285) {
%i++;
%x--;
captprog.position = %x SPC %y;
schedule(5,0,"closecaptprog",%i);
}
}Step 8)
Next open optionsdlg.cs and after
[code[$RemapName[$RemapCount] = "Open Options Window";
$RemapCmd[$RemapCount] = "openOptionsWindow";
$RemapCount++;[/code]
add
$RemapName[$RemapCount] = "Open Team Window"; $RemapCmd[$RemapCount] = "openteamWindow"; $RemapCount++;
Add the following to the very bottom.
function openteamWindow (%val)
{
if(%val)
canvas.pushDialog(teamselectdlg);
}Step 9)
Next open ~/client/ and in the file init.cs after
exec("./ui/remapDlg.gui");addexec("./ui/team.gui");Then after
exec("./scripts/startMissionGui.cs");addexec("./ui/spawngui.gui");That concludes the part where we make the changes to the scripts. We now still need to configure the conquest mode. Experiment with variables at your own discretion.
Now we have gotten to map configuration which at the moment is kind of tedious so if anyone has any suggestions of how to make it easier.
I have included a working map which is already configured. Click here to dowload it.
new ScriptObject(MissionInfo) {
desc0 = "Beleive it or not this was made by BJway Bandit :D";
preview = "fps/data/missions/surreal";
c2 = "128 120";
m1v = "true";
c2p = "128 97";
c1 = "94 246";
m1pic = "fps/data/missions/surrealmap";
c1p = "114 216";
m3v = "false";
c6 = "196 289";
c6p = "190 274";
desclines = "1";
c5 = "342 211";
c5p = "338 192";
name = "Surreal Conquest";
m2v = "false";
c4 = "284 143";
c4p = "288 114";
c3 = "210 91";
c3p = "207 74";
team = "1;";
};Above is the missioninfo. The variables here store the coordinates of the different things on the spawngui. Which means to get this stuff you'll need to make the layout then get the coordinates and assign them here.m1v - Big Map m2v - Top Small Map m3v - Bottom Small MapThese are the variables that tell whether or not to show the images assinged to their counter part vars. Their values are either true or false. If false the image will not be shown.
m1pic - File Path of Big Map m2pic - File Path of Small Top Map m3pic - File Path of Small Bottom MapThese vars are the location of the images used as maps.
c1 - Coordinates of the Symbol for Command Post 1 c1p - Coordinates of the Radio Button for Command Post 1 c2 - Coordinates of the Symbol for Command Post 2 c2p - Coordinates of the Radio Button for Command Post 2 c3 - Coordinates of the Symbol for Command Post 3 c3p - Coordinates of the Radio Button for Command Post 3 c4 - Coordinates of the Symbol for Command Post 4 c4p - Coordinates of the Radio Button for Command Post 4 c5 - Coordinates of the Symbol for Command Post 5 c5p - Coordinates of the Radio Button for Command Post 5 c6 - Coordinates of the Symbol for Command Post 6 c6p - Coordinates of the Radio Button for Command Post 6These variables contain the location on the gui where the different command posts are shown.
new SimGroup(outposts) {
new Trigger(1) {
position = "-642.173 -570.679 232.975";
rotation = "1 0 0 0";
scale = "2.3356 2.30641 7.71796";
dataBlock = "invasionTrigger";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
supporting = "1";
supportingt = "team1";
};
new Trigger(2) {
position = "-833.466 -102.064 239.987";
rotation = "1 0 0 0";
scale = "2.3356 2.30641 7.71796";
dataBlock = "invasionTrigger";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
supporting = "3";
supportingt = "team3";
};
new Trigger(3) {
position = "-655.054 159.526 256.5";
rotation = "1 0 0 0";
scale = "2.3356 2.30641 7.71796";
dataBlock = "invasionTrigger";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
supporting = "3";
supportingt = "team3";
};
new Trigger(4) {
position = "-363.051 212.598 222.786";
rotation = "1 0 0 0";
scale = "2.3356 2.30641 7.71796";
dataBlock = "invasionTrigger";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
supporting = "2";
supportingt = "team2";
};
new Trigger(5) {
position = "-66.4278 -15.3549 256.59";
rotation = "1 0 0 0";
scale = "2.3356 2.30641 7.71796";
dataBlock = "invasionTrigger";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
supporting = "3";
supportingt = "team3";
};
new Trigger(6) {
position = "-212.24 -439.743 286.621";
rotation = "1 0 0 0";
scale = "2.3356 2.30641 7.71796";
dataBlock = "invasionTrigger";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
supporting = "3";
supportingt = "team3";
};
}; The code above is the actual placement of the triggers that are the Command Posts. Notice there isn't code for the objects that are placed to show the location of each command post because when the game starts they are created automatically.
Not much is needed to be addressed except the two variables that are in the trigger datablocks.
supporting - Controlling team # supportingt - Controlling teamHere is a list of the teams and what would be in the variables if they controlled them.
Fury
supporting = "1";
supportingt = "team1";
Rage
supporting = "2";
supportingt = "team2";
Neutral
supporting = "3";
supportingt = "team3";
This Concludes this tutorial. I havn't worked on this in a while so I might have missed something so let me know. If anyone has a way to improve upon this please let me know and I'll add it.
About the author

Torque Owner J L
Psycho Hamster Games