• 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.

jdrou

Field Marshal
74 Badges
Jun 10, 2002
24.161
461
  • Stellaris: Federations
  • Europa Universalis IV
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Paradox Order
  • Stellaris: Digital Anniversary Edition
  • Humble Paradox Bundle
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: El Dorado
  • Europa Universalis III: Collection
  • Europa Universalis III: Chronicles
  • 500k Club
  • 200k Club
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Stellaris: Megacorp
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Deus Vult
  • Darkest Hour
  • Crusader Kings II
  • Hearts of Iron II: Armageddon
  • Arsenal of Democracy
  • Hearts of Iron Anthology
  • Victoria 2
  • Rome Gold
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III
  • For The Glory
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Stellaris: Galaxy Edition
MostlyHarmless said:
I didn't run it in Linux. I don't think I have Linux installed anymore.
Anyway, I am rusty with these things...
I actually don't run it under Linux either (although I do have a couple of machines that dual-boot Red Hat Linux); I have all the DJGPP-compiled Linux/Unix tools on my Windows machines. Very handy for playing with EU2/HoI files; I use grep constantly.
 
Dec 7, 2003
584
0
Visit site
Kanitatlan said:
Try the program in the link from my signature. It does lots of things but if you go to the leaders tab (after loading the hoi files) it gives you the opportunity to update all the names for a country and save the result. I use it all the time to update leader names in all the Mods I play.

To use the program you need to set up all the relevant directories and click the load button. Then you can go to the leader tab, select a country in the combobox and it will show the leaders for that country. Click the "trait names" button and all the names will update. Then use the save button and you can save back the modified file. The works for all Mods. The trait names processing will remove any previous trait name prefixes and substitute based on leaders actual current traits.

This is just about the only part of the program that currently permits you to change things but do have a look at the rest of it as it provides lots of interesting information.
Very interesting, but, whats the history on this? I haven't seen much information about it at that site. I guess Mithel vouch for you and your exe-file, but could you provide just a bit more information please? Does it add any configuration file, does it access the registry? Any known bug/limitations?
Would be good to know in advance. Thx.
Sure I dowload exe-files, but never wrong checking history a bit first.
 
