Jump to content

WARNING: NEW GUY


Dr. Wonderful

Recommended Posts

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Welp. I already pointed you to the general modding guide in the other topic you posted.

 

Be warned though... any modding beyond just sounds and graphics requires hex editing the actual C&C95.exe file. C&C1 does not have any nice and clean text files to mod stuff in, like RA1 does.

 

As for what you'll need... XCC isn't just the map editor. There's some more tools int hat pack. The ones you'll need are "XCC Mixer" (to browse through mix files and view their contents, and to convert files from SHP to PNG and back) and "XCC Mix Editor", which you'll need to make C&C1-type mix files to store your modded files in.

 

I also advise you to check out the readme of the C&C95 v1.06 patch, which has info on the current mod-addon system.

http://nyerguds.arsaneus-design.com/cnc95upd/cc95p106/patch106c_r3_en.html#toc_7.3

Link to comment
Share on other sites

Files are bytes. A hex editor, or hexadecimal editor, is an editor that allows you to open any file at all, and see/edit those bytes. They're values of 0 to 255, but represented in hexadecimal format, meaning, the single digits go up to 15 instead of 9, with those above 9 represented as A, B, C, D, E and F, so hexadecimal "10" is actually 16, and 255, the maximum value that can be stored in a byte, becomes "FF" (15*16 + 15).

 

Here you see the text "Hello, world!" as shown as its bare bytes in a hex-capable editor:

 

jK9CX0Ti.png

 

Though it seems to make a simple example, saving text as bytes itself is actually already a very complex matter, especially if you go into special characters like accented ones or the Russian Cyrillic ones. This here is just ASCII, the most basic of text-as-bytes, but if you dig deeper... it's a very deep rabbit hole. But, nevermind that for now; it's not really related to the topic :P

 

 

As for editing exe files... well, all exe files are simply scripts written in a byte-based language, that tell the computer (or, specifically, the CPU chip) what to do. Since the CPU knows what to do with these bytes, it stands to reason that this means the byte language can be translated into readable language, and thus it can be figured out what the program does. And, of course, this means it can be changed. Welcome to the wonderful world of exe file hacking! :P

 

All the unit stats and such in C&C are simply scripts that create the blueprints for the units, including all their basic stats (an example of the translated script for the rocket launcher stats can be found here). So to modify these stats, you need to modify these bytes in the exe file. Since practically all that stuff has been identified long ago, this isn't quite as hard as it seems. You just need to know where in the exe it's located.

Link to comment
Share on other sites

Ahh, sorry. I didn't think you were actually interested in modding units; you said you were only planning to do graphics modding, before.

 

Uhh... unless you want to go into full-blown hacking, I wouldn't bother with that, lol. It's the result of a disassembler. Normal hex editors just allow you to change the bytes; a disassembler translates the bytes back to x86 ASM language, but unless you know anything about programming, that's also not too useful, really.

 

Though, for a test, if you open C&C95.exe in your hex editor and go to offset A6D8F, that's the start of the flame tank's data. The "push" commands shown in the screenshot are byte 6A (you'll see it's letter 'j' in the text-part of your hex editor) for pushing one-byte values, and byte 68 (letter 'h') for 4-byte values.

 

Now, as you can see on the screenshot, the weapon of the unit is the eighth value being pushed ("push", in this case, is a way of giving it as data to the function called later to create the full unit blueprint object), so if you check all the 6A's with one byte behind it, and 68's with 4 bytes behind it, and pass 7 of them, then you should find yourself at address A6D9D, at which spot you'll find the data "6A 06". That "06" is the weapon ID. The full list of these IDs can be found in my ini dump of all internal stats, in weapons.ini. Change it to "07" (always overwrite bytes, never add any! If you change the file size the program will crash and burn), save the file, and your flame tank will have chem spray instead of a flamethrower.

 

I have an editor for this stuff, but unfortunately it's a DOS program, so it kinda needs DOSBox or something to run it on modern PCs. Also, I changed a few things with my patch so I'm not sure it's still fully compatible.

http://nyerguds.arsaneus-design.com/tools/cnc95uge_beta2.zip

