FPK live (tm)

If this works then I'm all good with it btw, I only gave the other suggestion in case that wouldn't work.

Just remember that this (in \Assets\XML\Art\CIV4ArtDefines_Misc.xml):
<MiscArtInfo>
<Type>DEFAULT_THEME_NAME</Type>
<Path>Mods/Caveman2Cosmos/Resource/C2C.thm</Path>
<fScale>0</fScale>
<NIF/>
<KFM/>​
</MiscArtInfo>

needs to point to our /Resource folder, so we will have to add a "Mod" in its path, or move the "Resource" folder out to the same folder level as the "Source" folder.
I guess it belongs in the "Mod" folder so "Mods/Caveman2Cosmos/Mod/Resource/C2C.thm" is the method I prefer.
Interesting, it can't be <Path>Resource/C2C.thm</Path> like the BtS CIV4ArtDefines_Misc.xml uses
 
The theme files currently refer to icons in the vanilla Civ4 folder, so we have to either change the relative path or copy those resource files into our mod. (430 files, 1MB in total)

Resource\Theme\C2CTheme_Common.thm
Code:
        with .Icon
        {
            .File_Unknown_Small                    =    GBitmap("../../../../Resource/Icons/Civ4/file_16x16.tga");
 
Interesting, it can't be <Path>Resource/C2C.thm</Path> like the BtS CIV4ArtDefines_Misc.xml uses
No. That would be a vanilla folder
"\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Resource"​
-and mod files should really keep out of vanilla folders.

Mod install\uninstall would become difficult for players when not all files are contained with one folder that holds no vanilla files at all.
The theme files currently refer to icons in the vanilla Civ4 folder, so we have to either change the relative path or copy those resource files into our mod. (430 files, 1MB in total)

Resource\Theme\C2CTheme_Common.thml
Code:
        with .Icon
        {
            .File_Unknown_Small                    =    GBitmap("../../../../Resource/Icons/Civ4/file_16x16.tga");
Change the relative path is best. just add another ..\ to all of those that have it if we move our resource folder one folder deeper.
Or we could keep the Resource folder outside of the "Mod" folder where we plan to have our "Source" folder.
But it would be easier to keep the resource folder on the same folder depth as it currently is due to it using relative paths to a lot of vanilla resources.
 
Last edited:
I guess I need to investigate a few things, like what happens when people update after a move like this with local changes to files that moved. I hope SVN tracks moves like Perforce does and so can manage integrating local changes with them, but I'm not super confident.
 
So the Resource folder must stay at Mods\Caveman2Cosmos\Resource, and those theme files must not change, since we're eventually releasing the stable version that uses the default path.
It would become a problem then for TB to package for release...
 
So the Resource folder must stay at Mods\Caveman2Cosmos\Resource, and those theme files must not change, since we're eventually releasing the stable version that uses the default path.
It would become a problem then for TB to package for release...
Oh, can't official releases use this structure:
\Caveman2Cosmos\
--- \Mod\
--- --- \Assets
--- --- --- FPK's
--- --- \PrivateMaps
--- --- \ini file
--- --- \icon
--- \Resource

Where source folder is removed and the unpacked art is prepacked?
 
I think it's fine, it would still mean even official release requires mod to be specified as Mods\Caveman2Cosmos\Mod. I don't have a problem with that, however will the main menu "Load Mod" function work when the mod is in a subdirectory?

Alternatively I can write a script that builds the final mod with a better structure. This isn't complicated, references to directories in the files can be easily fixed up automatically in the script.
 
Edit: { Older post edited into this one
I don't have a problem with that, however will the main menu "Load Mod" function work when the mod is in a subdirectory?
We would have to try to find out I guess... I'm doubtful though.
}

What is the root problem that triggered this idea to restructure the mod folders?

Can't the packing script delete the loose art files after packing them, does the BtS exe index the loose files before the dll get's the opportunity to pack the FPK's and delete the loose files?

Edit right before posting:
Oh wait I think I get it, you guys want to play directly from the SVN folder.... So when committing you will have to make sure not to delete the missing loose art files and not to commit the added FPK's every time you commit something...
You will always get a long list of file changes that you never will commit every time you commit something.
 
I keep my SVN folder in a different place and export it to the Caveman2Cosmos folder inside .../Mods after updating.
 
I keep my SVN folder in a different place and export it to the Caveman2Cosmos folder inside .../Mods after updating.
As has always been the recommended method for setting up C2C with SVN.
Documentation for using SVN for C2C

A: Getting started:

1)Download and install Tortoise SVN if you don't already have it (http://tortoisesvn.net/downloads.html)

2) Prepare a folder to contain your copy of the project
  • Create an empty directory that will hold your working copy (i.e. - local directory on your machine which will be your 'image' of the central repository - this is where you will make your changes when you want to contribute them and where other people's changes will sync down to). I strongly recommend that this is NOT your 'live' copy in 'program files/firaxis/...'. Mine is in \development\C2C, but the location doesn't matter - just put it somewhere convenient where you have space.
3) Checkout from the repository to the folder you created in (2). This will get the current ....​
A post written at Jul 4, 2011, and never been edited since.
 
