I couldn't think of anything besides modifying the improvement AI directly.How would I go about lowering the propensity for the AI to build preserve forest? Or is moving it back to Ecology in BuildInfos going to cause problems?
Are slaves declared as starting with UNITAI_SLAVE and is it a possible AI for them? Are you sure slaveMove() is actually called when UNITAI_SLAVE is active? Conversely, are you sure that UNITAI_SLAVE is actually active for the units you are using for testing?I'm trying to make UNITAI_ type for my slave unit. it's supposed to do 1 of 4 things:
rush a building using the normal mechanic (mini-engineer)
conduct a trade mission using the normal mechanic (mini-merchant)
settle in a city (mini-super specialist)
act as a worker
I added UNITAI_SLAVE and slaveMove(), which is, for now, just a copy of workerMove(), but the slaves either sit in cities and do nothing or go exploring.
any idea what might be missing?
Are slaves declared as starting with UNITAI_SLAVE
and is it a possible AI for them?
Are you sure slaveMove() is actually called when UNITAI_SLAVE is active?
Conversely, are you sure that UNITAI_SLAVE is actually active for the units you are using for testing?
if (iPreserveDefenders > 0):
if iPreserveDefenders > 0:
The ID associated with a promotion is its position in the XML file where it's defined, starting with 0.
I suppose you're talking about getOwnerINLINE() in CvUnit? That method returns the player that owns the unit. You can get the civilization with GET_PLAYER(getOwnerINLINE()).getCivilizationType() from there (i.e. getCivilizationType() is a method of CvPlayer). In RFC that step is often skipped because in the scenarios, players are associated with set civilizations so you always know which player is which civs, but in general you can't assume that.