• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

knightofni

First Lieutenant
55 Badges
Feb 14, 2009
232
0
  • Crusader Kings II: Legacy of Rome
  • Pillars of Eternity
  • Sword of the Stars
  • Europa Universalis: Rome
  • Europa Universalis IV: Res Publica
  • Majesty 2
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis III Complete
  • Darkest Hour
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Deus Vult
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings III
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Prison Architect
  • Stellaris: Ancient Relics
  • Age of Wonders III
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: Way of Life
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • 500k Club
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris Sign-up
Modding Tool - Division / Brigade editor - v0.65

This is an Excel based tool, intended primarily for modders, that allows you to read and write unit data (divisions & brigade).

You can use to quickly check the unit stats of a mod without tearing through txt files, perform calculations.
Alternatively, you can use to mod units & brigades in a easier fashion.
With v0.62, there's now enough features to mod anything without issues.

NOTE : If reading takes too long (say more than 30 secs on a decent computer), Excel is having some trouble dealing with the code. Press "ESC", then on the message box click "End", then try to read again.

Version 0.67 uploaded
- Fixed a bug when trying to load files from FODD mod
- Fixed a bug that could lead to write divisions / brigades files with uncorrect filenames.
- Updated instructions for clarity

Version 0.65 uploaded
- Fixed bug in the upgrade paths [was not read properly]
- More feedback when reading the files.

Version 0.64 uploaded
- Should be fully compatible with 1.03 RC2

Version 0.62 uploaded
- detachable brigades now supported

Version 0.61 uploaded
- Better mod support (ie : now loads everything except Haegemonia)
- Automatic columns sizing

Current Features
- Read / Write the unit data from any mod folder. Reading should take 10-20 seconds (shitty code, sorry), writing is fast.
- Handles comments (model & characteristics) seamlessly through excel comments system
- Add / remove models within a unit / brigade type (just insert or delete lines)
- Check / Modify allowable brigades & max allowable brigades
- Check / Modify upgrade path (land & air only)
- Extract the year if present in the model comments.
- v1.03 note : you will have to edit division_types.txt yourself

Mods Tested / Compatibility
- Working : DHFull, Homeland, Bonaparte legacy, Kaisereich, WiF2, FODD, Epsilon, HIP, CORE, 1914 mod, Floggis MP Mod
- Not Working : Hegemonia.
- Created with Excel 2007. Unknown compatibility.

Quick Instructions
1) In the green cell (C3 in Menu worksheet), type your complete DH mod directory, until .... Mods\
2) In the blue drop down list, select the mod you wish to check
3) If the mod is not present, add the directory name at the bottom of column O
4) Click the 'Read' Button, wait about 20 seconds, then check the other spreadsheets for your data
5) Modify whatever you want to modify, then click 'Write'

This excel spreadsheet relies heavily on VBA, so you might have a warning on startup. Enable, or it wont work.

===> Screenshots and Detailed instructions <===


Warning
1) Please work from backup copies of your files / mods
2) There's no error checking. If you write something stupid, it shall do so.
3) For this reason, by default the spreadsheet writes the output files with the '_test' suffix at the end. [ex : infantry_test.txt]
4) If you want to override this behavior type 'Barbapapa' (without quotes) in cell B1, sheet Menu. [ex : infantry.txt]


Known issues
- 'Header' comments are not read (ie : comments before the first 'model')
- Multi-line comments are not read

Please report
- Bugs / Issues
- Compatibility reports
- Mods that aren't loading properly
- Features ideas [though the current feature list is sufficient for my needs, so no guarantee]

Future Versions
- Better comment handling (ie : header comments and multi-line comments)
- Loading confirmation
- Easy way to open the txt files
- Loading confirmation message
- Add the 'Abb' as a comment of brigades, in Allowed Brigades
- [Maybe] Mod templates


Downloads
 

Attachments

  • UnitEditTool_0.6.rar
    167,1 KB · Views: 184
  • UnitEditTool_0.62.rar
    173 KB · Views: 137
  • UnitEditTool_0.65r.rar
    162 KB · Views: 357
  • UnitEditTool_0.67.zip
    165,5 KB · Views: 437
Last edited:
GOOD WORK!

Cheers! :)

EDIT MUCH LATER: I used to do a bit of VBA myself... but after looking at your code .. I was just pissin in the wind...

A Hell of a Lot of Work, WELL DONE!
 
Last edited:
@novapaddy & Epaminondas : Thank you very much for the comments :) and happy modding !

@razorbird789 : Yes, you can create entirely new unit types, the UnitTool will generate the txt files for you.
However :
1) You need to feed the tool with the proper filename (ie : d_01, d_02, etc. for the new unit types). Have a look at the comments in the Menu sheet to understand how to do this.
2) It will handle properly the new 'equipment field'. You just need to create it and fill it properly
3) It will NOT generate 'division_types.txt' for you, you'll need to update this yourself. At the moment i don't plan to add this feature, as this would mean hours of work for very little time saved for the user.
==> Download and have a look at the WIF2 files to see how this is working