The music settings, for one thing, are useless in there, since they're now fully ini based.

Link to comment
Share on other sites

Well, I'm starting with graphics and icons, but I want to eventually work up to the wonderful world of hacking.

 

Edit: Alright, yet again you have amazed me, and have earned a place in the credits. But anyway, as I was testing my chemical tank, I moved my cursor over it and fond it was still called Flame Tank. Do you need the hex editor to do that too?

 

Edit two: And I do have DOSBox but very little experience of how to use it.

Link to comment
Share on other sites

No, strings are an external file; makes it easier to support multiple languages, y'know. It's a file called "conquer.eng" (well, it's conquer.fre for French and conquer.ger for German ;)); should be somewhere in the original files. cclocal.mix / transit.mix I think, but it's possible I moved it to updatec.mix since that's where all other language stuff is now. You can edit C&C strings files using the Ingame Strings Editor.

 

And, if you didn't know yet, this is the simplest way to extract files using XCC Mixer.

 

If you want to quickly find out what to edit in the strings file (it has about seven hundred fifty entries), you can check out the ini data dumps I linked to before; if you open "units.ini" (or, any of the others really. Structures, infantry, aircraft, terrain, themes... all have names), you'll see that under each unit header, there's a property called "NameID", usually somewhere at the bottom of the properties list. The value there is the index for that name in the strings file ;)

 

I actually have working code to make the game read these strings from a .ini file instead, but I never actually released a version of the 1.06 patch that implemented it -_-

Link to comment
Share on other sites

I actually have working code to make the game read these strings from a .ini file instead, but I never actually released a version of the 1.06 patch that implemented it -_-

 

Would making the game read from an .ini instead allow us to make custom missions like the ones in Red Alert where units have special weapons and so on, unique to that particular mission? That would be amazing. :O

 

Like how you made it so we can add custom lines like:

 

[EYE]

Capturable=True

 

except instead to change the Mammoth Tank guns into Artillery guns, for example, just for that mission. I remember the Aftermath Red Alert mission where you have to extract a scientist from a Soviet base which is being attacked by malfunctioning automated mammoth tanks which have cruiser cannons and explode with a M.A.D. tank detonation. Was chaos. :P

Link to comment
Share on other sites

Nah. Problem with that is, I could do it, but I'd have to do some really serious work to make it work in savegames as well.

 

See, savegames in C&C games work 100% independently from the original mission files. They don't load stuff from the .ini or .bin when loading. So anything I would support in missions also has to be saved in / loaded from the savegames, or it'll simply be gone when loading the mission. The only reason the capturability works is because WW reserved a hilariously far too large amount of space in there for some really short text (the video names if I remember correctly) so I just creatively used up the available space wasted there. But to actually do stuff like that for custom strings would be a whole lot more work. The buildings are a fixed set, so I simply knew I had enough space for that in there, but for strings, the savegames would need to be dynamically enlarged to ensure there's enough space for them. Not to mention thinking up a simple binary format to store which thing they belong to.

 

The ini file format you see there was actually developed for the mod / language-addon system, hence the setting at the top telling it how many entries to read; the system has to stop reading entries at some point, and the most common way to do things like this is to abort when a next entry is missing. However, using that "Last=" setting, the read function didn't need to stop after the first missing entry, meaning you could do partial overrides, allowing mods to replace exactly and only the entries they needed to replace. But, as I said, it's not in v1.06c rev4 yet.

 

The only thing that supports custom strings like that right now is the ini-based music list; the only part of my ini stats that actually already works. The entries in there support a "Name=" tag to override the "NameID=" one. These custom music names don't override original name IDs, but actually get stored in a special list together with the ID of the music track. Which means the system, as it is now, isn't actually expandable to other types, since they all have IDs starting from 0 :P. Could be copied, using separate lists for each type, but I just summed up an incomplete list of everything in the game that supports name IDs, so... that'd be a really large amount of copies. Seems better to make one more general system. Not that I'm actually working on the patch, these days...

 

Link to comment
Share on other sites

Disassembler? The thing I linked to is a savegame editor customized to edit C&C95.exe :P

 