Can't the packing script delete the loose art files after packing them, does the BtS exe index the loose files before the dll get's the opportunity to pack the FPK's and delete the loose files?
Yeah BtS indexes before the dll gets loaded even sadly. Lucky it at least waits till after it is attached to actually load the files.

Oh wait I think I get it, you guys want to play directly from the SVN folder.... So when committing you will have to make sure not to delete the missing loose art files and not to commit the added FPK's every time you commit something...
Yeah I'm running from Mods dir myself at the moment, I swear someone said that everyone does that, but now looks like only some, or few, or only me? However if people don't run from mods folder and are happy to do the export thing I find it hard to comprehend them objecting to instead running a batch file that both exports AND builds the fpks, and the dll maybe as well if any of those things aren't built. Doesn't export require selecting target every time? I can make a script that asks once and then just does it from then on. INFACT I can write one that does it automatically when you update via tortoise svn update hook if people want to be reaaaally laid back.
 
Yeah BtS indexes before the dll gets loaded even sadly. Lucky it at least waits till after it is attached to actually load the files.
I see, the discussion above makes more sense now.
Yeah I'm running from Mods dir myself at the moment, I swear someone said that everyone does that, but now looks like only some, or few, or only me? However if people don't run from mods folder and are happy to do the export thing I find it hard to comprehend them objecting to instead running a batch file that both exports AND builds the fpks, and the dll maybe as well if any of those things aren't built. Doesn't export require selecting target every time? I can make a script that asks once and then just does it from then on. INFACT I can write one that does it automatically when you update via tortoise svn update hook if people want to be reaaaally laid back.
I know raxo plays directly from the SVN folder. I think Koshling once said that there was little reason not to do so, but I don't know what he did personally.

Our own export script would be nice, one that pretty much does it all to set up the mod. All it has to do is ask the user what directory to export to, and then work its magic. ^^
We could have this folder structure on the SVN with such an install script:
"Anywhere\SVN folder named whatever\"
--- "Caveman2Cosmos\"
--- --- All that we currently have.
--- "Install C2C.bat"
Really wish it explained WHY you are strongly recommended to do that!
I don't know, it is common SVN methodology I guess, hence the export functions existence.
I do find it makes things more organized on my end; having multiple SVN folders, and dealing with modmods and custom modifications that should not be on any repositories even though i commit changes to SVN regularly.
 
Last edited:
With really old versions of tortoisesvn the export method was necessary because the .svn Folder wasnt hidden from the bts.exe. Starting the game took really long if you checked out directly into the mods\. directory because of the file indexing. But that isn't needed anymore because newer tortoisesvn versions hide the .svn directory.
 
