1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. 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. EmperorFool

    EmperorFool Chieftain

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    Hmm, I just noticed that the hover text for the counting codes is still using the old codes. :( I've added the above code for multiple codes, but Ruff could you please fix the hover text when you get a chance (all languages)?
     
  2. caveman1917

    caveman1917 Chieftain

    Joined:
    Oct 1, 2009
    Messages:
    110
    I noticed when using domain it gives the full description.
    For example "^dm^ Army" gives "Land units Army", where i suppose it should give "Land Army".

    I don't know if it was intended like this, but in case it should have been the latter, i made a quick fix: in class UnitRename, def getUnitName changing

    Code:
    zsUnitDomain = gc.getDomainInfo(pUnit.getDomainType()).getDescription()
    into

    Code:
    zsUnitDomainList = (gc.getDomainInfo(pUnit.getDomainType()).getDescription()).split(None, 1)
    zsUnitDomain = zsUnitDomainList[0]
     
  3. EmperorFool

    EmperorFool Chieftain

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    That won't work for all languages. In French, Italian, and Spanish you need to use [1]. :( In German it's a single word, but that should work since split() will return a single-element list I think.

    So I'm putting translations into BUG directly without the Units portion:

    Code:
    	<TEXT>
    		<Tag>TXT_KEY_BUG_UNIT_NAMING_DOMAIN_LAND</Tag>
    		<English>Land</English>
    		<French>Terrestre</French>
    		<German>Land</German>
    		<Italian>Terrestre</Italian>
    		<Spanish>Terrestre</Spanish>
    	</TEXT>
    	<TEXT>
    		<Tag>TXT_KEY_BUG_UNIT_NAMING_DOMAIN_SEA</Tag>
    		<English>Naval</English>
    		<French>Naval</French>
    		<German>Marine</German>
    		<Italian>Navale</Italian>
    		<Spanish>Naval</Spanish>
    	</TEXT>
    	<TEXT>
    		<Tag>TXT_KEY_BUG_UNIT_NAMING_DOMAIN_AIR</Tag>
    		<English>Air</English>
    		<French>A&#233;rien</French>
    		<German>Aire</German>
    		<Italian>Aerea</Italian>
    		<Spanish>A&#233;rea</Spanish>
    	</TEXT>
    	<TEXT>
    		<Tag>TXT_KEY_BUG_UNIT_NAMING_DOMAIN_IMMOBILE</Tag>
    		<English>Stationary</English>
    		<French>Stationnaire</French>
    		<German>Stationär</German>
    		<Italian>Stazionario</Italian>
    		<Spanish>Estacionaria</Spanish>
    	</TEXT>
    
    If any of those are incorrect, please advise. Since these will be specifically for Unit Naming, do you want adjectives or nouns? Water vs. Naval? Heck, I could use better words for all of them.
     
  4. Fuyu

    Fuyu Chieftain

    Joined:
    Nov 5, 2009
    Messages:
    1,220
    Location:
    Austria
    immobile: <German>Unbeweglich</German> without the e. "Stationär" (german for stationary) would work too

    edit: but if it is used as adjective then nvm, no matter what you use it would be wrong in some cases, german adjectives need declinations -_-
     
  5. caveman1917

    caveman1917 Chieftain

    Joined:
    Oct 1, 2009
    Messages:
    110
    Yes hadn't thought of that :(

    As for the names i think they're good. They would, as far as i see it, be used mostly as an adjective form (eg Naval Battalion) instead of a noun (that would almost give "Battalion on Water" or something).

    Perhaps change immobile to stationary. In the context of military use it seems to sound better to talk of a "stationary field emplacement" instead of an "immobile field emplacement". But i'm not a native english speaker so i may be totally wrong in this :)

    The adjective-noun thing made me think of something, in the documentation it says that the civ name is in adjective form, but using this as Carthage in my current game it just still gave "Carthage" instead of the expected "Carthaginian". I looked at the code and found this
    Code:
    zsCiv = gc.getPlayer(iPlayer).getCivilizationShortDescription(0)
    I'm not familiar with the game code itself, is this supposed to give the adjective or the noun form? If the former i'll test some more civilizations. The (0) suggests it would be returning the first item in some array which could be the noun.
     
  6. EmperorFool

    EmperorFool Chieftain

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    I almost want to say that "Land" should be Army if you're going to put this adjective before "Battalion," but I'm no military historian. I agree that "Stationary" sounds better here too.

    I don't know the functions off the top of my head here, but one gives the noun and the other the adjective. I'll let Ruff take care of this. ;)
     
  7. EmperorFool

    EmperorFool Chieftain

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    I changed a few of the land/sea/air/immobile descriptions above.
     
  8. caveman1917

    caveman1917 Chieftain

    Joined:
    Oct 1, 2009
    Messages:
    110
    Yes you're right, it seems 'Army' is used specifically for land units. In dutch one may use it's equivalent 'leger' for the whole and 'landmacht' (land forces) for the terrestrial one. But it doesn't seem to be used that way in english :)

    Do you perhaps know where i could find a reference on those available functions to hook into the game? I found a couple of tutorials for a variety of things, but not really a good reference overview of the classes and methods themselves.
     
  9. EmperorFool

    EmperorFool Chieftain

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    The Python API lists the functions and the parameters they take, but there is little in the way of actual documentation (what they do). The best way is to read the code and try things out.
     
  10. caveman1917

    caveman1917 Chieftain

    Joined:
    Oct 1, 2009
    Messages:
    110
    Found it, changing this
    Code:
    zsCiv = gc.getPlayer(iPlayer).getCivilizationShortDescription(0)
    into this
    Code:
    zsCiv = gc.getPlayer(iPlayer).getCivilizationAdjective(0)
     
  11. monoolho

    monoolho Chieftain

    Joined:
    Aug 22, 2009
    Messages:
    6
    Location:
    Over there
    I've read mostly everything here and still my brain can't process it, I think I'm getting too old for this...
    I'm sorry but I have to ask this...

    How do you use multiple counters? I've tried most possible combinations and still no success, it keeps showing the code instead of the counter.

    Do I have to edit the .ini for that or is it possible to do it in-game(alt+tab+o)? I still haven't messed around with the .ini, so I'm not sure how it will work, maybe I'll have to edit too many things...

    Anyway I suggest updating the documentation, and if anyone can help me with multiple counters I'd be glad.
     
  12. IPEX-731BA5DD06

    IPEX-731BA5DD06 Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    2,439
    Location:
    Melbourne, Victoria, Australia
    Ha Ha, Thread revival.

    Seriously, is there a way to use the tt1 and tt2 naming conventions so that it doesn't produce a random number.

    Specifically I want to number them in the Army naming convention given as an example, but have them numbered sequentially, but resetting once a set number has been achieved.

    What do I mean;

    Army Group 1, 1st Corps , Squads (Able [1st]..Hotel[8th] ) Reset
    Army Group 1, 4th Corps, Squads (Able...Hotel) Reset
    Army Group 2, 1st Corps, Squads (Able..Hotel)

    Basically I want to count as an example 8 Squads, reset, count 4 corps, reset and infinite Army Groups.

    As is set up now, its a Random number for Companies, but it'll never reset, even once all options have been used, ie, tt1, 1 used 3 times, 2 used once, 3 used 5 times, 4 used twice, 5 used once but won't reset tt2

    I tried this using the Cntl-Alt-N naming options, but never resets tt2
     
  13. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,815
    Location:
    an Aussie in Boston
    No. tt2 never resets ... it just keeps on counting. We did brain storm some code for infinite counters (see back a few pages) but we never got around to implementing it.

    Here is an example from earlier in this thread for what is is trying to do ...
     
  14. IPEX-731BA5DD06

    IPEX-731BA5DD06 Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    2,439
    Location:
    Melbourne, Victoria, Australia
    I've gotten some errors from unit naming.

    It worked previously, as I wanted it too, as given in the example on screen shot

    Spoiler :


    I produced 3 Modern infantry and 1 mobile missile carrier. Fine, excellent work Ruff :goodjob:

    but now when I try to test various other combinations, I get this error

    Spoiler :


    Might be because, I've activated screen saver a couple of times, left it running for 8 hr's straight, etc. Or because I've enacted an arcane set of key's using Cntl-Alt- P and L or Cntl or Alt with Shift and P or L.

    Trying to use the civ swap in REV_DCM

    Key's also got stuck on capitals with caps off and non capitals with it on, so may go away.

    But seen that error before with naming conventions, so its an actual bug. Don't know it it helps, or even if your inclined to look into it.

    Thanks for Bug.

    Oh, lastly, how would I re-enable the SVNutil.py checking in bug, if its been disabled in being merged into a mod, just change the Check's from false to true??
     
  15. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,815
    Location:
    an Aussie in Boston
    I think that error is because you need to select a unit before starting the Unit Rename tester dialog box.
     
  16. IPEX-731BA5DD06

    IPEX-731BA5DD06 Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    2,439
    Location:
    Melbourne, Victoria, Australia
    I tried the next day, fresh boot, well rested computer. I selected a unit 1st to try out unit naming conventions (Cntl+Alt+N) and got same error.

    Next I selected and opened a city, tried again, same error.

    here's an example of my Unit naming convention ([party])

    Spoiler :


    Using Rise of Mankind - A New Dawn Mod ​


    here's and example of the out put over many units. (not sorted in out put order, just a random grouping.) Hey I have 4 separate fronts going at once, 5 if you count the invasion group for the 2 tile island.

    Spoiler :





    I'm such a Ruthless Tyrant, size 19 city and I abandon it. (using larger cities mod, 3rd ring enabled, and doesn't meet my Plan for Continent/Island)

    Here's the error, once more
    Spoiler :


    I've tried it with advance unit naming on and off, and upgrade name on and off and both on and off (6 combinations) all gave same error.

    Its not game breaking, just mildly annoying, BUT, you never know what else it may effect.

    Finally, the random number generator, does that use a maths function in Python, a spreadsheet, or a created program. Its just I'd like to build, as an example;
    -5 companies for each division.
    -25 Divisions for each Army group
    -Army groups ad infinitum.

    Oh, just to slip in a final query. Is it possible, as a added feature, to count the Captured workers, Units (mods) etc from each player.

    E.G.
    1st Liberated Barbarian (worker)
    14th Liberate Holy roman (worker)
    5th Liberated Persia (worker)
    3rd Captured Zulu (cannon)
    1st Abandon Paris (worker)
    2nd Abandon Paris (worker)
    1st Abandon Paris (Settler)
    Or will I have to keep manually counting, no biggie, just a nice to add if inclined.
     
  17. IPEX-731BA5DD06

    IPEX-731BA5DD06 Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    2,439
    Location:
    Melbourne, Victoria, Australia
    Just had a quick thought on Army naming, I could, and will change it too;

    ^cnt[p][d]^ Squad, ^tt1[o][1:10]^ Company, ^tt2[o][1]^ Division of the 1st Army group. (alter to 2nd etc when I have enough divisions)

    P.S. Example of the unit numbering for captured units I meant

    Spoiler :
     
  18. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,815
    Location:
    an Aussie in Boston
    Yes, that will work. Note that the ^tt1[o][1:10]^ part means that the number of squads per company will be a random number between 1 and 10. If you want each company to have 10 squads, change the [1:10] part to [10:10].
    That should work.
     
  19. IPEX-731BA5DD06

    IPEX-731BA5DD06 Chieftain

    Joined:
    Dec 15, 2005
    Messages:
    2,439
    Location:
    Melbourne, Victoria, Australia
    Bad dog Ruff Hi *Hits with a rolled up newspaper*..

    that suggestion you made, just outputs company 10 all the time, no reseting at all

    I'll try a single 10 to see if that changes things.
     
  20. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    8,815
    Location:
    an Aussie in Boston
    http://www.youtube.com/watch?v=3uTyZ-YC6qY
    Ahh, right. I coded this about a billion years ago so I guess I have forgotten. Given your comment and a slightly refreshed memory ... try this ...

    [tab]^cnt[p][d]^ ^tt1[10:10]^ Squad, ^tt2[o][1]^ Company, 1st Division of the 1st Army group

    As the code currently is, there is only 1 counter (^cnt[p][d]^), the tt1 part tells it when to reset to '1' and when to increment the tt2 counter. The '' part tells it that the display mode for the tt1 counter is silent (ie not shown).

    As I said above, we did brain storm some code that adds unlimited counters, we never implemented it.
     

Share This Page