Forums Index >> Modding >> final mozwiz script.



Page : <1> :


I need the instructions on how to put the script at the end of "main.cs," because the readme dosn't say enough. Can you just give me the whole working file? I followed all the steps and tried to put the script in, but when I made a locked server with no bots, it didn't work. :o :o help, please! Oh, yeah, can any of you e-mail me da Adminastrator code???? PLEASE??? Ok, thanks, guys. XD

Friday, July 30, 2004 at 10:52:34 PM

PLEASE?I really wanna start modding!

Saturday, July 31, 2004 at 12:34:43 PM

Type it in at the very bottom (kinda simple XD )

Saturday, July 31, 2004 at 12:37:43 PM

Dev b nice

Sunday, August 01, 2004 at 2:53:41 AM

Grr. Ok, at the VERY bottom?? ;)

Monday, August 02, 2004 at 12:48:50 PM

THIS IS WHAT MY MAIN.CS FILE LOOKS LIKE!

//-----------------------------------------------------------------------------
// Torque Game Engine
//
// Copyright (c) 2001 GarageGames.Com
// Portions Copyright (c) 2001 by Sierra Online, Inc.
//-----------------------------------------------------------------------------

$baseMods = "common";
$userMods = "game";
$displayHelp = false;

//-----------------------------------------------------------------------------
// Support functions used to manage the mod string

Function pushFront(%list, %token, %delim)
{
if (%list !$= "")
return %token @ %delim @ %list;
return %token;
}

Function pushBack(%list, %token, %delim)
{
if (%list !$= "")
return %list @ %delim @ %token;
return %token;
}

Function popFront(%list, %delim)
{
return nextToken(%list, unused, %delim);
}

Function doCompileAll()
{
for(%file = findFirstFile("*.cs"); %file !$= ""; %file = findNextFile("*.cs"))
{
if (strstr(%file,"/CVS/") != -1)
continue;
compile(%file);
}
for(%file = findFirstFile("*.gui"); %file !$= ""; %file = findNextFile("*.gui"))
{
if (strstr(%file,"/CVS/") != -1)
continue;
compile(%file);
}
%misfile = new FileObject();
if (%misfile.openForWrite("game/data/missions/missions.txt"))
{
exec("common/server/missionInfo.cs");
%misfile.writeLine("[name]");
for (%file = findFirstFile("*.mis"); %file !$= ""; %file = findNextFile("*.mis"))
{
if (strstr(%file,"/TT") == -1 && strstr(%file,"Brain") == -1)
continue;
if (strstr(%file,"/CVS/") != -1)
continue;
buildLoadInfo(%file);
while (strstr(%file,"/") != -1)
%file = getSubStr(%file,strstr(%file,"/")+1,strlen(%file)-strstr(%file,"/")-1);
%file = getSubStr(%file,0,strlen(%file)-4);
%misfile.writeLine(%file @ "=" @ MissionInfo.name);
}
%misfile.close();
clearLoadInfo();
}

%savePref = $pref::Terrain::useSmall;
$pref::Terrain::useSmall = false;
for(%file = findFirstFile("*.ter"); %file !$= ""; %file = findNextFile("*.ter"))
{
if (strstr(%file,"/TT") == -1)
continue;
if (strstr(%file,"/CVS/") != -1)
continue;
%terr = new TerrainBlock() {
terrainFile = %file;
squareSize = "8";
tile = "0";
blockShift = "7";
};
if (%terr.blockShift == 7)
{
// possible that terrain was already 6, even though
// block shift was set to 7 in constructor above...
//...that's why this is conditional.
echo("Reducing terrain :" @ %file);
%terr.blockShift = "6";
%terr.resave("","_LO");
}
%terr.delete();
}
$pref::Terrain::useSmall = %savePref;
}

//------------------------------------------------------------------------------
// Process command line arguments

