Different Game Types
by N · in Torque Game Engine · 01/30/2008 (8:53 am) · 5 replies
What is the best way to have multiple game types?
Here's what I've been doing so far for DM TDM and KotH. :
My mission file has normal spawn points, team spawn points, and king of the hill triggers.
In the startMissionGui, there is a place to select the game type. From there, either deathmatch.cs, teamdeathmatch.cs, or kingofthehill.cs is loaded. There isn't a game.cs anymore.
Does this sound like a good way to do this?
Here's what I've been doing so far for DM TDM and KotH. :
My mission file has normal spawn points, team spawn points, and king of the hill triggers.
In the startMissionGui, there is a place to select the game type. From there, either deathmatch.cs, teamdeathmatch.cs, or kingofthehill.cs is loaded. There isn't a game.cs anymore.
Does this sound like a good way to do this?
About the author
#2
Then I have this in ./server/scripts/init.cs, under function initServer()
So the popupmenu should save the game type as $Server::MissionType, then the corresponding .cs file should load.
Mission loading stops at 100%
01/30/2008 (12:30 pm)
I have this in the startMissionGui::onWake() function in startMissionGui.guiSM_MissionType.add("Deathmatch", $Server::MissionType = "Deathmatch");
SM_MissionType.add("Team Deathmatch", $Server::MissionType = "Team Deathmatch");
SM_MissionType.add("King of the Hill", $Server::MissionType = "King Of The Hill");
SM_MissionType.add("Capture the flag", $Server::MissionType = "Capture The Flag");Then I have this in ./server/scripts/init.cs, under function initServer()
// Load up game server support scripts
exec("./scripts/commands.cs");
exec("./scripts/centerPrint.cs");
if($Server::MissionType $= "Deathmatch")
{
exec("./scripts/deathmatch.cs");
}
else
if($Server::MissionType $= "Team Deathmatch")
{
exec("./scripts/teamdeathmatch.cs");
}
else
if($Server::MissionType $= "King Of The Hill")
{
exec("./scripts/kingOfTheHill.cs");
}
else
if($Server::MissionType $= "Capture The Flag")
{
exec("./scripts/captureTheFlag.cs");
}So the popupmenu should save the game type as $Server::MissionType, then the corresponding .cs file should load.
Mission loading stops at 100%
#3
else if ...
instead of:
// else
if ...
01/30/2008 (2:18 pm)
Why did you comment out the else statement? Shouldn't it readelse if ...
instead of:
// else
if ...
#4
01/30/2008 (2:48 pm)
IDK. I just tried without the comments, and it still doesn't work.
#5
01/30/2008 (3:01 pm)
My second block, in ./server/init.cs now looks like this:// Load up game server support scripts
exec("./scripts/commands.cs");
exec("./scripts/centerPrint.cs");
if($Server::MissionType $= "Deathmatch")
{
exec("./scripts/deathmatch.cs");
}
else if($Server::MissionType $= "Team Deathmatch")
{
exec("./scripts/teamdeathmatch.cs");
}
else if($Server::MissionType $= "King Of The Hill")
{
exec("./scripts/kingOfTheHill.cs");
}
else if($Server::MissionType $= "Capture The Flag")
{
exec("./scripts/captureTheFlag.cs");
}
Torque Owner J.P. Berry
http://www.garagegames.com/mg/snapshot/view.php?qid=1326