a question about boolean logic.

I've been looking at the city milita code block and I was wonder how you would go about adding boolean logic to check what the most up to date unlocked tech was for the unit.

 

Here is the complete code block in question for reference.I beleive all i need is the reference name <UnitType InternalName="Unit_CityArcher_Altarian_Party"> to override the core file code

Code: xml
  1. &lt;UnitType InternalName="Unit_CityArcher_Altarian_Party"&gt;
  2.          &lt;DisplayName&gt;City Archer&lt;/DisplayName&gt;
  3.          &lt;Description&gt;Your citizens will defend their cities.&lt;/Description&gt;
  4.          &lt;Class&gt;CityArcher_Party&lt;/Class&gt;
  5.          &lt;RaceType&gt;Race_Type_Altarians&lt;/RaceType&gt;
  6.          &lt;CanBeDesigned&gt;0&lt;/CanBeDesigned&gt;
  7.          &lt;Gender&gt;Male&lt;/Gender&gt;
  8.          &lt;HasWages&gt;0&lt;/HasWages&gt;
  9.          &lt;IsSovereign&gt;0&lt;/IsSovereign&gt;
  10.          &lt;GroupingType&gt;UnitGroupingType_Party&lt;/GroupingType&gt;
  11.          &lt;LevelMilestone InternalName="L1"&gt;
  12.              &lt;Level&gt;1&lt;/Level&gt;
  13.          &lt;/LevelMilestone&gt;
  14.          &lt;SelectedAbilityBonusOption&gt;Blood_Altarian&lt;/SelectedAbilityBonusOption&gt;
  15.          &lt;Equipment&gt;Shortbow_Crude&lt;/Equipment&gt;
  16.          &lt;Equipment&gt;F_Head_Wraith_Mesh_02&lt;/Equipment&gt;
  17.          &lt;Equipment&gt;Noble_Surcoat_Solid_ID1&lt;/Equipment&gt;
  18.          &lt;Equipment&gt;Peasant_Pants_ID2&lt;/Equipment&gt;
  19.          &lt;Equipment&gt;Sovereign_Bandit_Hair_ID1&lt;/Equipment&gt;
  20.          &lt;Equipment&gt;Sovereign_Warrior_Shirt_Crappy_ID2&lt;/Equipment&gt;
  21.          &lt;Prereq&gt;
  22.              &lt;Type&gt;Race&lt;/Type&gt;
  23.              &lt;Attribute&gt;Race_Type_Altarians&lt;/Attribute&gt;
  24.          &lt;/Prereq&gt;
  25.          &lt;Backstory&gt;"I seek no mercenaries; the Silver Swordsmen and their ilk are unwelcome in the ranks of my army. What I seek are heroes - those who wish to make bettering this world their life&#39;s adventure!" These words - uttered at the nadir of the Nobles Revolt, when the armies of Procipinee surrounded Relias and his companions at the foot of Mount Essa - remain the rallying cry for all Altar&#39;s soldiers. This is an army of adventurers - many of whom are famous in their own right for the quests they have completed - an army that will sometimes dare the impossible and often achieve it.&lt;/Backstory&gt;
  26.         &lt;AnimationPack&gt;MaleSovereignAnimationPack&lt;/AnimationPack&gt;
  27.          &lt;BattleAnimationBehavior&gt;Melee&lt;/BattleAnimationBehavior&gt;
  28.          &lt;ClothMapScale&gt;1.6&lt;/ClothMapScale&gt;
  29.          &lt;ClothPoseIndex&gt;1&lt;/ClothPoseIndex&gt;
  30.          &lt;Color_Hair&gt;173,128,93,255&lt;/Color_Hair&gt;
  31.          &lt;CutSceneDataPack&gt;DefaultUnitCutscenePack&lt;/CutSceneDataPack&gt;
  32.          &lt;EyeTexture&gt;gfx\eyes\blinks\eyeblink_m4_blk.png&lt;/EyeTexture&gt;
  33.          &lt;InfoCardBackground&gt;BG_KingdomRugged&lt;/InfoCardBackground&gt;
  34.          &lt;ModelPath&gt;Gfx\HKB\Units\K_Male_Mesh_01.hkb&lt;/ModelPath&gt;
  35.          &lt;ModelScale&gt;1&lt;/ModelScale&gt;
  36.          &lt;MovingSFX&gt;TEMP_KnightMarching1&lt;/MovingSFX&gt;
  37.          &lt;OnHitParticleName&gt;Bloody_OnHit&lt;/OnHitParticleName&gt;
  38.          &lt;SkeletonPath&gt;Gfx\HKB\Units\K_Male_Skeleton_01.hkb&lt;/SkeletonPath&gt;
  39.          &lt;SoundPack&gt;SoundPack_Generic_Male&lt;/SoundPack&gt;
  40.          &lt;TacticalModelScale&gt;1.5&lt;/TacticalModelScale&gt;
  41.          &lt;Texture_Eyes&gt;gfx\eyes\blinks\eyeblink_m4_blk.png&lt;/Texture_Eyes&gt;
  42.          &lt;Texture_Skin&gt;K_Male_beard_Texture_01.png&lt;/Texture_Skin&gt;
  43.          &lt;UnitModelType&gt;KingdomMale&lt;/UnitModelType&gt;
  44.      &lt;/UnitType&gt;

