←  C&C Generals & Zero Hour Editing

Fallout Studios Forums

»

Generals Mod Launcher

CodeCat's Photo CodeCat 01 Oct 2006

I've been working on this little thing, and it's more or less finished now. It's a mod launcher for Generals/ZH which supports an unlimited amount of mods. It's not as fancy as Mod Toaster, and it doesn't even have an interface. It's all controlled from the command line and through XML script files. Each script file controls which mod is loaded and from where, and exactly how it's loaded. It's also possible, using the -p command line option, to pass parameters such as -quickstart on to the game.

The advantage of this is that you can create shortcuts to the launcher. You don't need to first click your way through some kind of interface, just double click the shortcut and off you go. And you can put a mod ANYWHERE, and only move/copy it to the game folder when it's actually being used (the launcher will do this if the script is made properly). No more mod conflicts! And it also allows you to configure your mod how you like - all you need to do is change the script file to fit your mod. So if your mod has the skirmish scripts inside a BIG file, then you can have that (just rename the existing skirmishscripts through the modlauncher).

This tool is primarily meant for mod developers themselves. The idea is that they can both use the tool for themselves (like running a developer and release version of the mod side by side), and supply it with their mod, including a proper XML launcher script so others can use it without having to fiddle with the script themselves. And you're encouraged to make your own graphical user interface!

So here's what you need to do: Download the file. Then edit the default.xml file to suit your needs. The file is richly commented so you shouldn't have much trouble figuring it out. You can copy the xml file and use different scripts for different mods.

To tell the launcher to use a specific script, use the -f "filename" option, like this:
ModLauncher.exe -f "mymod.xml"
To run the launcher in a different mode (for example to launch world builder), use -m <mode>. Like
ModLauncher.exe -m wb
for example. Launch modes are configured in the script file in the <modes> section.
To pass parameters to the game, use -p "parameters". For example to launch the game in quickstart, use:
ModLauncher -p "-quickstart"

That's it! Now, give it a try and please tell me what you think! And if you find any problems or are having trouble understanding how it works, just post here and I'll see what I can do. :P


Download Mod Launcher


Legal info: This program was written by me, and as such I have the copyright to it. You may spread it freely, but if you offer the file up to be downloaded publically you must notify me of it. In principle the program is a slightly restricted form of open source - you can use the code if you ask me for it. However if you edit and improve the existing program, or use my program code in a larger project, you must credit me for the original work.
Edited by Bob, 17 November 2011 - 22:20.
Quote

Futschki's Photo Futschki 01 Oct 2006

Congratulation codecat I will download it and try it
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 01 Oct 2006

This is an awsome idea, its going to save so much time, but whenever i try and use it, it keeps coming up with this error:

Posted Image

what am i doing wrong?
Quote

CodeCat's Photo CodeCat 01 Oct 2006

Two possibilities:

Either:
You set <gamedir> to nothing at all (i.e. just <gamedir></gamedir>) and didn't put the launcher in the game folder, or
You set <gamedir> wrong so it's looking for the game in the wrong place.
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 01 Oct 2006

i left it as the default, and it seems to find it alright, because it copies the mod file to the right place, but then that message come up

the same thing happens when i try and start world builder through the mod loader

EDIT: doesn't matter i fixed it...

i changed generals.exe to the full directory rather than just the application
Edited by Bob, 01 October 2006 - 16:46.
Quote

CodeCat's Photo CodeCat 01 Oct 2006

What was wrong? How did you fix it?
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 01 Oct 2006

where it said:

<defaultmode>generals.exe</defaultmode>

i changed it to:

<defaultmode>C&#58;\Program Files\EA Games\Command &amp; Conquer Generals Zero Hour\generals.exe</defaultmode>
Quote

CodeCat's Photo CodeCat 01 Oct 2006

Ahh yes! I forgot to add the gamedir to the program modes when it starts them! *slaps self*

Fixed and updated download link.
Quote

CodeCat's Photo CodeCat 14 Oct 2006

Link updated again.
Quote

Dauth's Photo Dauth 08 Aug 2008

This is a guide to using CodeCat's mod launcher on Contra so you won't have issues having it in the same folder as Shockwave, RoTR 2 (Upon release), WG:ZH & Code 13.

If you plan on using a unique ZH install for every mod you need not bother with this guide. Firstly Contents of CodeCat's launcher.
Readme.txt
Modlauncher.exe
Default.xml

First things, keep a backup of the original then move Modlauncher.exe & Default.xml to your ZH directory, rename them to Contra.exe and Contra.xml respectivly.

Use your extractor program Winrar, 7Zip to extract the contents of the installer to a folder (not in ZH yet)

Data\Scripts\Scripts.ini
Data\Scripts\MultiplayerScripts.scb
Data\Scripts\SkirmishScripts.scb
00000000.016
00000000.256
game.dat
ContraLauncher.exe (Not necessary but used later for an icon)
!Contra006.big
!Contra006-eng.big
!Contra006Music.big
!Contra006-rus.big
Install_Final.bmp

