Coding units: Districts and Building prereqs and Reskills

Joined
Jan 10, 2019
Messages
1,861
1. What are XML Codes needed to put a constrain on a certain unit (or even class) that it now requires specific districts and/or buildings to build.?
2. Is there any code that allows unit reskills if promotion clas is changed if so how? and which coding language (XML or SQL) make this possible?
 
For buildings example:
Code:
<Unit_BuildingPrereqs>
       <Row Unit="UNIT_MONGE_JERONIMO" PrereqBuilding="BUILDING_NATIONAL_MOSTEIRO_JERONIMOS"/>
  </Unit_BuildingPrereqs>

As for the second question, I am not following what you want to achieve, can you explain better?
 
^ Re-skilling means if one unit is already promoted as one promotion class but when upgraded, the promotion class is also changed. used promotion points will return to use for new promotion class
For Example.
1. A Pikeman gets Echelon promotion, and later upgraded to Pike and Shot which is now 'gunpowder class' both as tag class and promotion class and has the combined benefits of Melee and Anticavalry class (Can deal the same extra damage against light and heavy cavalry class as well as mounted archers while no longer vulnerable to melee class)
2. Gunpowder class has different promotions
3. Newly upgraded unit no longer has Echelon but instead has spent promotion points returned.
 
So you only need a new promotion for each unit configured initially, is that what you want to do right?

I say unit X has one type of promotion but is upgraded to unit Y, which has another kind of promotion. when X upgrades to Y will have the new promotion type. Nevertheless, I never tried and don't know what the game does with the previous achievements in the promotion.
 
For buildings example:
Code:
<Unit_BuildingPrereqs>
       <Row Unit="UNIT_MONGE_JERONIMO" PrereqBuilding="BUILDING_NATIONAL_MOSTEIRO_JERONIMOS"/>
  </Unit_BuildingPrereqs>

As for the second question, I am not following what you want to achieve, can you explain better?
Again I bow down to your mod knowledge... And it's always bonus to learn something new.
 
For buildings example:
Code:
<Unit_BuildingPrereqs>
       <Row Unit="UNIT_MONGE_JERONIMO" PrereqBuilding="BUILDING_NATIONAL_MOSTEIRO_JERONIMOS"/>
  </Unit_BuildingPrereqs>

As for the second question, I am not following what you want to achieve, can you explain better?
Would it be fair to assume that there is another table called <Unit_DistrictPrereqs> ?
 
Would it be fair to assume that there is another table called <Unit_DistrictPrereqs> ?
No, for districts is done how you showed down in your code snippet. To make sure I validated in "01_GameplaySchema.sql"
 
So you only need a new promotion for each unit configured initially, is that what you want to do right?

I say unit X has one type of promotion but is upgraded to unit Y, which has another kind of promotion. when X upgrades to Y will have the new promotion type. Nevertheless, I never tried and don't know what the game does with the previous achievements in the promotion.
yes.
Particularly with existing promotions can't be duplicated to new promo class.
 
In that case, you have to change the "PromotionClass" of each unit, with an update clause Yand showed before.
Which means that. if Melee class and Anticavalry class (Both are Tag classes) are to converged into a new 'Infantry' class in the Renaissance Era (which intended to use different promo entirely since the existing promos can't be conferred to new ones). Then I also have to DELETE unused promotion classes and promos and redirect or rewrite the whole promotions or parts of for desired units and reassign a converged 'Infantry Promotion Class' to Melee and Anticavalry classes respectively?
[hide]To be honest many units shown in this game are silly and OFF SCALE, as @Boris Gudenuf discussed in a different forum (Ideas and suggestions, and General Discussions primarily). Examples are
- Musketmen being melee, and with RF also came 'improved' iterations--Pikes and Shots which were more historically accurate as most musket wielding troops actually fight that way.
- Machineguns, AT Crew and Infantry are separate units of different class entirely.
While it might be sourmised that 'Anticavalry' are generally Regular infantry 'backbone of any army' (may be recruited from simple peasantry and takes weeks or some months to train), and 'Melee' are Elites (Swordsmen, Men at arms, and Samurais were all came from warrior caste and not peasantry since these chaps are professional fighting men trained when they were kids and not expected to know how to farm or make things so they can fight better.). This came a research needs to find out if modern 'Elite Infantry' were truly different in fundamental combat functions and roles or even if Royal Guard Grenadiers and 1st Regulars were really outclassed in modern combat since these men were armed with comparable weapons and wargear. Comparing British Royal Grenadiers (Elite Guards) with US Army 1st Infantry Regiment (This unit is considered Regulars and not Elite Guard.) in 21st Century I don't thing they were THAT different anymore.[/hide]
 
Top Bottom