3,501 views 7 replies
Reply #1 Top


to continue, i'm breaking this up to seperate ideas:

 

so i am thinking all i would need to do is have an xml with this info, while replacing the items with boolean logic to check what the most up to date equipment is for that piece.

 

<UnitType InternalName="Unit_CityArcher_Altarian_Party">

<Equipment> Shortbow_Crude </Equipment>

<Equipment>F_Head_Wraith_Mesh_02</Equipment>

<Equipment>Noble_Surcoat_Solid_ID1</Equipment>

<Equipment>Peasant_Pants_ID2</Equipment>

<Equipment>Sovereign_Bandit_Hair_ID1</Equipment>

<Equipment>Sovereign_Warrior_Shirt_Crappy_ID2</Equipment>

 

 

 

Reply #2 Top

When overwriting unittypes you want to include all the data, just like you would in an item.

I'm not sure what you mean by boolean logic in this case. If you want to upgrade their gear automatically according to what techs are unlocked there's a system for that.

Reply #3 Top

well, i don't know the system for upgrading them lol so i feel im reinventing the wheel. Perhaps we need to figure out a better way of sharing info. Otherwise i'm going to be asking a lot of silly questions.


 

Reply #4 Top

The upgrading works with a special block for the shield it would look  like this

 <EquipmentUpgradeDef>
      <EquipmentSlot>Defense</EquipmentSlot>
      <SelectionCriteria>MaximizeSum</SelectionCriteria>
      <ComparisonAttribute>UnitStat_Defense_Blunt</ComparisonAttribute>
      <ComparisonAttribute>UnitStat_Defense_Cutting</ComparisonAttribute>
      <ComparisonAttribute>UnitStat_Defense_Pierce</ComparisonAttribute>
    </EquipmentUpgradeDef>

 

I'm not sure what other tags there are for SelectionCriteria then MaximizeSum but if you just want to add the "best" i think that would do

If you want it more granular you can always add new UnitStas and maximize them (check out Heavenfall's UnitStat lib for some ideas)

Reply #5 Top

Doh, sorry, completely forgot to reply to the topic.

Reply #6 Top

You are already a living and breathing F1 key Heavenfall don't worry

Reply #7 Top


hehe thanks guys.

shame on you heavenfall, -1 karma for lack of dependability.... yeah.... rofl

go get some sleep heavenfall lol.

 

interesting.

I wonder what the possibilites are for the selection criteria tag.

never enough time, so many details to get sorted out to make things working just so. Oh well, it's nice that the answers open up more questions and possiblities.