Game Development Community

load my mission first

by Thomas Wahl · in General Discussion · 01/25/2010 (9:56 am) · 5 replies

My question is i have no idea on where to start my research on how to load my level instead of the default load on my project. What i do is open my project and then open it in terrain editor. how can i bypass this, and how do i search this

About the author

Current Student, game software development, artist, and game programmer.


#1
01/25/2010 (10:26 am)
Not sure I'm clear on which you're trying to do: Is it a level you're loading, or a terrain?
#2
01/25/2010 (10:44 am)
well I'm trying to load my game from the start. Everytime I open my project a default board opens. I just want to go straight to my mission not the mission with the castle.
#3
01/25/2010 (11:45 am)
Ahhh... Well, what you can do is create/modify a button in mainMenuGui to call a function that starts a specific mission. Below is what I did for mine, so make the changes appropriate for your project.

In mainMenuGui.cs, you can insert a button like so:
new GuiButtonCtrl() 
{
  profile = "GuiButtonProfile";
  horizSizing = "right";
  vertSizing = "top";
  position = "36 237";
  extent = "110 20";
  minExtent = "8 8";
  visible = "1";
  command = "SM_StartMission();";
  text = "Start Mission...";
  groupNum = "-1";
  buttonType = "PushButton";
  helpTag = "0";
};

Then in startMissionGui.cs comment out SM_StartMission() and change it to:
function SM_StartMission()
{
   %mission = "./levels/level.mis"; //Or whatever mission you have

   if ($pref::HostMultiPlayer)
      %serverType = "MultiPlayer";
   else
      %serverType = "SinglePlayer";

   createServer(%serverType, %mission);
   %conn = new GameConnection(ServerConnection);
   RootGroup.add(ServerConnection);
   %conn.setConnectArgs($pref::Player::Name);
   %conn.setJoinPassword($Client::Password);

   %conn.connectLocal();
}

That function starts the specific mission in the %mission variable when you click that "Start Mission..." button in mainMenuGui. Hope that helps.
#4
01/25/2010 (11:53 am)
awesome ty so much
#5
01/25/2010 (9:20 pm)
I aim to please :)