Last edited:
With really old versions of tortoisesvn the export method necessary because the .svn Folder wasnt hidden from the bts.exe. Starting the game took really long if you checked out directly into the mods\. directory because of the file indexing. But that isn't needed anymore because newer tortoisesvn versions hide the .svn directory.
Ah, that explains why it became tradition to set it up like that in the first place, though I think we may be making it a tradition again with us wanting to have the loose files on the SVN.
Though the potential new export tradition will not go through tortoise but through a billw (tm) export script.
Doesn't export require selecting target every time? I can make a script that asks once and then just does it from then on. INFACT I can write one that does it automatically when you update via tortoise svn update hook if people want to be reaaaally laid back.
Too much automation imo, I think it's better for the C2C install batch script to ask for the dir. every time, in case you have several CivIV installations or reinstall it somewhere else, or something like that.
However if people don't run from mods folder and are happy to do the export thing I find it hard to comprehend them objecting to instead running a batch file that both exports AND builds the fpks, and the dll maybe as well if any of those things aren't built.
I have no objections to that. ^^
Though the dll building does take some time, perhaps it's better to actually have the latest built dll in the repository? Edit: Oh you did specify "if those aren't already built". Ok then.
 
Last edited:
though I think we may be making it a tradition again with us wanting to have the loose files on the SVN.
Well whatever the solution is has to work for everyone, and anyone who does have SVN in Mods folder won't be helped by any scripts etc. designed for people who aren't, their entire SVN will get indexed. So we would have to say you CANNOT do that any more, which I don't like personally. I think just reorganizing the repository (to something that is more sensible anyway) is actually easiest. It only takes a minute for people to fixup their mod path, and they will certainly know they need to do something when the mod doesn't load at all. The people for whom it might be painful are those who need to merge changes. However I note that SVN *does* have a move function for tracking moved files, so it might actually be fairly painless even there. I am going to test it tonight on a large scale (int my branch) and see how it behaves.

Too much automation imo, I think it's better for it to ask every time, in case you have several CivIV installations or reinstall it somewhere else, or something like that.
Seems like a massive pain to me, 99 times out of 100 I didn't move my Civ install and just want it to go to the same place. That 1 time I don't I can just run other other script does the same thing, but asks every time.
 
I have no objections to that. ^^
I swear it was you who said you would never move to git if you also had to run a script after updating, but I must be thinking of someone else! Still if someone said it, it does indicate some people do object to any extra step between update and running the game (which I understand, it's why I moved my SVN to the mods folder!)
 
It only takes a minute for people to fixup their mod path
Changing the mod path makes it impossible to load saves which where saved with the mod in the old path. It would be necessary to hex edit the saves to make them load again.
 
I swear it was you who said you would never move to git if you also had to run a script after updating, but I must be thinking of someone else! Still if someone said it, it does indicate some people do object to any extra step between update and running the game (which I understand, it's why I moved my SVN to the mods folder!)
That may have been me, though I think the suggestion was a bit different at that time. It didn't involve export and FPK packing in one script, only FPK packing I think.
I'm used to do the export and start the game when it's done; I envisioned that I had to folder navigate to the working copy to run scripts after the export process.
I also envisioned exporting all those loose files only to pack them afterwards which would make it a waste of time to export all those loose files.
Seems like a massive pain to me, 99 times out of 100 I didn't move my Civ install and just want it to go to the same place. That 1 time I don't I can just run other other script does the same thing, but asks every time.
True, if there's a simple way to redefine the path again then I'm ok with it.
Changing the mod path makes it impossible to load saves which where saved with the mod in the old path. It would be necessary to hex edit the saves to make them load again.
That's another problem with nesting the mod like that (Caveman2Cosmos\Mod), though we are going to break all saves very soon with the building/unitclass removal.

The real question is wheter BtS vanilla menu will be able to see our mod when someone wants to switch between C2C and another mod through the "load mod" main menu option.
 
Last edited:
Changing the mod path makes it impossible to load saves which where saved with the mod in the old path. It would be necessary to hex edit the saves to make them load again.
\

Damn! Keep thwarting me firaxis!

That's another problem with nesting the mod like that (Caveman2Cosmos\Mod), though we are going to break all saves very soon with the building/unitclass removal.

Yeah so if we were going to do it that will be the time.

The real question is wheter BtS vanilla menu will be able to see our mod when someone wants to switch between C2C and another mod through the "load mod" main menu option.
This and more questions I hope to answer tonight
 
Back
Top Bottom