A Comprehensive Guide to Modding Defcon (INCOMPLETE)

Discuss your new mods and themes here

Moderator: Defcon moderators

User avatar
Montyphy
level5
level5
Posts: 6745
Joined: Tue Apr 19, 2005 2:28 pm
Location: London, England

A Comprehensive Guide to Modding Defcon (INCOMPLETE)

Postby Montyphy » Sat Jan 27, 2007 3:51 pm

I've been meaning to come up with a comprehensive guide to modding Defcon for a long time now so where best to start then going to the community and asking for help. ;) I know zanzer7 has some points on his site but I can't seem to view it on my MacBook at the moment. Anyway, here's basically everything I've been able to recall from memory so far.

If you have anything to add please post your contributions and I'll add them to this post. I'm also not the best speller in the world so don't be afraid to get me to make corrections. :P


TOOLS:
  • Defcon v1.2 or later (demo) (patch) - Steam or nonSteam, doesn't matter
  • Rar unpacker i.e. WinRAR (trial) - Required for unpacking main.dat and sounds.dat. Also needed for packing your mod to make distribution easier.
  • Paint program i.e. GIMP (free) - Required if you want to make graphical changes such as different maps or units.
  • Text editor i.e. Notepad (free) - Required if you want to change city names, individual city placements, unit descriptions or translations.
  • Sound editor i.e. Audacity (free) - Required if you want to add or edit game sounds.
  • zanzer7's Defcon Modsuite (free) - Required if you want to easily create/place coastlines, borders, cities for a map you created.
  • Crook's Automatic City Placer (free) - Currently in development but when released it will make life easy for you if you don't exactly care where cities go.


MATERIALS:
  • main.dat from your Defcon installation - extract it as a rar file into your Defcon directory. (not required if all you want to do is edit current game sounds.)
  • sounds.dat from your Defcon installation - extract it as a rar file into your Defcon directory (only needed if you want to make sound changes.)


FIRST STEPS - Mod preparation:
Since Defcon v1.2, mods can be activated and deactivated via the Mods menu within the game. The following describes how to create a mod that will work through this mechanism.
  1. Create a folder called "mods" in your Defcon directory. If you've already installed a mod for Defcon then you will most likely not need to do this step.
  2. Within the mods folder create another folder, this time give it a name relating to your mod. The name doesn't need to match your mod's actual name but if it makes life easier for everyone if it is revelant and unique.
  3. The folder you just created will essentially contain your mod. Within it you should place the following three things: mod.txt, screenshot.bmp, and a folder called "data".
    • The data folder is where you should place all the files you changed in order to create your mod. They should be in the same hierarchical order as the files contained in data folder of your Defcon folder.
    • mod.txt should be a text file containing a desciption of your mod. Its format should be as such:

      Code: Select all

      Name        Sample Mod
      Version     v1.7
      Author     Chris Delay
      Website     www.introversion.co.uk
      Comment      A simple mod designed to show how to make mods properly.
    • screenshot.bmp should be a bitmap image of 210x118 pixels. If you've never used mods in Defcon before you may wonder how this is used along with the mod.txt so here is an example.


GETTING FILES YOU WANT TO CHANGE:
The first thing to realise when modding Defcon is that you can't add something, only replace i.e. you may change what a unit looks like but you can't add new units or add/change characteristics/behaviour (such as how fast something fires).

In order to replace something you need to decide what you want to "remove" from the game, locate its file in the data folder, copy it across to your mod's folder (while maintaning the same name and hierarchy i.e. copy "/Defcon/data/graphics/blip.bmp" to "/Defcon/mods/yourmod/data/graphics/blip.bmp"), then change the copied file.

