| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Getting Started with Coding

This version was saved 10 years, 8 months ago View current version     Page history
Saved by James Koppel
on August 11, 2013 at 11:54:58 pm
 
This page has an associated video tutorial, Modding with an Iron Fist: Episode 4: Modding the Code ( http://www.youtube.com/watch?v=dFTT0id4Iz0 )
 
Getting a development environment set up is never a picnic, especially not for a project as advanced as Ironfist. This tutorial aims to remove as much of the pain as possible.
Our code interacts with the code of the original game at the binary level, and we're stuck using Microsoft tools as a result of some of the features we use to do this. 

What You'll Need

 

  • A checked-out repository (see Setting up the Repository)
  • Microsoft Visual Studio (free versions should do, but make sure they have C++)

 

Setup 

 

The first step is to create a new project in Visual Studio. In the "New Project" dialog, select Win32 Console Application under Visual C++.

 

 

Once you have created the new project, add everything in the ironfist/src/cpp directory and ironfist/src/asm. Additionally, add common/asm/heroes2.asm. Now we'll need to set some options. Open the Project->Properties menu, and set options as stated below:

 

Section  Field

Value

Configuration Properties: General Character Set Use Multi-Byte Character Set
Configuration Properties: C/C++: Precompiled Headers  Precompiled Header  Not using Precompiled Headers
Configuration Properties: Linker: General  Additional Library Directories  Add the common\lib directory
Configuration Properties: Linker: Input  Additional Dependencies  Append ;wing32.lib; smackw32.lib; mss32.lib

 

Additionally, if you are on 64-bit Windows, you will need to make sure the game is compiled for 32-bit.

 

And now, the hardest part. Most of the game still lives in assembly, so there's a bit more work to do. Add the common/asm/heroes2.asm file. We'll now configure it to be assembled whenever the project is built. Right click on heroes2.asm in the Solution Explorer, and open the Properties menu. Under "Item Type," select "Custom Build Tool."

 

 

 

Now, under the "Custom Build Tool:General" heading, set "Command Line" to

 

     "$(VCInstallDir)\bin\ml.exe" /c /Cx /coff /I "<path to ironfist/src/asm>" "%(FullPath)" 

 

Set "Outputs" to

 

     %(Filename).obj

 

 

 

Build the project from the "Build" menu. You should now see a shiny new executable file in the project's output folder. Congratulations! You are now ready to code on Project Ironfist.

 

 

Note

 

There are *a lot* of versions of Visual Studio. Don't hesitate to comment if you have any problems.

Comments (0)

You don't have permission to comment on this page.