Game Development Community

Mission Types

by Jon Jorajuria · in Torque Game Engine · 02/03/2006 (5:14 pm) · 2 replies

I have been failing at getting three mission types with a base superclass default mission implemented in my game. So in the interest of time, I was wondering if it were possible to have three seperate game.cs files that would be called based upon information in the *.mis files. For example:

Game *.cs files.

FFA.cs
TDM.cs
CTF.cs

*.mis file info:

new ScriptObject(MissionInfo) {
         name = "Stronghold";
         gametype = "FFA";
         descLines = "2";
         desc0 = "This death match mission takes place in a small orc village. There are no teams, every orc is your enemy!";
   };
What I would like to do is call the FFA.cs if any missions are loaded with that gametype info. Any suggestions would be welcome, I am a major time crunch. Thank you in advanced for your time.

#1
02/04/2006 (10:47 am)
Look for a function called "onMissionLoaded". From within this you could test MissionInfo.gameType and then activate the relevant gametype eg

deactivatePackage(ffaGameType);
deactivatePackage(tdmGameType);
deactivatePackage(ctfGameType);

switch$ (MissionInfo.gametype)
{
   case "FFA": activatePackage( FFAGameType );
   case "TDM": activatePackage( TDMGameType );
   case "CTF": activatePackage( CTFGameType );
}

each of those three files would have its functions defined within a package (have a look at some of the existing scripts to see how they do that).

that is assuming my understanding of packages holds up as I've never used them :P
#2
02/04/2006 (12:00 pm)
@Gary

I got it...thank you