[Français]

NEWS
INTRODUCTION
TERMINOLOGY
THE SOURCE CODE
THE BUGS
TUTORIALS
DOWNLOADS
THE AUTHOR

  BEGINNING WITH THE SOURCES: INSTALLING THE SOURCES

In this tutorial, I'll explain how to install and manage different programs to make AvP GE mods. No need to have experience in this domain: all will be detailled to ensure you that you can begin your C/C++ coding parties. Let's start:

1) Tools needeed

To make mods for AvP GE, you'll need several tools. Their purpose is to let you create your proper AvP application. For that, you'll need:
  • Microsoft Visual C++ v.6.0 (or 5.0 at least), which is a part of the Microsoft Visual Studio. It's purpose is to provide you a way to compile applications.
  • MSDN (optional, but recommended), this is the complete documentation for Visual Studio, compiled on useful cd-roms. In it, you'll find C++ functions documentation for Visual C++ and articles on other technologies. Note that no other documentation is provided with Visual C++.
  • DirectX SDK 8.1, for example (or 7.0 at least), to get the graphic & sound libraries for your mod
  • the Aliens versus Predator Source Code, for the core engine
  • the AvP Tools (optional), for the whole set of tools that you can use to make mods
2) Where to get these tools ?

For Microsoft Visual C++ and MSDN: I have no idea where to find these, since the release of .NET. Anyway, this is NOT free, but I think that it's the best choice for AvP mods.

Remark: you can try to compile with DevCpp, a free software that you can download from the net, but I don't know if it'll work. The only thing I know is that you need to add modules to make DirectX work with it... Maybe this will constitute a whole tutorial in the future...

Concerning DirectX SDK: you can find the lattest version on Microsoft's site. Personnaly, I use the 8.1 version.

Finally, you'll need to download the AvP Source Code, that you can find here or you can get the complete tools on AvPNews (if you just take the source code, you won't be able to make new levels, etc...).

Note: there are 3 versions of the AvP Source Code as I experienced it. The first one is packed in the file "avp source version 116.zip", the second in "AvP Source Version 116c.zip" and the last one in "avp_gold_source_116_1.zip". All these packages are contained in the "avptools.zip" one. What I know is that the 2 first packages doesn't contain the libraries & functions definitions for playing videos (and are exactly the same things), whereas the third does. In 2 words: take the last one if you want to add videos in your mod.

3) Installing the tools

Now, you can begin to install Visual C++. You can put it anywhere on your pc, no matter if you've got several hard disks or partitions. I just recommend you to keep the original folder name in the installation, because of MSDN and other possible tools... For the basic install, just take the default folder "C:\Program Files\Microsoft Visual Studio". There's nothing unusual in the installation process. It's the same thing with MSDN, which should place the files in the default folder "C:\Program Files\Microsoft Visual Studio\MSDN98" (for instance).

For the DirectX installation, you can decide to install it anywhere, as Visual C++. When you'll install it, you'll be prompted to enter the type of installation: usually, there are 2 versions of the SDK, the first is the basic one that's used in common game releases, with minimum options in it to ensure maximum performance. The second type of install is the debug one, which can provide you deeper debuging informations on your applications, but will lower their performance. I recommend to install the second type for now and when you'll have a complete application, you can compile it with the first. Anyway, it depends on your hard disk's space... When you'll install the SDK, you'll be prompted for the inclusion of DirectX libraries in Visual Studio: follow this choice to make it easier.

For the AvP Source Code, you can unzip it anywhere on your hard disk: this is where you'll manage your project and compile your applications for AvP. One important thing to do is to unset the "read only" attribute of all the files under Windows, because you won't be able to modify the sources. Concerning the other tools of AvP GE, I recommend you to read the "install_readme.txt" file contained in the archive and to follow the instructions closely. The main key for the AvP Tools installation is: respect directories. For more explanations, you've got the "AvP Bible" in it...

4) Preparing Visual Studio for AvP projects

In order to make AvP Sources working with Visual Studio, you'll need to modify these:
  • Search for the file "Psndproj.c" and replace the lines:
    strcat((char*)&soundFileName, ".SL");
    myFile = fopen(soundFileName,"rt");
    LOCALASSERT(myFile!=NULL);

    by

    strcat((char*)&soundFileName, ".SL");
    myFile = fopen(soundFileName,"rt");
    // LOCALASSERT(myFile!=NULL);

    This will avoid a local assertion problem with the sound engine.


  • Now, search for the file "platform.h" and change the following lines:

    #include "ddraw.h"
    #include "d3d.h"
    #include "dsound.h"
    #include "dplay.h"
    #include "dinput.h"
    #include "dplobby.h"
    //#include "fastfile.h"

    by

    #include "ddraw.h"
    #include "d3d.h"
    #include "dsound.h"
    #include "dplay.h"

    #define DIRECTINPUT_VERSION 0x0700

    #include "dinput.h"
    #include "dplobby.h"
    //#include "fastfile.h"

    only if your DirectX SDK's version is greater than 7.0: this will let DirectX "understand" that you'll use an older version of functions within AvP (originaly designed with DirectX 6).


Okay, so now, the last thing to do is to setup the projects options in Visual Studio:
  • Go to the Project > Settings... menu, then select Win32 Release in front of "Settings for:". Now, go to the "Debug" tab and put the following informations:


  • Executable for debug session: your complete path to your future .exe file
    (ex.: C:\AvP_vc\AvP_Release.exe)
    Working directory: your path to the game
    (ex.: C:\Program Files\Aliens versus Predator\)

  • The second thing to do is to setup your future executable filename. Go to the "Link" tab and in "Output file name, put the same name you entered before (ex.: AvP_Release.exe). This name is the file that will be created when you'll compile the source code with the Win32 Release mode.


  • Finally, you'll check that DirectX is well configured with Visual Studio. Go to the C/C++ tab and take a look at the "Project Options". You should find "c:\mssdk\include": change it to your DirectX SDK directory (depending where you installed it). After that, change the "Category" list to "Preprocessor" and in "Additional include directories", verify that the path to the directory is valid. You can find it too in the Tools > Options... > Directories menu.

You've configured the project for the "Win32 Release" mode, now repeat these 3 steps for the "Win32 Debug" and "Win32 Release For Fox" modes. We will see in another tutorial what all these means... You're now ready to compile the sources.