It is currently Tue Jun 18, 2013 11:02 pm



Reply to topic  [ 9 posts ] 
 CoD2 - Mod Tutorial 
Author Message
Chief Warrant Officer
Chief Warrant Officer
User avatar

Joined: Tue Feb 19, 2008 9:34 pm
Posts: 272
Location: Hampton, Virginia
Post CoD2 - Mod Tutorial
Call of Duty 2 Modding Tutorial : by Twofingers

Section 1 : Getting Yourself Prepared


To start things off, I want to remind the readers that the methods used throughout this tutorial are based from what I used to learn how to mod. You will find several different options for software to use and I hope to see feedback from other modders with extra tips and any shortcuts they might have. I learned how to do basic mods through trial and error. At the time, I always found plenty of topics on mapping but not much on modding. I ended up downloading a very small sound mod from codfiles and just tried to duplicate what the author had done. It took me about a week to realize the small mistake I kept making which I will cover before this beast of a tutorial is complete. I will try to be very thorough and don't hate me if I start explaining things from click to click. I will view this as a tutorial for those who have never modded so for all the modding elite out there, please bare with me.
So let's start things off by covering some of the basic tools that a modder might use.

First, you'll need some sort of file archive software. I have always been a big fan of WinZip and will be using it for the tutorial. You can grab a trial version here: http://www.winzip.com/
Jock Yitch uses 7Zip which is free and can be found here: http://www.7-zip.org/ .
There's also WinRar: http://www.rarsoft.com/ which is also a trial release.
I'm sure there are others but any of them will do as long as you understand how to preserve the directory structure of your files. I will cover this later. With winzip, its a matter of clicking a checkbox.

Second, you need a text editor. Any text editor will work including plain old Notepad. I prefer something with a few more options like EditPlus: http://www.editplus.com/
There are a ton of editors out there so just stick with whatever you prefer to use.

Those two things are all it takes for simple modding. If you get into doing skins or any type of graphic modding, then you need a decent image editor like photoshop, the dds plugin for it and the image conversion tools. modifying or adding graphics is a whole different tutorial altogether and isn't the focus of this one.

Alright, so now you have the required tools, let's get you a resource folder going so you can get started on your modding mayhem.

I'm using Windows XP so hope you are too.
First, open up your file manager "my computer" and create yourself a new directory in your C: drive or any storage device you prefer to use. This is where we will be extracting all of the games internal files to. I called mine: CoD2 Extracted
Image

Second, you need to browse to your CoD2 "main" folder. The default path is:
C:\Program Files\Activision\Call of Duty 2\main
Inside, you will see many files with the extension "iwd". These are nothing more than a basic zip file and can be opened with your archive software. If you still play the game, you may have a bunch of mods in there that have been downloaded off other servers. I strongly suggest deleting all mods so they don't conflict with anything you create and are trying to test. If you have all of the patches installed, here is what you should have in your "main" folder:
Image

Now here comes a sensitive part of the process. Each one of the "iwd" files in your "main" folder is full of other files. You need to open each one with your archiving software and extract the contents to the new folder you just made while preserving the directory structure. When you extract all of the files from each "iwd", you should see directories that were created during the extraction process like: ui_mp, images, sounds, weapons, maps, localizedstrings and so on. If you don't see these folders, then you have not preserved the structure and need to start over. As you read this paragraph, please look over the image below so you can get a visual of what things should look like.

Here's what the inside of iw_00.iwd looks like when using winzip:
Image

Here's the checkbox in winzip for preserving file structure:
Image

After you extract all the files from the stock iwd's, this is what you should be looking at:
Image

By this time, you should have all the game files lined up and waiting for your modifications and should be comfortable with extracting files while preserving their internal structure. You are now setup to start making simple mods like weapons mods and custom menus. In the next section, I will begin the process of walking you through some very basic mods and later help you get everything packaged up and ready for testing. Just to help put your mind at ease with what I typed above, it will take longer to read it than it will to actually do it.

_________________
Image


Sat Apr 11, 2009 10:08 pm
Profile WWW
Chief Warrant Officer
Chief Warrant Officer
User avatar

Joined: Tue Feb 19, 2008 9:34 pm
Posts: 272
Location: Hampton, Virginia
Post Re: CoD2 - Mod Tutorial
Section 2 : Modifying Stock Gameplay

I was going to do something that required a few more steps but the whole idea of this tutorial is just to take you through the process in the easiest way I know how.
So I'm going to help walk you through a basic weapons mod. Modifying the reaction and other attributes of weapons is probably the easiest mod to do simply because it usually requires the least amount of editing/effort.