Now on to listing things you may want to change and what you would need in order to do so.
  • To change a unit's description: Get "/Defcon/data/language/english.txt" and change revelant line of "Unit Info" section
  • To change the language (create a translation): Get "/Defcon/data/language/english.txt" and translate. (reframe from renaming the file)
  • To add/remove/change the text overlays that appear in the background at the main menu: Get "/Defcon/data/language/english.txt" and change the "Lobby Overlays" section
  • To add sounds: Get and change "/Defcon/data/sounds.txt" and add the new sounds to "/Defcon/mods/yourmod/data/sounds"
  • To remove a sound: Get and change "/Defcon/data/sounds.txt"
  • To change/replace existing sounds/music: Get revelant sound file(s) contained in "/Defcon/data/sounds"
  • To change the appearance of a unit: Get revelant image contained in "/Defcon/data/graphics"
  • To change map: Get
    • "/Defcon/data/earth/"
    • "Defcon/data/graphics/blur.bmp"
    • "Defcon/data/graphics/map.bmp"
    • "Defcon/data/graphics/territory.bmp"
    • "Defcon/data/graphics/water.bmp"
    • "Defcon/data/graphics/water_shaded"
  • To change the user interface (GUI): Possible files you may want to change may be
    • "/Defcon/data/gui/"
    • "/Defcon/data/graphics/fleet.bmp"
    • "/Defcon/data/graphics/popbutton.bmp"
    • "/Defcon/data/graphics/radarbutton.bmp"
    • "/Defcon/data/graphics/units.bmp"
  • To change the theme/style: First create a theme/style in-game, save it, then get what you saved from "/Defcon/data/styles"
  • To change the font used: A lot of the font stuff can be changed through the style editor in-game, however, somethings like text used for writing cities names in-game can only be changed by getting and changing the revelant file from "/Defcon/data/fonts"


