1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Unit Naming

Discussion in 'Civ4 - BTS Unaltered Gameplay (BUG, BAT and BULL)' started by ruff_hi, Sep 3, 2007.

  1. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    Here is the code for unit naming.

    ## Naming Convention
    ## - ^civ4^ - no naming convention, uses standard civ4
    ## - ^rd^ - random name
    ## - ^rc^ - random civ related name
    ## - ^ct^ - City
    ## - ^cv^ - Civilization
    ## - ^ut^ - unit (eg Archer)
    ## - ^ct^ - combat type (Melee)
    ## - ^dm^ - domain (Water)
    ## - ^ld^ - leader
    ## - ^cnt[f]^ - count across all units (increments based on unit)
    ## - ^cntu[f]^ - count across same unit (increments based on unit)
    ## - ^cntct[f]^ - count across same city (increments based on unit)
    ## - ^cntuct[f]^ - count across same unit / city (increments based on unit)
    ## - ^cntc[f]^ - count across same combat type (increments based on combat type)
    ## - ^cntd[f]^ - count across same domain (increments based on domain)
    ## - ^tt1[f][x:y]^ - total where the total is a random number between x and y (number)
    ## - ^tt2[f][x]^ - total count (starts at x, incremented by 1 each time ^tt is reset to 1)
    ##
    ## Where [f] can be either 's', 'A', 'a', 'p', 'g', 'n', 'o' or 'r' for ...
    ## - silent (not shown)
    ## - alpha (A, B, C, D, ...)
    ## - alpha (a, b, c, d, ...)
    ## - phonetic (alpha, bravo, charlie, delta, echo, ...)
    ## - greek (alpha, beta, gamma, delta, epsilon, ...)
    ## - number
    ## - ordinal (1st, 2nd, 3rd, 4th, ...)
    ## - roman (I, IV, V, X, ...)

    I've also written a short document that illustrates some possible unit naming conventions. You can set a default naming convention that is used for all units via the options screen. You can also set a different naming convention for each combat type from the options screen. If you select, 'Advanced', then the combat type naming conventions are ignored (note: the default naming convention is NOT ignored). The Advanced option allows you to set different naming conventions by ERA and by UNIT TYPE. You will need to edit the BUG Mod.ini file directly, these options are not available from the options screen.

    Edit: Note that we changed some of the counting conventions so the above doesn't work for v3.6 (or maybe earlier) onwards. See this post for more details.
     

    Attached Files:

  2. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    reserved for options screen shot.
     
  3. alerum68

    alerum68 Priest of Hiroshima

    Joined:
    Jan 3, 2004
    Messages:
    2,518
    Location:
    San Francisco, California, United States
    Sweet! Thanks Ruff. Are you going to release this standalone or keep it in the family only?
     
  4. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    keep it in the family. I was thinking that we should have a thread here that touches on the components of our mod ...

    - dom adviser
    - logger
    - main screen
    - city screen
    - etc
     
  5. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    I agree, at least for the one still under development.

    What about the idea to ask the admin to move the old thread inside this folder?
     
  6. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    Not tried yet in the game, but I'm reading the readme and it looks great! :goodjob:

    The only thing that I have to say is that I fear it may be a bit confusing using [n] for generic attribute when we already have ^n^ for no naming convention and [n] (a real 'n' in this case) for 'number' as an attribute.
    I suggest using something else, maybe even a capital N will be better.
    I think it doesn't appear in the code, so it's only a doc's problem.
     
  7. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    I'm sorry to say that it seems not to work for me.
    What I did was to go to option screen and to check the box for using the unit renaming component, i left unchecked the advanced box, and I left all the text boxes as they were (so, the first one with ^u^ ^cnt[r]^ of ^ct^ and all the other one with "DEFAULT").
    I built a couple of warriors, but they are still called simply "warrior" (well, the Italian word for "warrior").
    I've missed something? :confused:
     
  8. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    hmmn - I will take a look at it.

    Re your other comments about 'n' ... I am thinking of changing it so that ...

    ## - ^civ4^ - no naming convention, uses standard civ4
    ## - ^r^ - random name
    ## - ^rc^ - random civ related name
    ## - ^ct^ - City
    ## - ^v^ - Civilization
    ## - ^cnt[f]^ - count across all units (increments based on unit)
    ## - ^cntu[f]^ - count across same unit (increments based on unit)
    ## - ^cntct[f]^ - count across same city (increments based on unit)
    ## - ^cntuct[f]^ - count across same unit / city (increments based on unit)
    ## - ^cntc[f]^ - count across same combat type (increments based on combat type)
    ## - ^cntd[f]^ - count across same domain (increments based on domain)
    ## - ^tt1[f][x:y]^ - total where the total is a random number between x and y (number)
    ## - ^tt2[f][x]^ - total count (starts at x, incremented by 1 each time ^tt is reset to 1)
    ## - ^u^ - unit (eg Archer)
    ## - ^t^ - combat type (Melee)
    ## - ^d^ - domain (Water)
    ## - ^l^ - leader
    ##
    ## Where [f] is the number format and can be either 's', 'A', 'a', 'p', 'g', 'n', 'o' or 'r' for ...
    ## - silent (not shown)
    ## - alpha (A, B, C, D, ...)
    ## - alpha (a, b, c, d, ...)
    ## - phonetic (alpha, bravo, charlie, delta, echo, ...)
    ## - greek (alpha, beta, gamma, delta, epsilon, ...)
    ## - number
    ## - ordinal (1st, 2nd, 3rd, 4th, ...)
    ## - roman (I, IV, V, X, ...)
     
  9. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    better ^_^
    what about ^cv^ for civilization (as ^ct^ is for city) and maybe ^st^ (for 'standard') or ^v^ (stands for 'vanilla') instead of ^civ4^? And, if you want to completly avoid using the same letter in 2 places, maybe ^rn^ instead of ^r^ for random name.
     
  10. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    Unit Naming bug fixes complete. I have also changed the logic behind how it searches for the naming convention / code.

    • look for ERA_UNIT naming convention in ini file (you have to manually edit these in the ini file, way too many options to put on screen
    • if not found, or returns DEFAULT, look for COMBAT naming convention
    • if DEFAULT, look for DEFAULT naming convention

    Unfortunately, I cannot get the python code to read the ERA_UNIT value directly from the ini file HELP EF!!!

    I'll update my word doc and give some more counting examples tonight.
     
  11. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    Problem fixed by removing some comments or some such. Doesn't make a lot of sense but it works.

    I also updated the zip file in the first post.
     
  12. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)

    Now it works properly ^_^
    And it seems to be really great! :goodjob:

    Note: some of the "default" values in the ini file are already replaced by some code, is it intentional?
     
  13. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    re the 'defaults' ... yes, I was just playing. I fully expect people to change them.
     
  14. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    Ehm, I'm a bit dumb, but I didn't get the true behaviour of tt1 and tt2.

    Let's look at your Borg example (I think tou had to put "n" instead "f" in this, but doesn't matter):

    ^cnt[f]^ of ^tt1[f][6:10]^, Unimatrix ^tt2[f][1]^

    Scout 1 of 7, Unimatrix 1
    Worker 2 of 7, Unimatrix 1
    Galley 3 of 7, Unimatrix 1
    Bomber 4 of 7, Unimatrix 1
    Axeman 5 of 7, Unimatrix 1
    Swordman 6 of 7, Unimatrix 1

    So, ^cnt[f]^ counts over all units (regardless of unit type, combat type and domain), from 1 to a random number chosen between 6 and 10, in this case 7.
    I get it. But what about tt2?. It starts as 1 and stays equal to 1 until tt1 resets to 1? If it works in this way, the next unit will be something like:

    Archer 7 of 7, Unimatrix 1
    Bowman 1 of 9, Unimatrix 2

    Correct? :confused:
     
  15. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,830
    Location:
    an Aussie in Boston
    Yes. That is how it is meant to work.
     
  16. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    Good ^_^


    ------------------
     
  17. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    I've just realized that in your readme you report a different one:

    • ^rd^ - random name
    • ^rc^ - random civ related name
    • ^ct^ - City
    • ^cv^ - Civilization
    • ^ut^ - unit (eg Archer)
    • ^ct^ - combat type (Melee)
    • ^dm^ - domain (Water)
    • ^ld^ - leader

    so... what are the correct ones? :confused:
     
  18. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    Oh, answering to myself, i suppose that the correct one is the one included as a comment inside the file itself, so this one:

    ## - ^civ4^ - no naming convention, uses standard civ4
    ## - ^rd^ - random name
    ## - ^rc^ - random civ related name
    ## - ^ct^ - City
    ## - ^cv^ - Civilization
    ## - ^ut^ - unit (eg Archer)
    ## - ^cb^ - combat type (Melee)
    ## - ^dm^ - domain (Water)
    ## - ^ld^ - leader

    So, I'll update the readme with that cb :)
     
  19. Cammagno

    Cammagno Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    712
    Location:
    Genoa (Italy)
    Ok, so I started a new game, and I choose to leave all the naming convention set to DEFAULT, and to set the DEFAULT box to :
    ^ut^ ^cntu(n)^ (^ct^)
    So, I expected that my firs Settler will be called something like:
    Settler 1 (Rome)
    instead I get a random name... where is my error? :confused: :blush:
     
  20. Psyringe

    Psyringe Scout

    Joined:
    Dec 7, 2001
    Messages:
    3,393
    Location:
    Berlin, Germany
    Open the "BUG mod.ini" and find these lines:

    Code:
    # Advanced optional naming conventions based on ERA and UNIT CLASS
    
    ANCIENT_SETTLER = ^rd^
    
    This is a setting that is not accessible via the in-game option, but overrides whatever you specify there. Changing "^rd^" to "DEFAULT" in the ini should do the job.
     

Share This Page