How to port the TGE Starter.FPS pack to TGEA 1.0.3
by Joseph Euan · 09/26/2007 (12:53 pm) · 31 comments
This is a simple "How to" to walk you through how to port the starter.fps from TGE 1.5 to TGEA 1.0.3
Step 1:
Copy the starter.fps pack from TGE
Step 2:
Files\Folders to copy over:
From TGEA example\demo\client\ folder
prefs.cs
defaults.cs
to the example\starter.fps\client folder
-
From TGEA example\demo\client\scripts folder
commonMaterialData.cs
glowBuffer.cs
optionsDlg.cs
precip.cs
Shaders.cs
to the example\starter.fps\client\sripts folder
-
From TGEA example\demo\client\ui folder
optionsDlg.gui
to the example\starter.fps\client\ui folder
-
Step 4:
Open example\starter.fps\client\init.cs
add
Add
Add
Find the line that says
Step 5:
From TGEA example\demo\data copy over the files/folders
materials.cs
water folder
textures Folder
to example\starter.fps\data
Step 5: SpaceOrc Player
Copy the contents of
example\demo\data\shapes\spaceOrc
to
example\starter.fps\data\shapes\player folder
open example\starter.fps\data\shapes\player\materials.cs
and change all the lines that say
All thats left is to open the example/main.cs file and make sure you edit
You should then be able to start up the starter.fps :)
After some testing.. the all the .dif models work in TGEA.. but a few of the missions don't work.
No doubt theres going to be bugs, missing code etc... if you do find them and have a fix... please email me or post here and I'll update the info
I made this based on the TGE 1.5 starter pack.. but I'm told it also works for the 1.4 starter pack

Step 1:
Copy the starter.fps pack from TGE
Step 2:
Files\Folders to copy over:
From TGEA example\demo\client\ folder
prefs.cs
defaults.cs
to the example\starter.fps\client folder
-
From TGEA example\demo\client\scripts folder
commonMaterialData.cs
glowBuffer.cs
optionsDlg.cs
precip.cs
Shaders.cs
to the example\starter.fps\client\sripts folder
-
From TGEA example\demo\client\ui folder
optionsDlg.gui
to the example\starter.fps\client\ui folder
-
Step 4:
Open example\starter.fps\client\init.cs
add
//-----------------------------------------------------------------------------
// loadMaterials - load all materials.cs files
//-----------------------------------------------------------------------------
function loadMaterials()
{
for( %file = findFirstFile( "*/materials.cs" ); %file !$= ""; %file = findNextFile( "*/materials.cs" ))
{
exec( %file );
}
}
function reloadMaterials()
{
reloadTextures();
loadMaterials();
reInitMaterials();
}
//----------------------------------------------------------------------------- before the line function initClient()
Add
// material related
exec("./scripts/glowBuffer.cs");
exec("./scripts/precip.cs");
exec("common/client/shaders.cs");
exec("./scripts/shaders.cs");
exec("./scripts/commonMaterialData.cs" );
loadMaterials();
initRenderInstManager();to around line 111Add
function checkVideoInit()
{
if($GFX::OutdatedDrivers)
{
MessageBoxOK("Old Video Drivers",
"You have old video drivers. " @
"TGEA uses many advanced rendering features, and older drivers may not support them correctly. " @
"YOU SHOULD UPDATE YOUR DRIVERS BEFORE PROCEEDING. " @
$GFX::OutdatedDriversLink);
}
}After}
Canvas.setCursor("DefaultCursor");
} (at the bottom of the init.cs fileFind the line that says
initCanvas("Torque Game Engine", true);change to initCanvas("Torque Game Engine Advanced");Step 5:
From TGEA example\demo\data copy over the files/folders
materials.cs
water folder
textures Folder
to example\starter.fps\data
Step 5: SpaceOrc Player
Copy the contents of
example\demo\data\shapes\spaceOrc
to
example\starter.fps\data\shapes\player folder
open example\starter.fps\data\shapes\player\materials.cs
and change all the lines that say
~/data/shapes/SpaceOrcto
~/data/shapes/player
All thats left is to open the example/main.cs file and make sure you edit
$defaultGame = "demo";(change "demo" to "starter.fps")
You should then be able to start up the starter.fps :)
After some testing.. the all the .dif models work in TGEA.. but a few of the missions don't work.
No doubt theres going to be bugs, missing code etc... if you do find them and have a fix... please email me or post here and I'll update the info
I made this based on the TGE 1.5 starter pack.. but I'm told it also works for the 1.4 starter pack

