For Modders: Turning VS2003 into the perfect modding platform!

Déja

Beyond the Mod
Joined
Dec 19, 2005
Messages
353
Well, since I had to dig out my VS2003 disks and dust them off in order to work with the CivIV SDK, I figured I would make it worth my while and use VS2003 for not only the SDK, but also for working with the python and XML. I figured I would share my experience here (along with the solution files).

Unfortunately, as I am currently only working with the Warlords SDK, I've adapted the project files to that end.

Also, I'm not 100% sure where to put this as it is technically not a tool or utility, but rather a set of project files, so mods, feel free to relocate as desired.

Now, on to the actual solution. The solution requires a little bit of prep work:

Phase 1: Installation
In order for this solution to work the best, you'll need three pieces of software:

#1 Visual Studio 2003 - This is the only mandatory bit of software

#2 Python 2.4 - This is required for #3, though I needed to install ActivePython (ftp://ftp.activestate.com/ActivePython/windows/2.4/ActivePython-2.4.3.12-win32-x86.msi) before the third installer recognized my python install. This could be because I'm running Windows Vista which required me to work around the python installer.

#3 Visual Python - This enables syntax highlighting (among other things) of Python code files in Visual Studio 2003. ActiveState discontinued its work on Visual Python and thus made it "free" to the public (you will get an occasional pop-up complaining that it can't find the license file, but it will still open the file and work as normal. I'm still waiting to hear back from ActiveState on how to obtain an "unlimited license", so I will post that info once I receive it.

Now, with those three bits of software installed, it's time to set up the mod folder

Phase 2: Setting up the mod folder

This solution makes a couple assumptions about what your mod's Assets folder contains. It should contain, at bare minimum:

\XML
\Python
\CvGameCoreDLL

This last one is simply a copy of the CvGameCoreDLL folder from the main warlords folder. The solution's projects will go into each of these folders, and the way the builds are configured, the XML and Python projects will be skipped over while the CvGameCoreDLL project will place the resulting .dll file in your mod's assets folder, ready to be renamed.

That's all the prep-work that needs to be done... now on to the main event!

Phase 3: Extracting the solution

Fire up 7z, WinZip or even Windows Explorer and extract all the files into your mod's Assets folder.

Then, simply open CivIVMod.sln and away you go!

Appendix 1: Creating your own solution

Really, the only thing I've done is to create the projects, add all the relevant files, and tweeked a few settings to place the DLL in the proper place and to not build the other projects. However, here are a couple notes in case you desire to do this sort of thing yourself:

In the DLL project's properties page, simply change the Linker > General > Output File option to point to whatever folder you want it to dump the .dll file into

In the other two project's properties pages, switch to All Configurations in the dropdown at the top of the window and then

1. Change General > Configuration Type to Makefile and click Apply
2. Change NMake > Command Line to: echo "Skipping Python" or whatever you'd like to be spit out when it skips the compile.

Voila

I hope that at least one person out there finds this useful, and if you do, don't be afraid to let me know :)
 

Attachments

Good stuff. I recently discovered Eclipse with XML spy extension support and pyDev... Its yummy. I think I can compile c++ with it but i havent tried. An all in one IDE would be great.

One of us coder types needs to write a darn unit editor... :)
 
I just wanted to confirm that you can obtain a free license key for Visual Python (only works with VS2002 and VS2003, NOT VS2005) by emailing Sales@ActiveState.com and asking for one
 
Just a note to add. Do not try to use Python 2.5 with this component. The installer for Visual Python will fail saying that no version of python is detected.
 
Not sure what the deal is, but your solution does not show any of the python or xml files in any of the views. Something I missed?
 
Zlifia said:
Just a note to add. Do not try to use Python 2.5 with this component. The installer for Visual Python will fail saying that no version of python is detected.

I couldn't get Visual Python to work with anything other than Active Python
 
Zlifia said:
Not sure what the deal is, but your solution does not show any of the python or xml files in any of the views. Something I missed?

Hrm... do you have an XML sub-folder with all the XML files in the same folder as the solution?
 
Yeah, you are right, I wasn't looking at the correct python program.

My directories are set up just as you suggested. Specifically Warlords/Mods/MyMod/Assets/CivIVMod.sln
~/XML
~/Python
~/CvGameCoreDLL

Each of those containing their respective project files that you included in your zip file.
 
What I mean is, do you have your mod's XML and python files in those folders as well?
 
Hm... I just tried setting it up on my laptop and it works just fine... Try creating your own project files and customizing them as I mention in the appendix
 
Will do, I'm sure I'm probably just missing something stupid, but I can't seem to see what. :/ I'll let you know if I figure it out.
 
Back
Top Bottom