Dec 7, 2003
584
0
Visit site
jdrou said:
I actually don't run it under Linux either (although I do have a couple of machines that dual-boot Red Hat Linux); I have all the DJGPP-compiled Linux/Unix tools on my Windows machines. Very handy for playing with EU2/HoI files; I use grep constantly.
Okay, I did some more tried with my vb-exe and for some very strange reason (meaning I haven't spotted the reason) I don't get db missmatch. It is probably my lack of experience with editing HOI files... I did have asorted files in the leader directory and a few files open... Maybe HOI didn't like that?

Strange... but for now I just admire the result within the game. Maybe some other character than N could be better for sort order reasons? Like Z? I know it will look strange, but you would probably list the leaders without traits last in the list...

The exe runs on the command line with the the input file som command argument. While doing an old fashioned standard-exe in VB 6 one will probably need VB runtime files... Will look into that. In the early days of VB, it was perhaps more common of people to allready have these files, but I guess it may not be so today.

I am still a bit clumsy with vbscript, but the great advantage of vbscript is that you don't need runtime files in Windows and you can run the script from many places in the system. Drawback is that is seems very clumsy to do something more than very batch oriented operations and you don't have, AFAIK, all those clever readymade utilities/commands for things most people need to do anyway. It is very powerfull when you need easy access very Windows oriented objcects, but that is most usefull for sysops I guess.
 
Dec 7, 2003
584
0
Visit site
Here are the essentials... A preview. I may remove the content if needed/asked to.
The piece of code "add_traitcodes_to_name" mainly represents your code. I did a main for convenience.

Code:
Sub Main()
    ' Translation from jdrou bash scrip into basic code.
    ' I have chosen to try a 'direct translation', using as much as possible from jdrou's original code.
    '
    ' Using idea from Warlimont where he manually put trait tags in names. Nice idea!
    
    CmdLine = Command()
    CmdLnLen = Len(CmdLine)
    If CmdLnLen > 0 Then
        leaderfiles_path = ""
        leader_file = CmdLine
        input_file = leaderfiles_path + leader_file
        add_traitcodes_to_name (input_file)
    Else
        'no arugments found
    End If
End Sub


Sub add_traitcodes_to_name(ByVal input_file As String)
        
    trait(0) = "LW"
    trait(1) = "DD"
    trait(2) = "OD"
    trait(3) = "WS"
    trait(4) = "TR"
    trait(5) = "EN"
    trait(6) = "FB"
    trait(7) = "PL"
    trait(8) = "CO"
    trait(9) = "OG"
    trait(10) = "SW"
    trait(11) = "BR"
    trait(12) = "ST"
    trait(13) = "SP"
    trait(14) = "TB"
    trait(15) = "CB"
    trait(16) = "NF"
    trait(17) = "FD"

    tmp_file = input_file + ".tmp"
    input_file = input_file + ".csv"
    
    fopen = FreeFile()
    Open input_file For Input As #fopen
    fwrite = FreeFile()
    Open tmp_file For Output As #fwrite
    Do While Not EOF(fopen)
        Line Input #fopen, input_record
        field5 = cut(input_record, ";", 5)
        Select Case field5
        Case "Traits":
            traits_text = "(traits)"
        Case "TRAITS":
            traits_text = "(traits)"
        Case "0":
            traits_text = "(N)"
        Case Else:
            traits = Val(field5)
            traits_text = "("
            trait_added = 0
            n = 17
            Do While n >= 0
                t = 2 ^ n
                If (traits >= t) Then
                    If (trait_added = 1) Then
                        traits_text = traits_text + " "
                    End If
                    traits = traits - t
                    traits_text = traits_text + trait(n)
                    trait_added = 1
                End If
                n = n - 1
            Loop
            traits_text = traits_text + ")"
        End Select
        Print #fwrite, traits_text + input_record
    Loop
    Close #fopen
    Close #fwrite

End Sub

Function cut(ByVal record As String, ByVal delimeter As String, ByVal field_pos As Integer) As String
' A poor excuse for a cut command, but assuming the record from the HOI file is correct, the routine works.
    
    olds = record
    Do Until f = field_pos
        p = InStr(olds, delimeter)
        If p <> 0 Then
            news = Left(olds, p - 1)
            olds = Mid(olds, p + 1, Len(olds))
            cut = news
        Else
            cut = olds
        End If
        f = f + 1
    Loop
End Function
 

jdrou

Field Marshal
74 Badges
Jun 10, 2002
24.161
461
  • Stellaris: Federations
  • Europa Universalis IV
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Paradox Order
  • Stellaris: Digital Anniversary Edition
  • Humble Paradox Bundle
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: El Dorado
  • Europa Universalis III: Collection
  • Europa Universalis III: Chronicles
  • 500k Club
  • 200k Club
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Stellaris: Megacorp
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Deus Vult
  • Darkest Hour
  • Crusader Kings II
  • Hearts of Iron II: Armageddon
  • Arsenal of Democracy
  • Hearts of Iron Anthology
  • Victoria 2
  • Rome Gold
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III
  • For The Glory
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Stellaris: Galaxy Edition
One enhancement that could be done would be to change the order of the traits for multi-trait leaders. Right now it just lists them as they are found but it might be better (but slightly more difficult to code) if the more 'rare' traits were listed first so you could find them more easily in a sorted list.
 
Dec 7, 2003
584
0
Visit site
Ah. A nice, but perhaps tricky enhancement.
I am pretty sure we must rule out changing of sort order from within the game. At least if one is not to mess around with the order two sort labels and their keywords (rank/skill). Even if those trait combos are valuable, I doubt it would be worth it to remove the possibility to sort on rank. Not a too clean solution...

Other ideas on solution? Just brainstorming here. What about adding a number before the trait combos? I guess strings with a number up front would come highest in the sort list (haven't tested). Either a '2' for two traits, '3' for three etc or some sort of reversed weight system: a low number for best value...


As you may guess, I use my Excel hack to map out the leaders with special value, such as combinations of multiple traits and good rank and/or high skill. :D
 

Mithel

General
8 Badges
Nov 29, 2002
1.725
0
www.mnstarfire.com
  • Hearts of Iron III
  • 500k Club
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
Yes, I'll vouch for Kanitatlan's "Enigma/Colossus" program. It's well done and I've not found any problems with it yet. It adds two files to the directory that it's run from ("PartisanBase.txt" and "Partisans.Txt"). There is no fancy install (thus I'm assuming it's not touching the registry - I didn't spot any changes on quickly scanning).

It does drop an "Enigma.ini" file into your Windows directory.
 
Dec 7, 2003
584
0
Visit site
Mithel said:
Yes, I'll vouch for Kanitatlan's "Enigma/Colossus" program. It's well done and I've not found any problems with it yet. It adds two files to the directory that it's run from ("PartisanBase.txt" and "Partisans.Txt"). There is no fancy install (thus I'm assuming it's not touching the registry - I didn't spot any changes on quickly scanning).

It does drop an "Enigma.ini" file into your Windows directory.
Thanks.