About the author
#2
09/08/2007 (1:22 pm)
The only differance between yours and mine is - function checkVideoInit() - is at the very end of the file in mine. Did you re-export all the models? if not that will make it crash. The barebones mission should work without re-exporting any models, if it doesn't that is a good indication something is wrong in the script otherwise it's probably the models.
#3
You missed something out somewhere...
Go to rafb.net/p/fLeAwL44.html and use that code :)
Joseph
09/08/2007 (1:23 pm)
HiYou missed something out somewhere...
Go to rafb.net/p/fLeAwL44.html and use that code :)
Joseph
#4
I have not had chance to re export the models yet, but i will do so asap.
Could you recommend a way to batch this, or do i have to export each model individually?
Thanks again. :)
09/08/2007 (1:34 pm)
lol...i realised what i did and edited my post right before you posted :)I have not had chance to re export the models yet, but i will do so asap.
Could you recommend a way to batch this, or do i have to export each model individually?
Thanks again. :)
#5
09/10/2007 (4:29 pm)
I get a popup saying that OpenGL is not yet implemented. Does this have something to do with the models? How do you re-Export them if so?
#6
One of them contains all the info about D3D
09/11/2007 (12:36 am)
Make sure you copied the prefs.cs and defaults.cs files overOne of them contains all the info about D3D
#7
@Joseph, do you need to re-export the maps out also or just the models such as player and the statics etc.? I ask because I'm having some problems with Constructor 1.0.3 crashing on a re-export of the bridge.map group for whatever reason. Skipping it all together would be nice. Models on the other hand are no prob
09/11/2007 (1:31 am)
I noticed during my port that prefs.cs only exists if you run the starter.fps at least once .. maybe that's your problem? It took me a while to figure it out, even though its pretty much common sense prefs=preferences=must set some prefs before you get prefs.cs hehe ... yeah that confused me too@Joseph, do you need to re-export the maps out also or just the models such as player and the statics etc.? I ask because I'm having some problems with Constructor 1.0.3 crashing on a re-export of the bridge.map group for whatever reason. Skipping it all together would be nice. Models on the other hand are no prob
#8
Try placing one of them in one of the missions that load.
If I get time tonight, I'll have a play around and report what I find.
09/11/2007 (5:18 am)
you should only have to re-export the .dif files (unless they have already been exported using the new format)Try placing one of them in one of the missions that load.
If I get time tonight, I'll have a play around and report what I find.
#9
I'll look in to what needs sorting, to get the stronghold mission to load some time tonight if I get time.
EDIT: STUPID ME.. When I first did the port over to TGEA, I added some of the .difs to a mission I was playing around with.. how could I forget.. it was only a few days ago :(


09/11/2007 (9:49 am)
The .difs do work so you don't have to re-export them.I'll look in to what needs sorting, to get the stronghold mission to load some time tonight if I get time.
EDIT: STUPID ME.. When I first did the port over to TGEA, I added some of the .difs to a mission I was playing around with.. how could I forget.. it was only a few days ago :(


#10
09/11/2007 (4:05 pm)
Thanks for the info Joseph. Don't fret on forgetting something you did a few days ago-- I got so much code eating through my brain I can barely remember to answer the phone ;)
#11
Any guess as to what I'm doing wrong?
Edit: I finally got it to work. Somehow I deleted a "}" I have no idea how, since it wasn't even around any of the other code I had to alter, but now everything is AOK!
09/18/2007 (8:55 am)
Hmmm, I tried this last night and now this morning and I can't get it to work. I click on the exec and I get the Garage Games splash screen, but after that all I get is a black screen.Any guess as to what I'm doing wrong?
Edit: I finally got it to work. Somehow I deleted a "}" I have no idea how, since it wasn't even around any of the other code I had to alter, but now everything is AOK!
#12
09/19/2007 (9:11 pm)
Nice work! I am very new to TGEA and this resource worked pretty well. My only problem has been with A Stronghold. It generates an error and crashes TGEA. I imagine this has to do with additional models within the map. Thanks again for the great resources!
#13
I can't figure out if this is a glitch with TGEA or Constructor or The Port
09/20/2007 (10:19 pm)
Has anyone else been experiencing odd clipping Issues in TEGA when using constructor, especially buildings?I can't figure out if this is a glitch with TGEA or Constructor or The Port
#14
Thanks in advance,
Chris
09/23/2007 (6:28 am)
I have a few errors myself after running this a few times. For some reason after the first run, it automatically goes to full screen mode at 800 x 600 resolution. I've checked all the gui code and nothing has changed except what we were supposed to. If anyone has a fix to that, please share.Thanks in advance,
Chris
#15
onServerCreated()
I'm pretty sure that's required if you want to use the lighting system.
EDIT:
Erp. That already exists in 1.5. Sorry for the confusion. For any other mod not using 1.5, it will require that.
09/28/2007 (6:26 pm)
Nice walk through, but you're missing an important step. Yourgame/server/scripts/game.cs:onServerCreated()
exec("common/server/lightingSystem.cs");I'm pretty sure that's required if you want to use the lighting system.
EDIT:
Erp. That already exists in 1.5. Sorry for the confusion. For any other mod not using 1.5, it will require that.
#16
EDIT:
I got the issue fixed. I forgot to copy shader.cs...
I am assuming that the reason for Stronghold not working is incompatible .difs, as once I removed and replaced them with the TGEA starter onces all was well.
09/30/2007 (7:09 am)
Hmm, all is good, except water appears purple. The water looks normal if the main.cs file points to terrain_water_demo or demo, but when I put water into starter.fps its a solid purple. No shaders, and it doesn't even move.EDIT:
I got the issue fixed. I forgot to copy shader.cs...
I am assuming that the reason for Stronghold not working is incompatible .difs, as once I removed and replaced them with the TGEA starter onces all was well.
#17
09/30/2007 (9:02 am)
That's because you need material definitions for the water as well as the terrain. Copy the water and terrain folders into your starter.fps build and it should work fine.
#18
11/30/2007 (7:08 am)
i get a "torque is already running; exiting;" error when ever i try to start the ported starter.fps mod
#19
initCanvas("Torque Game Engine Advanced");
i had the same problem ;)
12/13/2007 (7:41 am)
make sure it says this :initCanvas("Torque Game Engine Advanced");
i had the same problem ;)
#20
01/02/2008 (6:03 pm)
Great resource! Thank you. 
Torque Owner metalliandy
Nice resource :)
My first problem was that i copied the
function checkVideoInit() { if($GFX::OutdatedDrivers) { MessageBoxOK("Old Video Drivers", "You have old video drivers. " @ "TGEA uses many advanced rendering features, and older drivers may not support them correctly. " @ "YOU SHOULD UPDATE YOUR DRIVERS BEFORE PROCEEDING. " @ $GFX::OutdatedDriversLink); } }to the
} Canvas.setCursor("DefaultCursor"); }thats around line 140 rather than line 165, which caused TGEA to crash immediately.Also the stronghold and lighting missions crash during the loading screens.
Any ideas?.
Great work!