distro mission dso problem
by Chadster · in Torque Game Engine · 02/05/2010 (2:58 am) · 6 replies
I'm creating a test distro and am having problems getting the distro to work with the mission dso files. They have the extension ".mis.dso". When "createServer(%serverType, %mission);" gets called Torque can't find the dso. But if I use the .mis file in %mission it loads fine. I read all the articles I could find and none of them really had a solution that I could see. Some people have recommended changing the mission file to a zip or other encryption schemes. I have a hesitation to go that route becaue the mission files are already compiling into dso files.
#2
02/05/2010 (11:16 am)
I am not having issues compiling the mission dso. Can someone confirm that TGE is not made to use compiled mission files.
#3
The string comparison for ".mis" against the file extension does not take into account of the possibility it could be ".mis.dso", it will just throw the file out due to the partial match.
Also, you will have problems with loadMissionStage2() in missionLoad.cs where it checks if the file exists. You have to pass the file name through the scripting as a ".mis" and not a ".mis.dso", otherwise exec() will try to compile it again and fail.
The quick and dirty way to get around the existence check is to do a double check.
02/05/2010 (2:59 pm)
The compile bool does more than flag what needs to be compiled, it also flags what compiled scripting can be read.The string comparison for ".mis" against the file extension does not take into account of the possibility it could be ".mis.dso", it will just throw the file out due to the partial match.
Also, you will have problems with loadMissionStage2() in missionLoad.cs where it checks if the file exists. You have to pass the file name through the scripting as a ".mis" and not a ".mis.dso", otherwise exec() will try to compile it again and fail.
The quick and dirty way to get around the existence check is to do a double check.
if( !isFile(%missionFile) )
{
if( !isFile(%missionFile@".dso") )
{
error( "Could not find mission " @ %missionFile );
return;
}
}
#5
Good job! It works with a minor change. %missionFile is actually %file in code I have.
Here is some additional changes I used to get mission dso files to work with a clean install of TGE 1.5 with AFX 1.1.
In startMissionGui::onWake() change:
In loadMissionStage2() make the changes:
In orc_mage.cs add:
In orc_warrior.cs add:
Follow Jeff's instructions:
www.torquepowered.com/community/forums/viewthread/78900
In ~/server/player.cs change:
02/06/2010 (1:54 pm)
Thanks Paul,Good job! It works with a minor change. %missionFile is actually %file in code I have.
Here is some additional changes I used to get mission dso files to work with a clean install of TGE 1.5 with AFX 1.1.
In startMissionGui::onWake() change:
//chad- distro change for(%file = findFirstFile($Server::MissionFileSpec@".dso"); %file !$= ""; %file = findNextFile($Server::MissionFileSpec@".dso"))
In loadMissionStage2() make the changes:
if( !isFile( %file ) ) {
//chad- distro change for mission dso load
if( !isFile(%file@".dso") )
{
error( "Could not find mission " @ %file );
return;
}
}
// Calculate the mission CRC. The CRC is used by the clients
// to caching mission lighting.
$missionCRC = getFileCRC( %file );
//chad- distro changes
%path = filePath(%file);
%file = %path@"/"@fileBase(%file);In orc_mage.cs add:
//chad- distro AFX sequence32 = "./CT/om_rm.dsq rm"; sequence33 = "./CT/om_gbof.dsq gbof"; sequence34 = "./CT/om_ap.dsq ap"; sequence35 = "./SP2/ChillKill_impact.dsq ck_hit"; sequence36 = "./SP2/ChillKill_casting.dsq ck";
In orc_warrior.cs add:
//chad- distro AFX sequence30 = "./SP2/ChillKill_impact.dsq ck_hit";
Follow Jeff's instructions:
www.torquepowered.com/community/forums/viewthread/78900
In ~/server/player.cs change:
// AFX CODE BLOCK <<
//chad- disable feature for distro
//exec("~/data/shapes/player/orc_players.cs");
/// ORIGINAL CODE
///exec("~/data/shapes/player/player.cs");
// AFX CODE BLOCK >>
//chad- distro player execs
exec("~/data/shapes/player/orc_warrior.cs");
exec("~/data/shapes/player/orc_mage.cs");
#6
02/06/2010 (2:08 pm)
Here is a batch file to create the distro. In the example directory create a new text file named "somegameDistro.bat". Copy and paste the command line code into the text file and save. Run batch file.Do not use this batch file unless you understand what its doing!
rmdir /s /q ..\..\somegameDistro mkdir ..\..\somegameDistro xcopy .\somegame_DEBUG.exe ..\..\somegameDistro /y xcopy .\main.cs ..\..\somegameDistro /y xcopy .\*.dll ..\..\somegameDistro /y /s xcopy .\*.dso ..\..\somegameDistro /y /s xcopy .\*.ml ..\..\somegameDistro /y /s xcopy .\*.png ..\..\somegameDistro /y /s xcopy .\*.jpg ..\..\somegameDistro /y /s xcopy .\*.dts ..\..\somegameDistro /y /s xcopy .\*.dsq ..\..\somegameDistro /y /s xcopy .\*.ter ..\..\somegameDistro /y /s xcopy .\*.ogg ..\..\somegameDistro /y /s xcopy .\*.dml ..\..\somegameDistro /y /s xcopy .\*.dif ..\..\somegameDistro /y /s xcopy .\*.dbc ..\..\somegameDistro /y /s
Torque Owner Paul /*ilys*/ Symeou
Default Studio Name
I'm not sure what affect this will have, but in consoleFunction.cs ~line 916 change the line to the following:
bool compiled = !journal && !Con::getBoolVariable("Scripts::ignoreDSOs");That will allow mis file compiling. Again, no idea what adverse effects it will have, especially with scene lighting.