jdturner1987
Civilian
Posts: 2
Joined: Fri Jul 25, 2014 2:25 am

Add leader mod/mod existing leader

Sat Aug 09, 2014 4:47 pm

I don't know if this has been asked, and I haven't seen anything about it in the AACW Wiki, so I wanted to ask if there was a process or mod where one could create a leader or add one? Any help on the matter is most appreciated.

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Tue Aug 12, 2014 9:50 pm

The big thing is to find and follow patterns in the game files. Right now the game isn't meant for modding to be super-simple. Modders are expected to explore the game files and familiarize themselves with things a bit. That said, here is a brief summary to get you started, hopefully it helps.

For modding like this myself, I first went through the scenario creation example from the general modding forum (http://www.ageod-forum.com/showthread.php?9756-Scenario-creation-(example-from-AACW)). That will familiarize you with the DB (in this forum) and using the csv splitter. To mod leaders, you'll make changes to the unit and model db. Once you've made changes, save as semi-colon delimited and create game files using the splitter. The splitter will make model, unit, and alias files. Find those files in the game folder, back up the originals, and move over the new ones. Delete models.cached and units.cached in those folders, they'll be recreated next time you start the game. If you created a new leader, you'll need to familiarize yourself with the events DBs. Particularly USA Leader Events and CSA Leader Events. Follow that pattern to add your leader. Also, if you create a new leader, you'll need to add a new portrait (in graphics folder there are subfolders for units, armies, and portraits; again follow the pattern).

If you have questions, feel free to ask. I'll do my best to help, as will others.

User avatar
OneArmedMexican
General
Posts: 582
Joined: Wed Sep 29, 2010 4:14 pm

Sat Sep 20, 2014 2:08 pm

Apparently a few things have changed since I last modded an AGE game. I tried to add a unit the way it used to work:

  1. created the unit and the mdl files (I used notepad/text editor)
  2. amended the alias files for both
  3. deleted the unit/mdl caches (by the way why has the GameData subfolder two versions of both models and units subfolders ("_models" and "models") which one is the one that gets loaded by the game?)
  4. wrote an event to get the unit into the game


This doesn't work any longer and leads to the game crashing on loading (it could be that I screwed up one of the cross-references but I don't believe so). What do I need to do differently?

User avatar
tripax
AGEod Veteran
Posts: 777
Joined: Thu Aug 29, 2013 9:58 pm

Sat Sep 20, 2014 9:05 pm

Crashing on startup means it is probably crashing while writing the models.cached/units.cached files (actually, probably while reading your model and unit files). Otherwise, what you wrote should work - or at least it should have worked before the patch. The patch added the "_models" and "_units" folders, I'm assuming that those can be ignored. Make sure that the text editor saves the files in the same text format as the other text files. This isn't something I understand, but it could be the cause of the problem. Looking in notepad++, it looks like the text is in ANSI format, if you use notepad it might save it in another format. Again, this isn't something I understand, but it has been a problem for me before in other programs (in real life, that is).

User avatar
OneArmedMexican
General
Posts: 582
Joined: Wed Sep 29, 2010 4:14 pm

Sun Sep 21, 2014 1:12 pm

Thanks Tripax, it's nice to know that the method is still viable in theory. After running the log, I am pretty sure that the issue lies with AGEODs files not my own: I enabled error logging and to my surprise a dozen error message popped up all related to pre-existing files (mostly sea units having land movement enabled). Then I removed all the files that I had modded and restored the game to its original version. Based upon that I tried to have the game create new caches files. The same error reports once again.

It kind of seems that AGEOD supplied a flawed Database and the model files for this games are so screwed up that the game can't create new caches upon loading. :bonk:

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Sat Oct 04, 2014 4:00 am

I'm having the same problem that OneArmedMexican is. I've made a very small change to a model file (basically where it points to a training upgrade) and now I'm trying to get the game to recreate models.cached. I've renamed the original models.cached file but the game crashes every time on startup, usually right at the end of the loading process (step 3/3). Restoring the original file enables the game to load correctly.

Even with no changes to the model files if I try to get it to recreate the models.cached or units.cached, either/or/both, the game craps. I also tried renaming the respective files in the _models and _units directories. That didn't crash, but it didn't recreate those files.

All I'm trying to do is correct an issue with models for some foreign units, starting with Mexican rural cavalry. Their upgrades point to CMN models and when they upgrade, the units don't display correctly. Without the game generating the new cache files, it's ignoring my change :(

I have tried reinstalling from scratch and getting it to recreate the files, which does work. I think it becomes a problem in 1.04. I was using 1.04 most recently, but since I've rolled back to 1.03, I can delete the cached files and the game recreates them with no problems.

User avatar
Eugene Carr
Colonel
Posts: 387
Joined: Wed Jun 20, 2007 6:58 pm
Location: Dundee, Scotland

Sat Oct 04, 2014 9:44 am

Are you generating 'new' files using the DB xls files or making the changes to the existing model files?
I've been adding portraits to the existing files and deleting the cache files which then regenerate ok on 1.04.
I do get error messages regarding fleets but they don't crash the game.

