This is the current structure for goodies:
Note that there is a way to teach an unit class
But there is no way to teach a profession, have a required unit_class, etc.
Imagine that I want to convert with a goody event only my soldiers to veteran soldiers, how can I do it? I can't, this event would apply to any type of unit.
The idea here is to apply some goodies to specific units (that is already checked in the DLL but some changes and XML tags are required). My suggestions:
<UnitClassRequired> The goody would only be activated for the required unit class. Otherwise we eliminate these goodies events from the possible list to be activated.
<ProfessionRequired> The same but for professions.
<TeachProffesion> The unit would learn the selected profession. Not sure if any profession would be valid... For ex. I would want to teach converted natives a profession restricted to real natives (PROFESSION_ARMED_BRAVE) but since it's forbidden for that unit not sure if it could be possible.
Also, if this is really considered, I would suggest some type of optimization here. Instead of 3 types of goodies in the XML file (imagine I want to convert soldiers in veterans, converted natives in soldiers, doctors in expert doctors, etc.) the structure could be changed.
This would be the 1st option considering the new tags. Here the goody would convert converted natives to regulars, colonists with soldier profession and regulars to veterans. We need at least 3 new events (many more if we add variations with professions).
This could be easily optimized if we change the XML tags to do this:
This way we have merged 3 events into one, we can add some type of conditions related to unit class and professions and finally teach new professions and unit class according to those conditions.
Code:
<GoodyInfo>
<Type>GOODY_TEACH_PROFESSION_BRAVE</Type>
<Description>TXT_KEY_PROFESSION_BRAVE</Description>
<Sound>AS2D_GOODY_XP</Sound>
<AnnounceText>TXT_KEY_GOODY_ANNOUNCE_HELP_TO_NATIVES</AnnounceText>
<ChiefText>TXT_KEY_CHIEF_GOODY_EXPERIENCE</ChiefText>
<iGold>0</iGold>
<iGoldRand1>0</iGoldRand1>
<iGoldRand2>0</iGoldRand2>
<iMapOffset>0</iMapOffset>
<iMapRange>0</iMapRange>
<iMapProb>0</iMapProb>
<iExperience>0</iExperience>
<iHealing>0</iHealing>
<iDamagePrereq>0</iDamagePrereq>
<bBad>0</bBad>
<bWar>0</bWar>
<UnitClass>NONE</UnitClass>
<TeachUnitClass>UNITCLASS_CONVERTED_NATIVE</TeachUnitClass>
<iCityGoodyWeight>100</iCityGoodyWeight>
<GoodyWeights/>
</GoodyInfo>
Note that there is a way to teach an unit class
Code:
<TeachUnitClass>UNITCLASS_CONVERTED_NATIVE</TeachUnitClass>
But there is no way to teach a profession, have a required unit_class, etc.
Imagine that I want to convert with a goody event only my soldiers to veteran soldiers, how can I do it? I can't, this event would apply to any type of unit.
The idea here is to apply some goodies to specific units (that is already checked in the DLL but some changes and XML tags are required). My suggestions:
<UnitClassRequired> The goody would only be activated for the required unit class. Otherwise we eliminate these goodies events from the possible list to be activated.
<ProfessionRequired> The same but for professions.
<TeachProffesion> The unit would learn the selected profession. Not sure if any profession would be valid... For ex. I would want to teach converted natives a profession restricted to real natives (PROFESSION_ARMED_BRAVE) but since it's forbidden for that unit not sure if it could be possible.
Also, if this is really considered, I would suggest some type of optimization here. Instead of 3 types of goodies in the XML file (imagine I want to convert soldiers in veterans, converted natives in soldiers, doctors in expert doctors, etc.) the structure could be changed.
This would be the 1st option considering the new tags. Here the goody would convert converted natives to regulars, colonists with soldier profession and regulars to veterans. We need at least 3 new events (many more if we add variations with professions).
Code:
<GoodyInfo>
<Type>GOODY_TEACH_PROFESSION_BRAVE</Type>
<Description>TXT_KEY_PROFESSION_BRAVE</Description>
<Sound>AS2D_GOODY_XP</Sound>
<AnnounceText>TXT_KEY_GOODY_ANNOUNCE_HELP_TO_NATIVES</AnnounceText>
<ChiefText>TXT_KEY_CHIEF_GOODY_EXPERIENCE</ChiefText>
<iGold>0</iGold>
<iGoldRand1>0</iGoldRand1>
<iGoldRand2>0</iGoldRand2>
<iMapOffset>0</iMapOffset>
<iMapRange>0</iMapRange>
<iMapProb>0</iMapProb>
<iExperience>0</iExperience>
<iHealing>0</iHealing>
<iDamagePrereq>0</iDamagePrereq>
<bBad>0</bBad>
<bWar>0</bWar>
<UnitClass>NONE</UnitClass>
<UnitClassRequired>UNITCLASS_REGULAR</UnitClassRequired>
<ProfessionRequired>NONE</ProfessionRequired>
<TeachUnitClass>UNITCLASS_VETERAN</TeachUnitClass>
<TeachProffesion>NONE</TeachProffesion>
<iCityGoodyWeight>100</iCityGoodyWeight>
<GoodyWeights/>
</GoodyInfo>
<GoodyInfo>
<Type>GOODY_TEACH_PROFESSION_BRAVE</Type>
<Description>TXT_KEY_PROFESSION_BRAVE</Description>
<Sound>AS2D_GOODY_XP</Sound>
<AnnounceText>TXT_KEY_GOODY_ANNOUNCE_HELP_TO_NATIVES</AnnounceText>
<ChiefText>TXT_KEY_CHIEF_GOODY_EXPERIENCE</ChiefText>
<iGold>0</iGold>
<iGoldRand1>0</iGoldRand1>
<iGoldRand2>0</iGoldRand2>
<iMapOffset>0</iMapOffset>
<iMapRange>0</iMapRange>
<iMapProb>0</iMapProb>
<iExperience>0</iExperience>
<iHealing>0</iHealing>
<iDamagePrereq>0</iDamagePrereq>
<bBad>0</bBad>
<bWar>0</bWar>
<UnitClass>NONE</UnitClass>
<UnitClassRequired>NONE</UnitClassRequired>
<ProfessionRequired>PROFESSION_SOLDIER_ERA_0</ProfessionRequired>
<TeachUnitClass>UNITCLASS_VETERAN</TeachUnitClass>
<TeachProffesion>PROFESSION_SOLDIER_ERA_0</TeachProffesion>
<iCityGoodyWeight>100</iCityGoodyWeight>
<GoodyWeights/>
</GoodyInfo>
<GoodyInfo>
<Type>GOODY_TEACH_PROFESSION_BRAVE</Type>
<Description>TXT_KEY_PROFESSION_BRAVE</Description>
<Sound>AS2D_GOODY_XP</Sound>
<AnnounceText>TXT_KEY_GOODY_ANNOUNCE_HELP_TO_NATIVES</AnnounceText>
<ChiefText>TXT_KEY_CHIEF_GOODY_EXPERIENCE</ChiefText>
<iGold>0</iGold>
<iGoldRand1>0</iGoldRand1>
<iGoldRand2>0</iGoldRand2>
<iMapOffset>0</iMapOffset>
<iMapRange>0</iMapRange>
<iMapProb>0</iMapProb>
<iExperience>0</iExperience>
<iHealing>0</iHealing>
<iDamagePrereq>0</iDamagePrereq>
<bBad>0</bBad>
<bWar>0</bWar>
<UnitClass>NONE</UnitClass>
<UnitClassRequired>UNITCLASS_CONVERTED_NATIVE</UnitClassRequired>
<ProfessionRequired>NONE</ProfessionRequired>
<TeachUnitClass>UNITCLASS_REGULAR</TeachUnitClass>
<TeachProffesion>NONE</TeachProffesion>
<iCityGoodyWeight>100</iCityGoodyWeight>
<GoodyWeights/>
</GoodyInfo>
This could be easily optimized if we change the XML tags to do this:
Code:
<GoodyInfo>
<Type>GOODY_TEACH_PROFESSION_BRAVE</Type>
<Description>TXT_KEY_PROFESSION_BRAVE</Description>
<Sound>AS2D_GOODY_XP</Sound>
<AnnounceText>TXT_KEY_GOODY_ANNOUNCE_HELP_TO_NATIVES</AnnounceText>
<ChiefText>TXT_KEY_CHIEF_GOODY_EXPERIENCE</ChiefText>
<iGold>0</iGold>
<iGoldRand1>0</iGoldRand1>
<iGoldRand2>0</iGoldRand2>
<iMapOffset>0</iMapOffset>
<iMapRange>0</iMapRange>
<iMapProb>0</iMapProb>
<iExperience>0</iExperience>
<iHealing>0</iHealing>
<iDamagePrereq>0</iDamagePrereq>
<bBad>0</bBad>
<bWar>0</bWar>
<UnitClass>NONE</UnitClass>
<TeachUnitClassCondtions>
<UnitClassProfessionRequired>
<UnitClassRequired>UNITCLASS_CONVERTED_NATIVE</UnitClassRequired>
<ProfessionRequired>NONE</ProfessionRequired>
<TeachUnitClass>UNITCLASS_REGULAR</NewUnitClass>
<TeachProffesion>NONE</TeachProffesion>
</UnitClassProfessionRequired>
<UnitClassProfessionRequired>
<UnitClassRequired>NONE</UnitClassRequired>
<ProfessionRequired>PROFESSION_SOLDIER_ERA_0</ProfessionRequired>
<TeachUnitClass>UNITCLASS_VETERAN</NewUnitClass>
<TeachProffesion>PROFESSION_SOLDIER_ERA_0</TeachProffesion>
</UnitClassProfessionRequired>
<UnitClassProfessionRequired>
<UnitClassRequired>UNITCLASS_VETERAN</UnitClassRequired>
<ProfessionRequired>NONE</ProfessionRequired>
<TeachUnitClass>UNITCLASS_VETERAN</NewUnitClass>
<TeachProffesion>NONE</TeachProffesion>
</UnitClassProfessionRequired>
<iCityGoodyWeight>100</iCityGoodyWeight>
<GoodyWeights/>
</GoodyInfo>
This way we have merged 3 events into one, we can add some type of conditions related to unit class and professions and finally teach new professions and unit class according to those conditions.