We've decided that we are going to mod the default values of a few stock weapons. Once you get used to browsing all the files you extracted in the first section, you should get a feel for where things are located. Same thing goes for the scripting structure you will see as you open many of the files. Its just a matter of constantly looking at everything. Eventually it will make more and more sense. It took me a while to not see things as a big jumbled file of letters and numbers. Now I look at this stuff and I can easily navigate most of it.

So first, lets find out where the weapon settings are stored. When you open your "CoD2 Extracted" folder, you should notice a folder called "weapons". That is a pretty good clue that we should look in that folder. However, as you gain experience, you will find that not everything will be as easy or you may forget to include files that might also need editing to achieve your desired effect.
Inside the weapons folder, you should see two other folders, "mp" and "sp". This is easy enough as one stands for multiplayer and the other stands for singleplayer. If you open up the "mp" folder, you will see a file for each of the multiplayer weapons.
Image

Of course, I already knew were the weapon settings were stored so the above section was pretty simple. When you start building your own mods, you will have to use your text editor to open some of these files and browse them to see if there are references to other files. You will be able to figure out many things if you use common sense aswell. For instance, if you wanted to introduce your own custom weapon, you would have to think about what the other weapons require. Assume you will need to have a skin in the image folder, a sound in the sound folder, your custom weapon setting file in the weapons/mp folder, modify the weapon selection menu to display your new weapon and a few other things depending on what you are making.
A very good thing to use as a tutorial is to go download a mod, use the extraction procedure in section 1 and see what folders and files were used. Never steal anyone's work and if you need to use a bunch of it, try contacting the author if possible or at least give them credit.

We now know where the files are that we need to edit so we can put our mod template together. This next step was one that messed me up and is important for preserving the directory structure.
when the game looks for a file, it uses it's built in path. So if your playing multiplayer and pick the thompson for your weapon, the game will look for the settings of that weapon in the default location: /weapons/mp/thompson_mp
If you just made your edits to those files, used your archive software to pack them up while preserving the structure, it will save as something like this: /CoD2 Extracted/weapons/mp/thompson_mp
The game won't detect that and your mod will go unnoticed by the game. The way I got around this was to put all the folders and files I needed, directly on my C: drive. I suggest making the folders your mod requires and then copy the files you need to edit over to those folders.
So make a folder called "weapons". Inside that folder, make one called "mp". Open up the "mp" folder and copy the thompson_mp file there.
Image
Image

Now we have a template on our C: drive with the files required for editing. In this mod, were just going to modify the thompson so we only have to edit one file. Open up the thompson_mp file in your mod template folder with your text editor and take a look at the chaos.
Image

I know it looks like a big mess, but just slow down and browse through some of it. You will notice things in there that you will recognize. Every aspect of how the thompson looks and performs is controlled through this file. If you wanted to get crazy, you could open up a different weapon and copy/paste different settings from other weapons and have the thompson firing like a bolt or shotgun. You could have the shotgun firing like the thompson. For this mod, I'm just going to browse through and change a few things at random like the clip size, max ammo, and reload times. There are a ton of options and I suggest to slowly make changes and see what the effect is instead of just wildly changing things that you don't know about. Changing clip size and max ammo is just a small change that can easily be tested by yourself in game. Some of your creations will require a buddy to help test things.

Alright, after browsing, I found the entry for clipsize, maxammo and reload. I just changed the default values and I am ready to see if it works as intended.
Since I only had to create one folder on our C: Drive, I can right click on that folder and choose "add to zip" from my context menu.
Image

In winzip, I am then presented with a new window for naming the file and set any attributes. I suggest starting the name of your mod with a "Z" as the game tends to recognize and load files that start with a "Z" better for some reason. You want to type the extension for it aswell which is ".iwd" . You also want to make sure that you preserve the file structure. I can't stress preserving the structure enough as it seems to be the number one problem as to why people can't get their mods to work. In winzip, there is a checkbox for it. Refer to the image below for an example:
Image
Once you save it, you should be left with a single file like this:
Image


Now your mod is ready for testing. You can make yourself a "My Mods" folder some where on your hardrive for storing your mod templates. I'd leave your current template on your C: Drive until you are done testing incase you need to go back and change something. Once you have your mod complete, delete the folder from your C: Drive so you don't forget about it and it ends up blending in the next time you make a mod. I have done this several times myself.

To test your mod, simply copy the "iwd" you just made to your "main" folder. Fire up your game and run a server. For this mod, you need to select a map which allows the selection of the thompson. If all went well, you should see whats in the image below:
Image

I could have modified another file and made the border around the ammo count fit better but you get the idea.

Remember that this is a very simple mod. As I stated earlier in this section, go download a mod or two and see how they did things and what files they used. I find that the best way to learn is by example. Hopefully some of what I have written has helped you understand how to extract files, edit them and pack them back up.

_________________
Image


Sat Apr 11, 2009 10:09 pm
Profile WWW
Chief Warrant Officer
Chief Warrant Officer
User avatar

