Game Development Community

Trying to make a custom "load mission" command

by Nicolai Dutka · in Torque Game Engine · 09/08/2007 (5:21 pm) · 1 replies

I have something that works and loads a mission, but for some reason it seems to keep loading a cached version of that mission.

If I add anything at all to the world and then save it, it saves the changes to the right file, but when it loads, the changes are not there. If I, then, go to the World Editor (after using the code below), and go to File->Open and open the mission I am already in, the changes I made earlier will appear.

I need it to load properly the first time of course. :P

Can anyone see why it is doing this? (I am using TGE 1.5.2 and the Starter.FPS folder)

Oh, and this code is written to the MainMenuGui.gui in case that matters.

function start()
{
disconnect();
createServer("SinglePlayer", expandFilename("starter.fps/data/missions/barebones.mis"));
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connectLocal();
}

#1
09/09/2007 (11:10 pm)
I found the problem.

The code in my first post here is good and works.

The problem was in my timing of executing my scripts for my shapes and bots and such.

I got them executing sooner (like BEFORE trying to place them!) and everything is all good now.

WOOT!! Hope this helps someone else!