NOTE: Those are not the originals tools as made by Rick Gibbed. They have been
quite heavily modified. For further information about this, read the LICENSE.txt
and README.txt files in the archive.

NOTE: If your mod somehow doesn't work, even with those tools, please make sure
there's no file with the same name in the patch folder. If the file that make
the game crash is an ADF file, you're left with the "good ol´ way": your best
friend and worst beloved enemy: the "hex-editor-of-your-choice".

I've sent a patch with all those changes to Rick Gibbed.

--- --- ---

Rick Gibbed originally wrote a set of modding tools for JC3, but with some of
the recent updates the mods created with it were... broken. I don't know why
they've made that change, but it will most probably be to speed-up the loading
and fix some crashes. The Rick Gibbed tools produced files that would have an
incorrect format and somehow -- luck ? -- the old JC3 loader would load them.
(There's also some files in the new patch that replace old ones but that's
something else).

That's for the story.

--- --- ---

The Added Pack executable will create a .arc and a .tab files from any folder.
If you plan to mod for sky_fortress, and you've found a file that you don't know
its name, simply create a __UNKNOWN (notice the two underscores) folder in the
dropzone_sky_fortress folder. It will handle everything else just fine.

ConvertTexture as a tutorial in the forums.

ConvertProperty has been fixed, but there's maybe something I've missed, so if
your game crashes and you've read the second NOTE, please tell me which file was
problematic. ConvertProperty now have 16% of the names contained in properties
files.

ConvertProperty has been fixed, but there's maybe something I've missed, so if
your game crashes and you've read the second NOTE, please tell me which file was
problematic.

Changes include an ADF serializer. This format is a pain in the *ss when you
have to open you hex editor and change things. For most of the ADF files
(.*tunec, .onlinec, ...) the conversion to and from the xml file should work.
If there's a problem, read the second NOTE. If there's still a problem...
Please contact me with the path of the file that caused the problem.
I'll try to fix the problem if it's something that can be fixed.
(the adf format is mostly a memory dump and one missing byte could crash the
whole game, but that makes harder to recreate the correct file from a xml one).

In the XML file generated by ConvertAdf, you'll find a tag
-- that can be quite big -- that looks like this:

<type-definitions WARNING="DO NOT TOUCH THAT FUCKING THING">.

Please skip that part of the file until you see something like:

<instances NOTE="HERE YOU CAN TOUCH, BUT BE GENTLE">

I will not go in the abyssal depths of the ADF format, but touching
-- or even looking at -- the content of the type-definitions tag will most
likely break everything. Another important thing: do not touch attributes.


The attribute offset-in-file="..." is the hexadecimal offset of the value in the
file, in the case the serializer would give incorrect results.


For advanced modders (when you want to add contents to an ADF file, not simply
change some values) :

 - If you're modifying a string and that string tag's has a
   reference-string-from attribute, the value of that attribute is the id of the
   element that contains the actual string, so you'll have to change both.
 - First order <member> must have an ID. If you plan to add an array, you have
   to search for the greatest ID (they may not be in the correct order), add one
   and voilà, you've got you're new ID. Make sure that you've copied the array
   from an existing one, else you'll have to recreate all it attributes from
   what is contained in the <type-definitions> tags and you're more likely to
   break things.
 - Arrays are typed. Please use the correct one.
 - InlineArrays are evils. Please don't mess with them. Please.
 - You can add new elements / remove elements to/from any Array elements.
   (but NOT InlineArrays)
 - <member name="Ints" gbltype="Array" is-reference="yay" id="3" type-hash="..." 
type="A[VariableInt]" />
   is a reference the array with the id 3.
 - A ref tag with is-reference="yay" id="-1" is a tag with a null reference.

As a last note, some files with InlineArrays may ignore their values or give
incorrect result even if they appears to be correct in the XML file.
I'm not very sure of that, but this may appears and if it appears, I can't fix
the ADF serializer (but for the sake of curiosity, please tell me which file
caused that). If that's the case, the problem must also appear if you
immediately serialize/deserialize the file, without touching it. If not, you've
probably screwed something in your changes.



For everything else, TRY, FAIL, REPEAT.