What do these files do? What can I do with them?:
  • "/Defcon/data/critical_files.txt"
  • "/Defcon/data/effects.txt"
  • "/Defcon/data/gameoptions.txt"
  • "/Defcon/data/prefs_default.txt"
  • "/Defcon/data/prefs_testbed.txt"
  • "/Defcon/data/sounds_minimal.txt"
  • "/Defcon/data/sounds_nosound.txt"
  • "/Defcon/data/sounds.txt"
  • "/Defcon/data/tutorial.txt"
  • "/Defcon/data/world.dat" - Easter Egg
  • "/Defcon/data/earth/"
    • "africa.bmp", "europe.bmp", "northamerica.bmp", "russia.bmp", "southamerica.bmp", "southasia.bmp" - Territory files, one per player. Anything nonblack denotes where a player may place units (including fleets).
    • "ai_markers.bmp" - Used by the CPU players. Green dots tell the AI where to place fleets and red dots tell it where to launch nukes from subs. You must make sure that each territory has enough green dots.
    • "cities.dat"
    • "coastlines.bmp"
    • "coastlines.dat"
    • "coastlines-low.dat"
    • "international.dat"
    • "sailable.bmp" - The white region defines where ships can sail, (can be just a copy of water.bmp, but can be edited so that ship can not get to close to the coastlines)
    • "travel_nodes.bmp" - Used by fleets for pathfinding. Each node needs to be in connected by a straight line (not blocked by land) to at least one other node and all nodes have to be in the water area defined by sailable.bmp. The original defcon map uses 22 nodes, and although it can work with less, it may crash the game so it's recommended to stick with 22 nodes.
  • "/Defcon/data/fonts/"
    • "bitlow.bmp"
    • "kremlin.bmp"
    • "lucon.bmp"
    • "zerothre.bmp"
  • "/Defcon/data/graphics/"
    • "airbase.bmp", "battleship.bmp", "bomber.bmp", "carrier.bmp", "fighter.bmp", "nuke.bmp", "radarstation.bmp" - Used for the named in-game units.
    • "sam.bmp" - Used to represent a silo in Air Defense Mode
    • "silo.bmp" - Used to represent a silo in Launch Mode
    • "sub.bmp" - Used to represent a sub
    • "sub_surfaced.bmp" - Used to represent a sub firing a nuke
    • "airbase_blur.bmp", "battleship_blur.bmp", "bomber_blur.bmp", "carrier_blur.bmp", "fighter_blur.bmp", "nuke_blur.bmp", "radarstation_blur.bmp", "sam_blur.bmp", "silo_blur.bmp", "sub_blur.bmp", "sub_surfaced_blur.bmp" - Used to create the ghost effect of a unit no longer within radar range.
    • "actionline.bmp" - Used to create the trails for moving nukes and fleets.
    • "arrow.bmp" -
    • "blip.bmp" -
    • "city.bmp" - Used to represent cities
    • "cursor_selection.bmp" - Used for creating a ring when a unit is selected.
    • "cursor_target.bmp" - Used for creating a ring around a possible target.
    • "depthcharge.bmp" - Used by carriers against subs when in Anti Sub mode
    • "error.bmp" - Used when there is a problem loading/using an image. It's adviced not to change this.
    • "explosion.bmp" - Used to represent a nuke exploding.
    • "fleet.bmp" - Used to represent the GUI button that brings up the fleet placement menu. If you change battleship.bmp, carrier.bmp or sub.bmp you may want to change this.
    • "laser.bmp" - Used to represent shots fired from fighters, bombers, battleships, subs, and silos in AA mode.
    • "map.bmp" - The image that is displayed in the territory selection screen at the start of the game
    • "nukesymbol.bmp" - Used to represent a point which has been targetted by a nuke.
    • "popbutton.bmp"
    • "population.bmp" - Used to represent population when Population view is on.
    • "radar.bmp" - Used to represent the radar coverage of a unit.
    • "radarbutton.bmp"
    • "smallbomber.bmp" - Used to represent the number of bombers left in a carrier or airbase.
    • "smallfighter.bmp" - Used to represent the number of fighters left in a carrier or airbase.
    • "smallnuke.bmp" - Used to represent the number of nukes left in a sub, carrier or airbase.
    • "targetcursor.bmp" -
    • "territory.bmp" -
    • "units.bmp" - Used to represent the GUI button that brings up the unit placement menu. If you change radarstation.bmp, silo.bmp or airbase.bmp you may want to change this.
    • "water.bmp" -
    • "water_shaded.bmp" - Used to create the shaded effect of the water in-game.
    • "tornado.bmp" - Easter Egg
    • "saucer.bmp" - Easter Egg
  • "/Defcon/data/gui/"
    • "arrow.bmp" -
    • "demo.bmp" - Image displayed to non-Steam demo users on closing Defcon. Highly recommended you don't change this.
    • "demo_steam.bmp" - Image displayed to Steam demo users on closing Defcon. Highly recommended you don't change this.
    • "lmb.bmp" - Icon used during the Tutorial to emphasis when the left mouse button must be used. Not much point changing this.
    • "locked.bmp" - Used in the Server Listing window to show when a server is password protected.
    • "mouse.bmp", "move.bmp", "resize_h.bmp", "resize_hv.bmp", "resize_v.bmp" - Cursors
    • "pen.bmp" - Cursor used for drawing on the Whiteboard.
    • "rmb.bmp" - Icon used during the Tutorial to emphasis when the right mouse button must be used. Not much point changing this.
    • "tb_alliances.bmp" - Used to represent the GUI button that brings up the Alliances window.
    • "tb_board.bmp" - Used to represent the GUI button that toggles Whiteboard mode.
    • "tb_comms.bmp" - Used to represent the GUI button that toggles the Chat window on and off.
    • "tb_eraseall.bmp" - Used to represent the GUI button in Whiteboard mode that clears the screen.
    • "tb_info.bmp" - Used to represent the GUI button that toggles Info mode
    • "tb_nukes.bmp" - Used to represent the GUI button that toggles Show Nukes mode.
    • "tb_orders.bmp" - Used to represent the GUI button that toggles Show Orders mode.
    • "tb_planning.bmp" - Used to represent the GUI button that enables drawing in Whiteboard mode.
    • "tb_population.bmp" - Used to represent the GUI button that toggles Population view on and off.
    • "tb_radar.bmp" - Used to represent the GUI button that toggles radar coverage on and off. If you change radarstation.bmp you may want to change this.
    • "tb_scores.bmp" - Used to represent the GUI button that shows the Scores window.
    • "tb_showall.bmp" -
    • "tb_territory.bmp" - Used to represent the GUI button that toggles Show Territory mode.
    • "tb_units.bmp" - Used to represent the GUI button that brings up the Unit Placement menu.
    • "tick.bmp" -
  • "/Defcon/data/language/"
    • "english.txt"
      • "Interfaces and dialogs"
      • "Tooltips"
      • "Unit names"
      • "Unit States"
      • "Game messages"
      • "Combat Attack Odds"
      • "Misc"
      • "Tutorial"
      • "Unit Info"
      • "Lobby Overlays"
  • "/Defcon/data/sounds/"
    • ""
  • "/Defcon/data/styles/"
    • ""


COMMON PROBLEMS:
  • Node Mismatch - You need to check your travel_nodes file. Chances are you accidently placed a node in an area defined as land in sailable.bmp.


FINAL STAGES - Preparing the mod for distribution:
If you followed the mod preparation stages then this should be fairly easy. Assuming the only thing in your "Defcon/mods" folder is your mod then all you need to do is use your rar archiver (i.e. WinRAR) to rar "Defcon/mods" (you may want to rename the archive to match your mods name). The reason for rar'ing the mods folder is that it will make installation easier for other users as all they would need to do is extract it into their Defcon folder without first having to create a mods folder.

