<Nexus>
Traveler of the Multiverse
Is it possible to make a unit more expansive with passing eras? IIRC workers get more expansive but I'm not sure 

Is it possible to make a unit more expansive with passing eras?
THX, but not exactly what I was looking for.If the Civ4EraInfos.xml tag <iTrainPercent> does what is logical: Yes. If not: No, not to my knowledge.
If the above tag doesn't work, I guess you could ask somebody to make a Python-code.
EDIT: Of course, this would work for ALL units, not just one particular one.
EDIT2:
Just checked the modiki, this should work:
A - Civ4UnitInfos.xml
Make a unit require a building, and give building free at game's start.
B - Civ4EventInfos.xml
Can give/take away a building via an event.
C - Civ4EventTriggerInfos.xml
Can use OrPreReqs to trigger events when reaching next era.
Will need to play with events, or remove current events from files.
Will need one unique unit per era.
Will need one unique building per era.
Looks like a lot of work. Looks like it should work.
int CvUnitInfo::getProductionCost() const
{
return m_iProductionCost;
}
Thank you very much but editing the dll is beyond my reachFor me there is a more straightforward way, relatively easy in C++ :
First create a new XML Tag in the CvUnitInfo file, which you fill in for just the worker.
Say <iEraAdditionalCost>10</iEraAdditionalCost>
Then in C++ you need to "attack" the value of cost as early as possible, this is the function that reads the cost
Code:int CvUnitInfo::getProductionCost() const { return m_iProductionCost; }
Then change this logic to say, to add a value calculated with :
GC.getGame().getCurrentEra() * this value of iEraAdditionalCost =
(Remember, "Ancient" = 0, Classical = 1 etc.).
Also, don't forget to check that the current era "exist" in the calc, otherwise you'll have an error in game menu / in civelopedia etc.
(GC.getGame().getCurrentEra() != NO_ERA)
Predictive text kicking in on the mobile. I meant integer.
Nice, thanks! Should've checked updateCombat too.@Leoreth: AS2D_OUR_WITHDRAWL, AS2D_THEIR_WITHDRAWL
at the end of CvUnit::updateCombat (combat has ended but neither unit has died).
void CvDLLWidgetData::parseTradeItem(
CvWidgetDataStruct &widgetDataStruct, CvWStringBuffer &szBuffer)
{
// ...
if (widgetDataStruct.m_bOption)
{
if (gDLL->isDiplomacy())
eWhoFrom = (PlayerTypes)gDLL->getDiplomacyPlayer();
else if (gDLL->isMPDiplomacyScreenUp())
eWhoFrom = (PlayerTypes)gDLL->getMPDiplomacyPlayer();
eWhoTo = kGame.getActivePlayer();
}
else
{
eWhoFrom = kGame.getActivePlayer();
if (gDLL->isDiplomacy())
eWhoTo = (PlayerTypes)gDLL->getDiplomacyPlayer();
else if (gDLL->isMPDiplomacyScreenUp())
eWhoTo = (PlayerTypes)gDLL->getMPDiplomacyPlayer();
}
// ...
case TRADE_RESOURCES:
GAMETEXT.setBonusHelp(szBuffer, (BonusTypes)widgetDataStruct.m_iData2);
// ...
- - -
|L|L|L|
- - -
|W|C|L|
- - -
|W|W|W|
- - -
This one might be worth a try:Could someone point me in the direction of a tutorial for how to create a new civ? I had an idea for a mod that adds the 50 us states as civs.