This is the group of AvP2 modders responsible for developing the AvP2Fortress mod. If you whish to join us, please send us an e-mail.
Christmass is comming, and to celebrate it in it's true spirit, we're going to give all of you modders out there a gift!
Posted by Herr_Alien on Dec 24th, 2009
Don't hold your breath if you're waiting for some cool T-Shirts or some new games. Instead we decided to share some of the knowledge built while working on our AvP2 Team Fortress mod. The following articles will focus on something most mods would love to have:
A mod launcher that also checks for updates!
You've heared it right, our gift to you consists in a tutorial on how to create your own mod launcher and update uitility! And to sweeten things even more, we're throwing in and an already usable utility. With just a few changes to an .ini file this component can launch UT, Quake and even Source based mods!
The last part of the tutorial (yes, there is more! Plus, we get to pimp out our mod for another day ...) will contain the actual finished product and it will be released shortly after this one, 4-5 days maximum. Meanwhile, here are the feature that the launcher has:
Because all the key issues of the update mechanism can be set up to use your mod's web site, this tiny (under 100K) component gives you, the modder, full control over the update mechanism of your mod. No third party entities involved, just you and your community.
All the examples that will be listed below are based on just one program, called Nullsoft Scriptable Installer System. Go ahead and download it, and while waiting for the download to finish, read on.
Made by the very same people that also made WinAmp, NSIS is a tool that is intended to build installers. However, because of it's plug-in friendly architecture, NSIS aquired new capabilities, including an HTTP client and the possibility to launch external applications. Just what we need.
Now that your download has finished, install it. Sellect 'Full' as install option.
With the following examples we're hoping that you'll get yourself aquainted with how NSIS is being used. You'll also see bits of scripting that are then re-used in the final product.
Simple, browser-based, update
Without further ado, here's a very, very simple update mechanism. Granted that it just launches your default web browser to the URL of your latest patch, and it doesn't actually starts up the mod, the lesson here is that you can have the user reach the patch very, very easy:
Save the text above as "simple_update.nsi", right click on it and select to compile it:
You'll then get a small .exe; in the picture above I used a different name, but yours should be named exactly as stated in the .nsi file, "Update.exe". And now, the magic part: double click the exe.
Wallah! The user is directed to the update page of your mod's web site! Further more, you can set up the update page to automatically redirect you to the latest installer of your mod.
A stand-alone update mechanism
This one uses the HTTP client that I mentioned a couple of sections ago. It comes in the shape of the "NSISdl::download" plugin. The usage is straight forward:
You'll notice that we didn't set out a path for the local file. In our case, the .zip file gets downloaded to the same folder as the update executable.
There's a reason why I wanted to show the renaming capability: instead of .zip files, you can download self extracting archives, or even better, installers. In this case, the last command (ExecShell) launches the installer, providing a seamless installation of the update.
If the second update example didn't tip you off, here's how you can launch an external application.
That's it, really. Just that "ExecShell" command again. But that very command is all that we need to launch any game executable with just the right command line parameters. Command line parameters that basically tell "Hey you, game engine! Run this mod for me!".
This concludes the first article. In the following days we'll go even deeper, and we'll build a launcher&update utility that will give you, the modder, a reliable way to launch and patch up your mod. Stay tuned!