Rename these to
Data\Scripts\ContraScripts.ini
Data\Scripts\ContraMultiplayerScripts.scb
Data\Scripts\ContraSkirmishScripts.scb
Contra00000000.016
Contra00000000.256
Contragame.dat
!Contra006.gib
!Contra006-eng.gib
!Contra006Music.gib
!Contra006-rus.gib (This is used for Russian users, replace !Contra006-eng.gib with this in the code for Russian language)
ContraInstall_Final.bmp

Move the renamed files to your ZH folder, there should be no overwrite issues

Now find the file Contra.xml (In notepad or something similar), scroll to the bottom until you find this set of text
	<files>
		<file method=&#34;move&#34;>
			<src dir=&#34;game&#34;>Data/Scripts/SkirmishScripts.scb</src>
			<dest dir=&#34;game&#34;>Data/Scripts/SkirmishScripts.scb.backup</dest>
		</file>
		<file method=&#34;move&#34;>
			<src dir=&#34;game&#34;>Data/Scripts/MultiplayerScripts.scb</src>
			<dest dir=&#34;game&#34;>Data/Scripts/MultiplayerScripts.scb.backup</dest>
		</file>
		<file method=&#34;copy&#34;>
			<src dir=&#34;mod&#34;>MyMod.big</src>
			<dest dir=&#34;game&#34;>00MyMod.big</dest>
		</file>
	</files>


This changes the names of files before the game runs allowing it to activate contra before starting Zero Hour. Now in our case we need a number of changes to be made. Below is a full list of changes required. Copy this over the code above.


	<files>
		<file method=&#34;move&#34;>
			 <src dir=&#34;game&#34;>Data/Scripts/Scripts.ini</src>
			 <dest dir=&#34;game&#34;>Data/Scripts/Scripts.ini.backup</dest>
		 </file>
		<file method=&#34;move&#34;>
			<src dir=&#34;game&#34;>Data/Scripts/SkirmishScripts.scb</src>
			<dest dir=&#34;game&#34;>Data/Scripts/SkirmishScripts.scb.backup</dest>
		</file>
		<file method=&#34;move&#34;>
			<src dir=&#34;game&#34;>Data/Scripts/MultiplayerScripts.scb</src>
			<dest dir=&#34;game&#34;>Data/Scripts/MultiplayerScripts.scb.backup</dest>
		</file>
		<file method=&#34;move&#34;>
			  <src dir=&#34;game&#34;>Data/Scripts/ContraScripts.ini</src>
			  <dest dir=&#34;game&#34;>Data/Scripts/Scripts.ini</dest>
		  </file>
		 <file method=&#34;move&#34;>
			 <src dir=&#34;game&#34;>Data/Scripts/ContraSkirmishScripts.scb</src>
			 <dest dir=&#34;game&#34;>Data/Scripts/SkirmishScripts.scb</dest>
		 </file>
		 <file method=&#34;move&#34;>
			 <src dir=&#34;game&#34;>Data/Scripts/ContraMultiplayerScripts.scb</src>
			 <dest dir=&#34;game&#34;>Data/Scripts/MultiplayerScripts.scb</dest>
		 </file>
		<file method=&#34;move&#34;>
			<src dir=&#34;mod&#34;>00000000.016</src>
			<dest dir=&#34;game&#34;>00000000.016.backup</dest>
		</file>
		<file method=&#34;move&#34;>
			 <src dir=&#34;mod&#34;>00000000.256</src>
			 <dest dir=&#34;game&#34;>00000000.256.backup</dest>
		 </file>
		<file method=&#34;move&#34;>
			 <src dir=&#34;mod&#34;>game.dat</src>
			 <dest dir=&#34;game&#34;>game.dat.backup</dest>
		 </file>
		<file method=&#34;move&#34;>
			 <src dir=&#34;mod&#34;>Contra00000000.016</src>
			 <dest dir=&#34;game&#34;>00000000.016</dest>
		 </file>
		 <file method=&#34;move&#34;>
			  <src dir=&#34;mod&#34;>Contra00000000.256</src>
			  <dest dir=&#34;game&#34;>00000000.256</dest>
		  </file>
		 <file method=&#34;move&#34;>
			  <src dir=&#34;mod&#34;>Contragame.dat</src>
			  <dest dir=&#34;game&#34;>game.dat</dest>
		  </file>
		<file method=&#34;move&#34;>
				<src dir=&#34;mod&#34;>Install_Final.bmp</src>
				<dest dir=&#34;game&#34;>Install_Final.bmp.backup</dest>
			</file>
		<file method=&#34;move&#34;>
			   <src dir=&#34;mod&#34;>ContraInstall_Final.bmp</src>
			   <dest dir=&#34;game&#34;>Install_Final.bmp</dest>
		   </file>
		<file method=&#34;copy&#34;>
			<src dir=&#34;mod&#34;>!Contra006.gib</src>
			<dest dir=&#34;game&#34;>!Contra006.big</dest>
		</file>
		<file method=&#34;copy&#34;>
			 <src dir=&#34;mod&#34;>!Contra006-eng.gib</src>
			 <dest dir=&#34;game&#34;>!Contra006-eng.big</dest>
		 </file>
		<file method=&#34;copy&#34;>
			 <src dir=&#34;mod&#34;>!Contra006Music.gib</src>
			 <dest dir=&#34;game&#34;>!Contra006Music.big</dest>
		 </file>
		<file method=&#34;copy&#34;>
			 <src dir=&#34;mod&#34;>!Contra006.gib</src>
			 <dest dir=&#34;game&#34;>!Contra006.big</dest>
		 </file>
	</files>


