How to save unique names for units in WB?

Emper0r

Chieftain
Joined
Jan 9, 2006
Messages
35
Hey guys, can someone please help me out here!

I open up my scenario in world builder, I click on the unit editor tool, I click on a unit, I name it something BESIDES the default (for example changing an Infantry from "Infantry" to "John".

After I save WB and exit the game, the Infantry will still be named John, no problems. But when I exit the game and go to the main menu, then play the scenario again, the unit will be back to it's default name!

Can someone PLEASE tell me how to successfully save unique names for units? Thanks!
 
Someone plz help!
 
There is a guide to the wbs file format in the tutorial section but it would indicate that the wbs doesn't support saving unit names.


BeginUnit is the subsection that defines a unit at this plot. A unit is defined in the following way:
Code:
Code:
BeginUnit
        UnitType=AAAA, UnitOwner=BBBB
        Level=CCCC, Experience=DDDD
        PromotionType=EEEE
        UnitAIType=FFFF
    EndUnit

Where:
AAAA = the unit type that is at the plot. These values are defined in CIV4UnitInfos.xml.
BBBB = the unit owner (the player number who owns this unit). The first player is player 0 with the last possible player being player 17 (equals 18 players).
CCCC = the experience level of the unit. Each level means one more promotion is possible. EG: Level=0 means no promotions, Level=2 means 2 promotions.
DDDD = the actual experience of the unit. This reflects how many points it has gained towards the next promotion level.
EEEE = the promotions this unit has. You assign as many PromotionType lines as Levels given to the unit above. These values are defined in CIV4PromotionInfos.xml.
FFFF = the usage of the unit for the AI. Assigning the correct UnitAIType for a unit is important as it tells the AI what the unit is used for. EG: Settler units should get UnitAIType=UNITAI_SETTLE

If you have to have the names I'd say you need to place and name the units in a python script called on the begin game event. If you have a lot of units to place it could be a great deal of typing.
 
So what is the exact name of the python file?
 
CvEventManager.py.
onGameStart is the function.
 
Could you give an example of the text that needs to be added to python file to give a unit a specific name?

I see we can add units to plots in the wbs file, too bad you can't name the unit there.
 
I am surprised no one had modded this via the SDK or with Python, since it seems like such an essential aspect of creating a realistic Mod. I'm amazed it didn't come built into the game.
 
Back
Top Bottom