Game Development Community

loadMyMission() for T3D

by Gary Roberson · in Torque 3D Beginner · 03/04/2012 (10:18 pm) · 2 replies

Ok guys, I've created a basic simple GUI with only two bmp controls. for now, all I want to do is load a simple level.
Under TGE 1.4 all you had to do was place the command loadMyMission(); into the command parameter of the control.

When I looked at the PLay control in the example GUI, I saw something like Canvas.pushbuttom... which brought up another GUI. (which is good for future purposes, but for now, i simply want to load my level) but that's not what i'm looking for. I'm poring through the docs, (is there something like Getting Started with T3D like there was for TGE), but they are so lengthy that it's taking me some time to look them over!

In the meantime, does any torquer out there know the command to do this?

#1
03/05/2012 (7:40 am)
Disassemble the appropriate GUI like chooseLevel (or whatever it's called), read the scripts, see how things work, read the manuals.

In the meantime ...

%mission = "levels/Your_Mission_Here.mis";

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

   createAndConnectToLocalServer(%serverType, %mission);

which you can probably appreviate to:

createAndConnectToLocalServer("SinglePlayer", "levels/Your_Mission_Here.mis");
#2
03/05/2012 (9:29 am)
Level loading works the same in T3D as it did in TGE. The only difference is that the examples are using somewhat different code.

Code to me is always better than the Documentation; Steve illustrated the call you'll need to make. You can also find a simple loadLevel() function in "core/scripts/client/mission.cs". The actual function definition for createAndConnectToLocalServer() can be found in "core/scripts/server/server.cs"