new to Defcon and modding--question on editing

Discuss your new mods and themes here

Moderator: Defcon moderators

canadave
level1
level1
Posts: 10
Joined: Thu Nov 27, 2008 12:56 am

new to Defcon and modding--question on editing

Postby canadave » Thu Nov 27, 2008 1:22 am

Hi all,

I'm a recent convert to DefCon, and as someone who watched WarGames wide-eyed as a kid, I can't believe it's taken me this long to find the game ;)

After playing it a while, I'd like to try my hand at a mod. Disclaimer: I get the concept, I've extracted main.dat and had a peek at its various components, I've read the various FAQ's on the subject, etc.

What I'd like to mod is two things:

1. I'd like to open up many of the sailable areas that are not currently sailable in the game. For instance, the Mediterranean Sea; the Suez Canal; the Panama Canal; etc.

2. I'd like to mod the game so that naval units can't be placed in the middle of the ocean, where they inevitably wind up running into enemy fleets within two seconds. I'd like to restrict naval unit placement to areas quite close in to a region's home shores.

For mod item #1, I see that sailable.bmp is the key, but I'm not sure how to edit it so that the areas mentioned are opened up. Do I just go in with a small eraser tool in my graphics editor and turn black areas (land) into white (sailable sea)? Surely it's not that simple :) And while on the subject, is GIMP really necessary to edit the bmp? I have Photoshop, but when I tried to open the bmp it wasn't able to open it.

For mod item #2, I see that each region's bmp has a blurred area that corresponds to the placement area in the game. So do I just erase the edges of those areas in each region's bmp until there's just a little sliver next to the country's coastlines? Again I suspect there's more to it than that, but I'm just unsure exactly how that's done.

And finally, disclaimer #2: I know many of you may think these are retarded ideas to do as mods, and for all I know you're probably right :) But please bear with me...even if no one here would be interested in using these mods, I have a buddy who I play against fairly often, and he and I at least would be happy with these two mods.

Oh, and apologies if this has been covered ad nauseam; Search didn't reveal the answer to me.

Thanks very much!
Dave
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Thu Nov 27, 2008 3:27 am

Think you guessed everything right.
for #1 if you have trouble sailing your ships in the new waters, you may have to edit travle_nodes aswell, but try without before.
for #2 if you want CPU players playing your mod, you have to make sure the green dots in ai_markers are inside the fleet deployment areas.

And dont forget to post screenshots and a download link here when you have finished it. ;)
canadave
level1
level1
Posts: 10
Joined: Thu Nov 27, 2008 12:56 am

Postby canadave » Thu Nov 27, 2008 3:52 am

No text editing required for any of this, eh? Wow...I am pleasantly surprised!

Thanks for the advice--especially about the CPU AI, which I totally forgot about. I'll give it a shot in GIMP (still not sure why Photoshop doesn't work).
canadave
level1
level1
Posts: 10
Joined: Thu Nov 27, 2008 12:56 am

Postby canadave » Thu Nov 27, 2008 4:50 am

Hmmmm....ok, I think I need a slight push in the right direction.

Here's what I've done (I'm on a Mac, BTW). I went to Finder, did "Show Package Contents" for Defcon.app, and got a new Finder window showing the package contents. I located the main.dat file, changed the file name to main.zip, and was able to unzip its contents (the infamous "data" folder).

In it, I found the northamerica.bmp file, opened it in Photoshop (I'm not sure why I got a Photoshop error the first time I tried this...now it seems to be working fine), and edited the grey areas where navies can be placed. All I did was erase a bunch of the area so that very little was left--I didn't add anything. I then saved the file in Photoshop.

Then I right-clicked on the "data" folder and chose "Compress Files..." A .zip file was created. I renamed it to main.dat, thus (as far as I can see) restoring everything to its initial state, except containing the edited northamerica.bmp.

But then when I tried to start DefCon.app to see if my edited file worked, I get once of those "Ignore/Relaunch/Close" crash errors, and the game doesn't start.

What am I doing wrong? I assume it's something in the way I'm unpacking and repacking the main.dat files...is there a trick to that?

Thanks,
Dave
canadave
level1
level1
Posts: 10
Joined: Thu Nov 27, 2008 12:56 am

Postby canadave » Thu Nov 27, 2008 4:54 am

Oh....wait. I think I get it now. There's no way to edit the actual package contents of the Defcon.app file, right? All I can do is copy the files from the package contents into a mods directory, edit them there, keep them there, and then enable that mod in-game. Right?
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Thu Nov 27, 2008 6:22 am

First off, the data archive is a .rar archive, not a .zip. If you zipped it up, then it wouldn't have worked, and is almost certainly the reason that Defcon crashed. Second, you are correct -- this mod of yours belongs in a mod directory. Specifically, you need to create a directory with your mod's name, then a sub-directory called "data/". Look at some of the other mods to see what it should look like.

So, my advice is this: copy main.dat from the app bundle, and keep the original right where it is. Don't touch it, don't edit it, don't do anything to it. Observe the directory structure of your unarchived copy, and move any file that you change to the appropriate place in your mod's folder. Activate the mod in Defon, and you should be good to go.

However, note that any changes to the map (i.e. the sailable regions, or the placement regions) will cause your mod to be a "critical mod". This means that any player you wish to play against will require a copy of the mod, as well.

xander
canadave
level1
level1
Posts: 10
Joined: Thu Nov 27, 2008 12:56 am

Postby canadave » Thu Nov 27, 2008 7:45 am

Right--thanks xander, that was helpful and answered many of my questions. I'll make sure to use a rar utility in future.

One quick question--what files does DefCon use to determine where naval fleets can be deployed? I thought it was just each region's BMP file (like northamerica.bmp for the North American deployer) plus sailable.bmp, and that's it. Are there other files involved? I've edited both of those files to allow fleets to be deployed much closer to shore, but for some reason when I try to do it in the game as the North American player, I can see that my edited northamerica.bmp is in the game, but I can't deploy my naval forces ANYWHERE. Not good! :)

Any ideas on what else I need to be looking at? Are one or more of the .DAT files involved somehow as well?

Thanks!
Dave
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Thu Nov 27, 2008 6:22 pm

The fleet deployment area is defined by the territory image only. You just have to use the right shade of grey, like in the original (from the middle of the area, not from the edges). In fact, you can even deploy the fleet on land, if you want to.
canadave
level1
level1
Posts: 10
Joined: Thu Nov 27, 2008 12:56 am

Postby canadave » Thu Nov 27, 2008 7:21 pm

trickser wrote:The fleet deployment area is defined by the territory image only. You just have to use the right shade of grey, like in the original (from the middle of the area, not from the edges). In fact, you can even deploy the fleet on land, if you want to.


Ah, okay, thanks--I guess I must not have had my grey shaded correctly. I'll fix that when I get a chance.

So if sailable.bmp has no effect on fleet placement, what would happen if you placed a fleet on land? Would you simply not be able to make it move anywhere in the game?
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Thu Nov 27, 2008 8:34 pm

yep
canadave
level1
level1
Posts: 10
Joined: Thu Nov 27, 2008 12:56 am

Postby canadave » Thu Nov 27, 2008 9:58 pm

Excellent--thanks for all your help! I think I've got the concepts down. Now I just need to go do some Photoshopping ;) Hopefully the mod will be ready for release within a week--I've got work stuff on the go, so I can't finish this quite as quickly as I'd like.

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 5 guests