The bulk of the coding is now done, create a shortcut to Contra.exe and place it on your desktop (or wherever you run games from) enter the properties of the shortcut and add -f "Contra.xml" then save the changes. If you wish to change the icon you can select from any of the game icons (or one made by yourself) or the one for the launcher file provided.

The weakness of this method are a slightly extended load time and a lack of official contra icon (if you can acquire it from someone with a full install you're onto a winner), but it does mean that you do not need another ZH install, nor do you need to remove/repair your install when you want to play another mod.

Furthermore I will create the .xml file for any mod should you submit to me a file list in a dedicated thread.

The launcher was provided by CodeCat and all rights are his, Contra is the property of it's mod team and leader.
Quote

Nem's Photo Nem 08 Aug 2008

This is a huge waste of time. If you don't know how to move .big files around use http://www.isotx.com/crosus/.
Quote

Slightly Wonky Robob's Photo Slightly Wonky Robob 08 Aug 2008

and what about mods that don't work with that?
Quote

Nem's Photo Nem 08 Aug 2008

Almost every ZH mod is on there, if it's not then bug the developer to upload. |8
Quote

Slye_Fox's Photo Slye_Fox 08 Aug 2008

And what about devolopers who DON'T want their mod on it (such as myself).
Quote

Nem's Photo Nem 08 Aug 2008

The fans suffer.
Quote

Dauth's Photo Dauth 08 Aug 2008

Also what about defunct mods? What about people who can't be bothered to use Crosus, this is another option, Nem if you don't want to use it you don't have to.
Quote

Nem's Photo Nem 09 Aug 2008

If a person can't figure how to move a couple of .big files how will they figure this out?
Don't get me wrong its a good cause but I don't see many people using it. |8

-Nem
Edited by Nem, 09 August 2008 - 01:17.
Quote

Zeke's Photo Zeke 09 Aug 2008

Crosus might be good for beginners.

but for more advance users I recommend Codecat's launcher, it's more flexible.
Quote

Zeke's Photo Zeke 01 Sep 2009

OMG Necro!

But I've run into a problem

The launcher isn't reading the "&" sign in the game directory resulting in:

Posted Image
Quote

CJ's Photo CJ 01 Sep 2009

Stickies can't be necroed

For your problem, replace "&" by "&amp;" like in here :

<gamedir>C&#58;\Program Files\Electronic Arts\Command &amp; Conquer The First Decade\Command &amp; Conquer&#40;tm&#41; Generals Zero Hour</gamedir>
Quote

Zeke's Photo Zeke 01 Sep 2009

View PostNikola Tesla, on 1 Sep 2009, 20:39, said:

Stickies can't be necroed

For your problem, replace "&" by "&amp;" like in here :

<gamedir>C&#58;\Program Files\Electronic Arts\Command &amp; Conquer The First Decade\Command &amp; Conquer&#40;tm&#41; Generals Zero Hour</gamedir>


It is...

<gamedir>C&#58;\Program Files\EA Games\Command &amp; Conquer Generals Zero Hour</gamedir>
Quote

CJ's Photo CJ 01 Sep 2009

I said like in this example |8
I have TFD version, that's why the path is different
Quote

CodeCat's Photo CodeCat 01 Sep 2009

I am currently working on rebuilding the mod launcher. This may take some work as I originally built it with VC++, which I no longer have or use. The new build will be done with MinGW instead, so some adjustments are needed. Not to mention I have to rebuild the libraries I used from scratch. The good news however is that I will be releasing it under the GPL so everyone can mess around with it now.

I am not planning to add any new features, as I can't really think of any to add. If you have any feature requests, please post them!

Features that I will NOT add:
- a GUI (this defeats the purpose I intended with it)
Quote

Zeke's Photo Zeke 05 Sep 2009

Well my only real complaint about the launcher is it takes a while to load.
Edited by Zeke, 05 September 2009 - 13:00.
Quote

Dauth's Photo Dauth 05 Sep 2009

View PostZeke, on 5 Sep 2009, 13:59, said:

Well my only real complaint about the launcher is it takes a while to load.

When you use the launcher it changes the name and location of several files, more files = longer load. Fastest load will be for single small file being changed.
Quote