That's all well and nice if you didn't already have mods installed. Well, for those of you who have more than just your mod in your mods folder you will need to create another folder somewhere, call it "mods", copy your mod's folder into that folder, then rar that newly created mods folder.

Now to those of you silly people who didn't follow the preparation stages. You will need to now follow those stages, copy across all the files you changed and follow the above rar instructions.

FINAL STAGES - Distribution:
You may be wondering what to now do with your mod. If you're egar to get others playing it you may be wondering how to get it out into the public domain. Well, the first thing you should probably do is make a thread about your mod on the Introversion forum, namely in the Mod Projects section.

The next step is getting the file on the internet. There are a number of options you could persue in this area. You could upload the file to a fileshare server (i.e. rapidshare.com) although they tend to only keep the file for a limited time. Alternatively, you could host the file on your own website. Finally you could make a request the thread you created about your mod.

When you do manage to upload your mod somewhere, don't forget to include the link in your thread. ;)

Finally, don't forget to post a link to your thread in the Defcon Modlist thread. This will hopefully grab zanzer7's attention so he can put it on his Defcon fansite.


USEFUL POINTS:
  • When I refer to "your Defcon directory" I mean the location of where you installed Defcon.
  • Defcon's default installation location for Steam users is "C:\Program Files\Steam\steamapps\common\defcon".
  • Defcon's default installation location for non-Steam users is "C:\Program Files\Defcon".


(To be continued...)
Last edited by Montyphy on Wed Jan 31, 2007 2:23 am, edited 12 times in total.
Uplink help: Check out the Guide or FAQ.
Latest Uplink patch is v1.55.
User avatar
KingAl
level5
level5
Posts: 4138
Joined: Sun Sep 10, 2006 7:42 am

Re: A Comprehensive Guide to Modding Defcon (INCOMPLETE)

Postby KingAl » Sat Jan 27, 2007 5:08 pm

Montyphy wrote:
  • Text editor (i.e. Notepad) - required if you want to change city names, city placements, unit descriptions or most other strings of text that appear in-game


Not a rext editor, then? We've definitely needed something like this for a while. Presumably you'll add this to your FAQ as well?
With regards to 'materials', it might be worth linking to WinRAR for those who don't encounter .rar files often.
User avatar
Montyphy
level5
level5
Posts: 6745
Joined: Tue Apr 19, 2005 2:28 pm
Location: London, England

Re: A Comprehensive Guide to Modding Defcon (INCOMPLETE)

Postby Montyphy » Sat Jan 27, 2007 5:55 pm

KingAl wrote:
Montyphy wrote:
  • Text editor (i.e. Notepad) - required if you want to change city names, city placements, unit descriptions or most other strings of text that appear in-game


Not a rext editor, then?


Oh martin, you muse. :)

KingAl wrote:We've definitely needed something like this for a while. Presumably you'll add this to your FAQ as well?


Yep, when it gets a bit more content I'll be making a version for my site.

KingAl wrote:With regards to 'materials', it might be worth linking to WinRAR for those who don't encounter .rar files often.


Done
Uplink help: Check out the Guide or FAQ.

Latest Uplink patch is v1.55.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Re: A Comprehensive Guide to Modding Defcon (INCOMPLETE)

Postby xander » Sat Jan 27, 2007 6:00 pm

STICKY, PLEASE!

KingAl wrote:
Montyphy wrote:
  • Text editor (i.e. Notepad) - required if you want to change city names, city placements, unit descriptions or most other strings of text that appear in-game


Not a rext editor, then? We've definitely needed something like this for a while. Presumably you'll add this to your FAQ as well?
With regards to 'materials', it might be worth linking to WinRAR for those who don't encounter .rar files often.

Ah, memories. That made me ROFL!

xander
User avatar
Montyphy
level5
level5
Posts: 6745
Joined: Tue Apr 19, 2005 2:28 pm
Location: London, England

Postby Montyphy » Wed Jan 31, 2007 1:19 am

Bump - Added more stuff, but it still needs a lot more work to be done. Hopefully, I'll be able to make it easier on the eyes when I migrate it to my site.
Uplink help: Check out the Guide or FAQ.

Latest Uplink patch is v1.55.

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 1 guest