For ($I = 1; $I < $Game::argc ; $I++)
{
$arg = $Game::argv[$I];
$nextArg = $Game::argv[$I+1];
$hasNextArg = $Game::argc - $I > 1;
$logModeSpecified = false;

Switch$ ($arg)
{
//--------------------
case "-log":
$argUsed[$I]++;
if ($hasNextArg)
{
// Turn on console logging
if ($nextArg != 0)
{
// Dump existing console to logfile first.
$nextArg += 4;
}
setLogMode($nextArg);
$logModeSpecified = true;
$argUsed[$I+1]++;
$I++;
}
else
error("Error: Missing Command Line argument. Usage: -log <Mode: 0,1,2>");

//--------------------
case "-demo":
$argUsed[$I]++;
$Game::DemoMode = true;

//--------------------
case "-show":
// A useful shortcut for -mod show
$userMods = strreplace($userMods, "show", "");
$userMods = pushFront($userMods, "show", ";");
$argUsed[$I]++;

//--------------------
case "-console":
enableWinConsole(true);
$argUsed[$I]++;

//--------------------
case "-compileAll":
$argUsed[$I]++;
enableWinConsole(true);
// call doCompileAll() below...

//--------------------
case "-jSave":
$argUsed[$I]++;
if ($hasNextArg)
{
echo("Saving event log to journal: " @ $nextArg);
saveJournal($nextArg);
$argUsed[$I+1]++;
$I++;
}
else
error("Error: Missing Command Line argument. Usage: -jSave <journal_name>");

//--------------------
case "-jPlay":
$argUsed[$I]++;
if ($hasNextArg)
{
playJournal($nextArg,false);
$argUsed[$I+1]++;
$I++;
}
else
error("Error: Missing Command Line argument. Usage: -jPlay <journal_name>");

//--------------------
case "-jDebug":
$argUsed[$I]++;
if ($hasNextArg)
{
playJournal($nextArg,true);
$argUsed[$I+1]++;
$I++;
}
else
error("Error: Missing Command Line argument. Usage: -jDebug <journal_name>");

//-------------------
case "-help":
$displayHelp = true;
$argUsed[$I]++;

//-------------------
case "-test":
$Game::testMode=true;
$argUsed[$I]++;
}
}

//-----------------------------------------------------------------------------
// The displayHelp, onStart, onExit and parseArgs function are overriden
// by mod packages to get hooked into initialization and cleanup.

Function onStart()
{
// Default startup function
}

Function onExit()
{
// OnExit is called directly from C++ code, whereas onStart is
// invoked at the end of this file.
disconnect();
}

Function parseArgs()
{
// Here for mod override, the arguments have already
// been parsed.
}

Package Help {
function onExit() {
// Override onExit when displaying help
}
};

Function displayHelp() {
activatePackage(Help);

// Notes on logmode: console logging is written to console.log.
// -log 0 disables console logging. (default)
// -log 1 appends to existing logfile; it also closes the file
// (flushing the write buffer) after every write.
// -log 2 overwrites any existing logfile; it also only closes
// the logfile when the application shuts down.

Error(
"ThinkTanks command line options: "@
" -log <logmode> Logging behavior; see main.cs comments for details "@
" -console Open a separate console "@
" -jSave <file_name> Record a journal "@
" -jPlay <file_name> Play back a journal "@
" -jDebug <file_name> Play back a journal and issue an int3 at the end "@
" -test Test launch the app "@
" -help Display this help message "
);
}

//--------------------------------------------------------------------------

// Default to a new logfile each session.
if (!$logModeSpecified) {
setLogMode(0);
}

// Set the mod path which dictates which directories will be visible
// to the scripts and the resource engine.
$modPath = pushback($userMods, $baseMods, ";");
setModPaths($modPath);

// Get the first mod on the list, which will be the last to be applied... This
// does not modify the list.
nextToken($modPath, currentMod, ";");

// Execute startup scripts for each mod, starting at base and working up
echo("--------- Loading MODS ---------");
function loadMods(%modPath)
{
%modPath = nextToken(%modPath, token, ";");
if (%modPath !$= "")
loadMods(%modPath);

Exec(%token @ "/main.cs");
}
loadMods($modPath);
echo("");

// Parse the command line arguments
echo("--------- Parsing Arguments ---------");
parseArgs();

// Either display the help message or startup the app.
if ($displayHelp)
{
enableWinConsole(true);
displayHelp();
}
else if ($Game::argc==2 && $Game::argv[1] $= "-compileAll")
{
doCompileAll();
quit();
}
else
{
onStart();
echo("Engine initialized...");
}

// Display an error message for unused arguments
for ($I = 1; $I < $Game::argc; $I++) {
if (!$argUsed[$I])
error("Error: Unkown command line argument: " @ $Game::argv[$I]);
}

// ModWizard
exec("game/server/scripts/ModWizardMain.cs");
if (!$Server::Dedicated) {
moveMap.bindCmd(keyboard, "m", "",
"exec("game/client/scripts/ModWizardBindings.cs");");
}

Monday, August 02, 2004 at 12:52:25 PM

Am I doing that right? :o

Monday, August 02, 2004 at 12:53:16 PM

Hello? :[ need help now!

Monday, August 02, 2004 at 8:24:58 PM

Looks fine

Monday, August 02, 2004 at 9:23:13 PM

Then I must have put it in the wrong place... I put it in the resources file. Is that right? Oh, poop. 8(

Tuesday, August 03, 2004 at 12:22:20 PM

No, put it under the SECOND }. That's your problem.

 

Tuesday, August 03, 2004 at 2:42:23 PM

Example, spunk? :'(

Tuesday, August 03, 2004 at 5:16:08 PM

Ok, I got it to work in someone elses server, but not in my own locked one. Im confuzzled. Does it have to be dedicated? 8o :o :(

Tuesday, August 03, 2004 at 6:18:49 PM

Im confused :S

Thursday, August 05, 2004 at 1:39:57 PM

HELP!

Friday, August 06, 2004 at 6:33:41 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald