Game Development Community

Switching missions using triggers in T3D vs. TGE

by Ray Taylor · in Torque 3D Professional · 05/29/2009 (9:50 pm) · 5 replies

Should I use different code in T3D to switch missions using an in game trigger compared to TGE? I have upgraded and everything is working -TGE Game to T3D after making the SFX sound changes, EXECPT the change mission part of the program (it at least leaves the original mission but hangs after that).
I used the code in ----http://www.garagegames.com/community/forums/viewthread/71655---- to make the TGE game mission switch and it worked great. Should it work in T3D after adjusting for new folder names?
Console errors says it can’t find the new mission.
If it should work, I will continue to search for my error. If it won’t work, what is the new code?

#1
05/29/2009 (10:40 pm)
It should work the same regardless of engine. Of course you have to set the filepath to the level correctly. I was just doing this very thing a few days ago. Here is what I used:
datablock TriggerData (ChangeLevelTrigger)
{
    tickPeriodMS = 100;
};

function ChangeLevelTrigger::onEnterTrigger(%this, %trigger, %obj)
{
    %client = %obj.client;
    if (!%client)
    {
        // We do not want NPC's or other AIplayers walking into our trigger and
        // seting off the ChangeLevelTrigger.
        return;
    }

    // Change "YOURLEVEL.mis" to the name of your level!
    %levelName = "YOURLEVEL.mis";

    // Spawn marker in the level to start at.  To make use of this simply add
    // this field to your trigger object and give it a named spawnPoint.  If one
    // isn't given then it will simply drop you at the first found spawn marker.
    %spawnPoint = %trigger.spawnPoint;

    echo("\c4Transferring client: "@ %client @" to "@ %levelName @" at "@ %spawnPoint);
    schedule(0, 0, loadMission, "levels/"@ %levelName, false, %spawnPoint);
}
#2
05/29/2009 (11:35 pm)
@Michael,
you reading our minds mate?
just when we wonder about these things, you knew it.
lovely, I woke up half an hour ago and thought "now to battle with loading the new levels"
and here it is!!
its getting to easy around here!
#3
05/30/2009 (12:31 am)
Nah, just been trying a bunch of different ideas out ;)

Getting to work on the basic FPS kit was a chance for me to start fresh with Torque once again after losing two years worth of work. Now I'm kind of wanting to get back to my own thing and I've also been toying with the idea of a single player fps kit - instead of the current multiplayer kit.

At one point or another in the last three years I've probably tried/tested just about every resource here. I'm finally getting a chance to truly play around and see what still works.
#4
05/30/2009 (12:39 am)
yeah? well keep at it,
its helping a lot of us, more than you think.
#5
05/30/2009 (2:27 pm)
Thanks, all is fine after fixing the filepath.

I had tried the filepath a few different ways and I had always put a higher folder in front of the "levels/" in line 25 from above.

The game is now up and running (just like in TGE). Thanks