Do note dosbox doesn't tab-complete paths on the real file tree, and paths containing spaces need to be surrounded by quotes.

 

And if you got problems with the path... just make a single simple short-named folder in your c: root and put the stuff in there? :roll:

Link to comment
Share on other sites

Well, duh; "bob" is a folder name, not a path. Where is "bob" located? Which drive? Which directory? If it is "c:\bob", you should say that. If you type "bob" in the address bar of your Windows file explorer window, it won't find it either, y'know.

 

lol, any .mix file starting with "sc" works. My favourite example is usually "scorpion.mix" :D

As far as I know, "sc" stands for "scenario", since its original purpose (in the Covert Operations) is as container for new scenarios (missions) to add to the game (in sc-000.mix and sc-001.mix).

 

I think conquer.eng works from the game folder anyway; no need to put it in a mix file if you're just at testing/development stage. Sounds (.aud files) generally work from the game folder too. Graphics in .shp format don't, though; they need to be in a .mix file.

Link to comment
Share on other sites

Bob lives in my only drive, c:.  Soooo, then shouldn't it be in Computer c: bob?

Because that's not how paths work. If you click in the address bar of your Windows file explorer window when you got the folder open, you should see its real path. Anything in there that doesn't start with a drive letter (or \\ for network paths) is just Windows trickery, and either not really a folder (like "My Computer" or "Control Panel"), or some kind of internal shortcut to a real folder somewhere on your disk.

 

And I have your Cnc meets starwars mod. Which made me ask, how did you change the title screen?!

That's just a file. title.pcx. The patch adds a few more for different screen sizes, so check the contents of updatec.mix to see all variants.

 

Edit: Also, I tried editing the temperat.mix to try to make a new theater. It ain't working.

Well what did you try? Do note the terrain files are not SHP format. The extension of files is no indication of what type they are for theater files, since they all just refer to the theater. You'll see the type in XCC Mixer's "type" column.

 

There is currently no Windows editor/converter for the terrain tiles format (though tomsons26 has been nagging me to make one, based on my font editor, since the formats are similar), but you can still convert them using the DOS toolsets of Mix Manager and RAMIX.

 

Link to comment
Share on other sites

You don't "open" files with it. You use the conversion tools in the pack to convert it to PCX format and back. Check all exe files in there; there's tmp2pcx, shp2pcx, pcx2shp, etc.

 

As for the "custom theater", still not sure what you mean. What are you trying to do? Actually adding theaters is a serious amount of work, and then there's the choice whether that new theater has a modified colour palette or not, which adds a whole bunch more work to it. I think you're diving into all of this slightly too fast, tbh O_o

Link to comment
Share on other sites

A stealthy mountain? :P

 

Title screen isn't hard. It's just a pcx. The only thing you need to keep in mind is the colour palette; certain colours on it are reserved for the user interface of the main menu, so whatever new image you use needs to have those specific colours kept on their original values.

 

....okay, actually, that is kinda hard, now I think about it :P

Link to comment
Share on other sites

I've been seeing previews of TD mods which have more sides than GDI and NOD. How did everyone do that?

You referring to me here?

 

It is fairly straight forward to have 3 factions. If you set ownership of the various buildings carefully, you can make a faction using the Special house. Neutral also works fine, although you can only use that faction if you use engineers as playing as Neutral hardcodes you away from being able to build anything. I got up to 7 factions by being very very careful with prerequisites and tech levels.

 

Note that units work differently. They are tied to the production structures, not who builds them. Weapons Factories always make GDI units, regardless of who builds the Weapons Factory.

Link to comment
Share on other sites

For single play,  you can freely (ab)use Special and the Multi1-Multi6 Houses, yea. But nowadays, with my patch, a lot of it is simply colour trickery, since you can override the colour of all Houses in the mission file. A lot of the stuff Kilkakon did is also completely impossible in multiplayer; he has at least one side that literally depends on mission scripting as only type of income.

 

The problem with using nonstandard Houses as playable side is that you have to disable the score screen on the mission, though, otherwise the game will crash when you complete it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...