Could there be a fault in the newest xls files?

S!
[SIGPIC][/SIGPIC]

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Sat Oct 04, 2014 5:59 pm

I do not use the .xls files. I back up all my original folders and edit the models or other files directly. This is working on 1.03. I should probably try 1.04 again since I hate the force power total representations on 1.03.

... and no, it doesn't work. As soon as I upgrade to 1.04 and try this, it crashes when it doesn't have cached models and units files. However, I don't think it's checking the content of the file on startup, just the existence of the file. I created an empty text document called models.cached and put that in the models directory. The game will start, but if you try to launch any of the scenarios with the empty file, the game will crash (I'm sure for different, better reasons).

So it seems to be something like:

- does models.cached exist yes/no
- if yes, continue, else it should create it, but something is screwed up

I was wrong about the units.cached file. If I have a models.cached file, it is still generating a new units.cached file if one doesn't exist.

With error logging on, I get the messages about the ships, but mine still crashes after that. I have a screenshot of the error message but the website won't let me attach it this minute. It's in French, which I do not speak, but it's mentioning an exception error.

I've half a mind to do a fresh install and patch to 1.04 from that, rather than what I have right now which is fresh install, patch to 1.03 and then patch to 1.04. Main install takes so *long*, though :(

These are the last three lines from my error log.

12:49:26 PM (Reporting) TListModels.Create 861 models loaded, out of 861 models files in 9995 ms
12:49:26 PM (Reporting) TListModels.Create No models have an AIRole Raider or Skirmisher, this sounds suspicious! (used to check if a leader allows structure burning & Help the AI for some missions)
12:49:26 PM [Critical ] TListModels.Get Data container for models definitions has some discrepancies, for UID 53

I checked the models directory for the model tagged with UID 53. Surprise, it's not there. Also missing are several other model files, in the UID 50-70 range, and 125. Lucky for me I backed up my models directory from 1.03. Restoring those model files from my 1.03 directory corrects the error. So it's TListModels.create (some kind of method or function) that has a problem because an argument that's passed to it is missing or something like that. It needs one and one to make two, but it only has one.

Possibilities (devs would know right away):

1.04 removes specific model files, and this case without replacing a few or removing their associated unit files. I think this is unlikely.
1.04 is overwriting model files with updates, and something mysterious happens for a few of them. Weird, and even less likely.
1.04 removes the entire models directory or its contents, and the process that recreates the model directory or its contents is missing some files. More likely than the first.

*I* certainly didn't remove those files.

User avatar
Eugene Carr
Colonel
Posts: 387
Joined: Wed Jun 20, 2007 6:58 pm
Location: Dundee, Scotland

Sat Oct 04, 2014 7:17 pm

My install isn't pristine either, it says 1.04 but I'm playing Tripax's Aintod mod and I had to do some double overwriting to get it to work so its entirely possible that I have a hybrid version which still allows regeneration of the cache files .
Certainly appears to be an issue arising from 1.04
S!
[SIGPIC][/SIGPIC]

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Sat Oct 04, 2014 7:39 pm

Eugene, tripax's mod might contain the missing model files, which would explain why you have them and I didn't. I was using his brigade name mod for awhile but I removed it and installed 1.04 again about a week ago.

This also begs the question of when the models.cached file is created, after the game is installed or is it included with the install. I had a working game after I installed 1.00, 1.03 AND 1.04. It wasn't until I deleted models.cached after the 1.04 patch that I started getting the error. Seems to me that models.cached is included with the patch, otherwise it couldn't generate it with missing files or my game would have crashed right after the patch.

User avatar
Eugene Carr
Colonel
Posts: 387
Joined: Wed Jun 20, 2007 6:58 pm
Location: Dundee, Scotland

Sat Oct 04, 2014 8:31 pm

I've added in a dozen or so Generals portraits and deleted the models and units cache every time I've done so including after 1.04 (assuming I have 1.04 proper) without issue, I do get error messages regarding some CSA fleets as mentioned above but otherwise it works.
I'll try my vanilla install to check it works then make some change and delete the caches and see what happens.

S!
[SIGPIC][/SIGPIC]

User avatar
Captain_Orso
Posts: 5766
Joined: Tue Sep 01, 2009 5:02 pm
Location: Stuttgart, Germany

Sun Oct 05, 2014 6:29 am

There are some issues with the v1.04 patch Models and Units folders. I would suggest 2 things.

1. Wait for the upcoming 1.05 patch and its database files, which are generally published right after the patch has been released.

2. Use the database files for modding, insuring that the UID sequence is correct when editing it.

If you maintain the UID sequences and don't fudge anything when editing the the models and units database files--you will at least have lots of examples right in front of your nose with which to compare--you will generate ALL the many, many units and models which you haven't changed, but you should have a set of Units and Models which fit together.
Image

Return to “CW2 Mods”

Who is online

Users browsing this forum: No registered users and 12 guests