Game Development Community

Setting preference for map types

by Richard Preziosi · in Torque Game Engine · 10/07/2009 (11:54 pm) · 1 replies

So I want to set up check boxes to select game type, and I have an idea of how to start this, but I think it's gonna be a little more advanced than I think. Hopeing to get some help, gonna post out what I have so far.

In my gui to start the mission, each checkbox has a variable that sets the mapType, which is simply set by pref::DM or pref::CTF.
// Map Type
function SelectMapType()
{
   if($pref::DM)
   {
	%mapType = "DM";
   }
   if($pref::CTF)
   {
        %mapType = "CTF";
   }
}

This is how I would set up the mission file.
//Map Type
function SetMapType()
   {
   if(%mapType = "DM")
       DEFINE WIN/LOSE SCENERIOS, ETC
       DEFINE TAG FOR FILTER/DISPLAY MAPTYPE
   }
   {
   if(%mapType = "CTF")
       DEFINE WIN/LOSE SCENERIOS, ETC
       DEFINE TAG FOR FILTER/DISPLAY MAPTYPE
   }
}

Then ofcourse I would add a filter for the join game screen, that would either filter out or display the gametype next to the map name. Is this the proper way of going about this, I feel like it should work, but I'm not a strong coder, so figured I would ask before I tried to implement and save myself from getting mad/discouraged.

Thanks

#1
10/08/2009 (1:18 am)
Looking through Game.cs it looks like some win variables are set in there, liek game duration and game cycling. Would I need to put my above .mis function into game.cs then? Feel like I'm building a house but don't have any nails.