Just posted a minor update, that handle better a host of older mods.
I will post some more detailed instructions... soon (tm).
 
Detailed instructions & Screenshots

Detailed instructions

If you want to understand precisely how to edit / create new units, or simply want to see how it looks, have a look below.

Menu




This is the menu worksheet, where you control how the tool works. Please read this carefully so that you understand how the tool processes your files.

1] Here you control your installation directory in the green cell, and the mod that you wish to use (select from the dropdown in the blue cell)
Important : go to column Q and type your install directory/ies there

2] In column O are the directories of the mods that should appear in the dropdown. If you want to add a mod, just type the directory name at the bottom of the list

3] This is the heart of the tool.
Under Land units are the filenames that should be read and written by the tool. It will process all those filenames until the first space. So if you want to create a new unit type, just type the necessary filename at the bottom (ie : d_01), and it shall be processed.

The column 'Abb' (for abbreviation) is user-defined, and has not impact on the files themselves - it's only cosmetics- . It helps you to remember that 'naval_torpedoes_l' is actually floatplanes. I upload the unit tool with DH Full conventions, which may work or not with other mods.

Other columns (Land brigades, and their sea & air equivalents) work the same way.

4] Control buttons : Click 'read' to read the selected mod, 'write' to write back the files.
Next to the 'write' button, you are informed whether you are in test or 'real' mode

Allowed brigade screen



In the purple box are the filenames of the relevant brigades. If you want to add a brigade, type the filename yourself at the bottom of the column by inserting a new line (ie there must be 2 spaces after the last brigade)
Type a X if you wish the brigade to be allowed, delete otherwise.

Upgrade paths screen.



1] Is the target upgrade unit filename
2] Is the source unit Abb

Unit data



Here's a screenshot of land division, the formats are the same for brigades / sea & air.

1] Abb, Model#, and year are for your reference, but are not used when writing files.
The year is extracted from the comment field.
The comment will be written on the 'model' line.

How to edit :
a- If you just want edit an existing model : edit the values, click write, done.

b- If you want to create a new model in an existing unit type : Insert a line at the position needed, then fill in the data.
ex1 : In the screenshot, say you want to add a model #8 for ARM. Insert a line after ARM model 7, and before the MTN model0.
ex2 : If you want to add a new model #3 in the ARM unit type : Insert a line between model 3 and 4. Ex model 3 will become model 4, etc.

c- If you want to create a new model in a new unit type :
First make sure that you typed the appropriate filename and Abb in the menu (as explained in the menu section)
Then, at the end of the file, type the unit data, starting by the corresponding Abb.

2] Data fields. If one is missing, just add it on the first row, at the end. They are not written when there is no data (...doh)

3] Example of a comment. You do NOT need to type a # if you want to write your own comment from excel.
 
Last edited:
@novapaddy & Epaminondas : Thank you very much for the comments :) and happy modding !

@razorbird789 : Yes, you can create entirely new unit types, the UnitTool will generate the txt files for you.
However :
1) You need to feed the tool with the proper filename (ie : d_01, d_02, etc. for the new unit types). Have a look at the comments in the Menu sheet to understand how to do this.
2) It will handle properly the new 'equipment field'. You just need to create it and fill it properly
3) It will NOT generate 'division_types.txt' for you, you'll need to update this yourself. At the moment i don't plan to add this feature, as this would mean hours of work for very little time saved for the user.
==> Download and have a look at the WIF2 files to see how this is working


Just posted a minor update, that handle better a host of older mods.
I will post some more detailed instructions... soon (tm).

Cool, so this can't be used until 1.03 is released?
I'm no big modder so i won't be able to take advantage of your hard work but i can't wait to see the results of it!
 
At last! I can reduce the amount of time editing units! Thank you very much!
 
Cool, so this can't be used until 1.03 is released?
I'm no big modder so i won't be able to take advantage of your hard work but i can't wait to see the results of it!

No, it already works fine, the difference between 1.02 & 1.03 file structure is actually pretty small

At last! I can reduce the amount of time editing units! Thank you very much!

Thanks & good luck !
 
Do I have to use Excel in order to work or can I just use OpenOffice.org Calc with this?
 
Do I have to use Excel in order to work or can I just use OpenOffice.org Calc with this?

I haven't tried, but as i use extensively VBA, i guess it won't work, unless openoffice is compatible with VBA.
Would be nice if you could try and report.
 
I had tried to use this in Office Calc and it doesn't work. The Read and Write buttons does not appear. I needed to upgrade to 2010 excel anyway.
 
There's a bug in v0.64. Please download v0.65.

v0.64 was not reading upgrade paths properly (ex : militia to cavalry, militia to infantry, etc..), so it saved files without upgrade information.
 
V 0.67 out. Fixed a couple of bugs :
- Fixed a bug when trying to load files from FODD mod
- Fixed a bug that could lead to write divisions / brigades files with uncorrect filenames.
- Updated instructions for clarity