migck
Señor de la guerra
- Joined
- Apr 6, 2009
- Messages
- 178
I'm trying to create a little addon of resources used as requirements to build some modern units, but so that when the resource becomes obsolete with a certain tech it is no longer needed to build that unit.
Specifically, I'm trying to implement this for a Rubber resource, used to build some modern units like Tanks and Infantry, but being no longer needed once the player discovers Plastics.
I have identified the function controlling requirements to train units in:
I know the best thing would be to create new XML fields defining such behavior, but for such a focused feature, I prefer not to dabble into that yet.
The thing is, I don't know how to add the structure to evaluate the owner of the unit, and whether he has Plastics tech there.
Any help is appreciated.
Specifically, I'm trying to implement this for a Rubber resource, used to build some modern units like Tanks and Infantry, but being no longer needed once the player discovers Plastics.
I have identified the function controlling requirements to train units in:
Code:
CvPlot::canTrain(UnitTypes eUnit, bool bContinue, bool bTestVisible) const
The thing is, I don't know how to add the structure to evaluate the owner of the unit, and whether he has Plastics tech there.
Any help is appreciated.