Joined: Tue Feb 19, 2008 9:34 pm
Posts: 272
Location: Hampton, Virginia
Post Re: CoD2 - Mod Tutorial
If anyone has any tips or shortcuts, I'd love to read them and modify what I have to make it a better tutorial.

_________________
Image


Sat Apr 11, 2009 10:38 pm
Profile WWW
Major
Major

Joined: Thu Feb 14, 2008 8:00 am
Posts: 664
Post Re: CoD2 - Mod Tutorial
So this way you could also increase the recoil of a weapon?
Do you need a modded server or does a stock server work too?

_________________
______________________________________
Image


Mon Apr 13, 2009 6:47 am
Profile
Chief Warrant Officer
Chief Warrant Officer
User avatar

Joined: Tue Feb 19, 2008 9:34 pm
Posts: 272
Location: Hampton, Virginia
Post Re: CoD2 - Mod Tutorial
Yes, you could adjust the recoil to make it very difficult to shoot, to no recoil at all.

As for your modded/stock question, I may not be clear on what you're asking so I'll explain it like this and hope I get it right.

Let's say you go in and change a default value of 2.5, to 5.0. You're not adding any extra digits so you can make it a server side mod (viewtopic.php?f=5&t=1152) and the client won't have to download anything which will make the server appear to be stock upon connection until they notice the change while playing. If you add an extra number like going from 2.5, to 5.55, this may make your mod a mandatory download and no one will be able to use the new features unless they download it. Either way, your server will be listed as modded.

_________________
Image


Mon Apr 13, 2009 5:21 pm
Profile WWW
Post Re: CoD2 - Mod Tutorial
Unless you play on a non pure server, I'm not sure about weapon ammo, but I did make a weapon that shot exploding cows, and that played in a non pure server.


Mon Apr 13, 2009 11:22 pm
Major
Major

Joined: Thu Feb 14, 2008 8:00 am
Posts: 664
Post Re: CoD2 - Mod Tutorial
Twofingers wrote:
Let's say you go in and change a default value of 2.5, to 5.0. You're not adding any extra digits so you can make it a server side mod (viewtopic.php?f=5&t=1152) and the client won't have to download anything which will make the server appear to be stock upon connection until they notice the change while playing.

Thats what im interested in.
I thought you are talking about server side changes in the first place.
Whats the use of having a 1000 shot mp when you can use it on non pure only?

But if I change the recoil and the people would not have to download anything they still have their files with the original recoil.
So do their weapons really behave like I set them on the server files oder do they behave like in their original files on their own hd?

_________________
______________________________________
Image


Tue Apr 14, 2009 3:18 am
Profile
Post Re: CoD2 - Mod Tutorial
puller wrote:
Twofingers wrote:
Let's say you go in and change a default value of 2.5, to 5.0. You're not adding any extra digits so you can make it a server side mod (viewtopic.php?f=5&t=1152) and the client won't have to download anything which will make the server appear to be stock upon connection until they notice the change while playing.

Thats what im interested in.
I thought you are talking about server side changes in the first place.
Whats the use of having a 1000 shot mp when you can use it on non pure only?

But if I change the recoil and the people would not have to download anything they still have their files with the original recoil.
So do their weapons really behave like I set them on the server files oder do they behave like in their original files on their own hd?

It appears normal for the player without the mod on their HD, but if you have the mod and go on the server, you will have 1000 bullets.


Tue Apr 14, 2009 4:12 am
Chief Warrant Officer
Chief Warrant Officer
User avatar

Joined: Tue Feb 19, 2008 9:34 pm
Posts: 272
Location: Hampton, Virginia
Post Re: CoD2 - Mod Tutorial
let me try it like this. If you made the mod I did in the tut and only changed the clip size to 99, you will have 2 options for adding that to your server. Any mod must be installed on your server for it to work. I didn't mention anything about non pure in the tutorial. If you keep the clip size within the 2 digit default, you can add _svr_ to the name and not make your users download it or you can leave the _svr_ out of the name and every user who connects will have to download it before they can play.
If you set the clip as 999, you are then changing the defaut size of the thompson_mp default file and it will be a mandatory download on your server.

Also, you could have say a members only 999 clip by adding the _svr_ to it. you still have to add it to your server but only the people you give a download link to will be able to use it. If it's not installed on the server, no one can use it regardless if they have it or not. Server side or non server side, you treat anything you create as any other mod out there.

Of course, this tutorial isnt just for weapons or serverside stuff. You can use the process I posted to help make any type of mod you wish.

Go download the 30 round thompson mod in the serverside thread and test that out if you have any other questions. add it as is and then remove the _svr_ from the file name and try it. Server side mods are not something I remember seeing much throughout communities so it is not well known.

_________________
Image


Tue Apr 14, 2009 8:25 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.