[Feature Request] Requirements for Using (Strategic and/or Tactical) One-Use Items, including Allegiance, Tech, Global Resource Value, Player Skill, Unit Skill, Unit Unitstat.

EDIT: Since I know know that you can do all sorts of things with skills and equippable items, I now restrict the request to preventing units using certain items if they (or their player, as relevent for allegiance, tech, global resource value or player skills) don't have the correct allegiance, tech, global resource value (does not need to be taken away, although this could be an option which could be on/off for each resource to take away once it has been determined they have enough that they don't go below 0, so you could limit the number of uses of an item on a player level), player or unit skill, or unit unitstat (again, like a global resource, there could be an on/off option for an item to use up a certain amount of a certain unitstat, to restrict the number of uses of the item for any unit does not have sufficient unitstat of a certain kind, or has used it all up).

 

Similar to the Armor Proficiency skills, it would open up so many possibilities if you could make certain weapons, accessories, items etc. only equippable/usable by those with certain skills or equipped items, or have equippable/usable items that give extra bonuses to only those who have certain skills and/or equipped items.

Examples:

- So you could have Class, Skill or Profession Specific weapons, armor, trinkets, usable items;

- Class Bonuses For Particular Weapons, Armor or Accessories;

- No Initiative Penalty Ranged Staves for Mage Heroes, or Skills which offset Initiative Penalties for Ranged Staves, but only when the Stave is equipped;

- Equippable/usable Items that give an extra bonus IF you have certain skills or item/s;

- Items that can only be used/equipped if you have certain skills, or certain items equipped, or both.  This can include tactical and strategic use items.

The possibilities are endless, and especially the allowing/disallowing of certain equippable items is already in the game, that part should be easy to open to modders, why not even open this up to "allow use or equip based on skills or equipped items", "bonus to use or equip based on skills or equipped items".

Look forward to your feedback on this everyone!  Devs/players welcome!

6,968 views 12 replies
Reply #1 Top

- No Initiative Penalty Ranged Staves for Mage Heroes, or Skills which offset Initiative Penalties for Ranged Staves, but only when the Stave is equipped;
End of quote

I think you have two options for this.

1) Make separate staves that are only available to heroes

- Copy the code of the researchable staves.

- Change the internal (and display) name.

- Remove the init penalty.

- Make them unavailable for unit design.

You can now buy staves without init penalty for your heroes from the shop, but your mage units will still use staves with an init penalty.

2) Create a new skill/unit trait that allows the use of the mentioned staves (I don't think you can make a skill that boosts initiative only when a specific item is equipped) You could chose whether this trait is for heroes only or not.

 

Similar to the Armor Proficiency skills, it would open up so many possibilities if you could make certain weapons, accessories, items etc. only equippable/usable by those with certain skills or equipped items, or have equippable/usable items that give extra bonuses to only those who have certain skills and/or equipped items.
End of quote

Modders should already be able to link specific equipment to traits as far as I can tell. I didn't actually try it myself yet, so what follows is just how I would handle it (which may be very, very wrong)

- Make a new UnitStat with default value 0. e.g.

Code: xml
  1. <UnitStatType InternalName="UnitStat_StaffProficiency">
  2. <DisplayName>Staff Proficiency</DisplayName>
  3. <Description>Can this unit use special staves?</Description>
  4. <Hidden>1</Hidden>
  5. <DefaultValue>0.0</DefaultValue>
  6. </UnitStatType>

- Then make a unit trait that grants 1 Staff Proficiency. e.g. 

Code: xml
  1. <AbilityBonus InternalName="StaffProficiencyAbility">
  2. <AbilityBonusType>Unit_Design</AbilityBonusType>
  3. <AbilityBonusOption InternalName="StaffProficiency">
  4. <DisplayName>Staff Proficiency</DisplayName>
  5. <Description>Allows the unit to use staves without Initiative penalty</Description>
  6. <Icon>???.png</Icon>
  7. <GameModifier>
  8. <ModType>Unit</ModType>
  9. <Attribute>AdjustUnitStat</Attribute>
  10. <StrVal>UnitStat_StaffProficiency</StrVal>
  11. <Value>1</Value>
  12. <Provides>Allows the unit to use staves without Initiative penalty</Provides>
  13. </GameModifier>
  14. <AdditionalTrainingTurns>5</AdditionalTrainingTurns>
  15. <Type>Offensive</Type>
  16. <SupportedUnitModelType>AmarianFemale</SupportedUnitModelType>
  17. <SupportedUnitModelType>AmarianMale</SupportedUnitModelType>
  18. <SupportedUnitModelType>Banshee</SupportedUnitModelType>
  19. <SupportedUnitModelType>EmpireFemale</SupportedUnitModelType>
  20. <SupportedUnitModelType>EmpireMale</SupportedUnitModelType>
  21. <SupportedUnitModelType>FallenFemale</SupportedUnitModelType>
  22. <SupportedUnitModelType>FallenMale</SupportedUnitModelType>
  23. <SupportedUnitModelType>IroneerFemale</SupportedUnitModelType>
  24. <SupportedUnitModelType>IroneerMale</SupportedUnitModelType>
  25. <SupportedUnitModelType>KingdomFemale</SupportedUnitModelType>
  26. <SupportedUnitModelType>KingdomMale</SupportedUnitModelType>
  27. <SupportedUnitModelType>MancerFemale</SupportedUnitModelType>
  28. <SupportedUnitModelType>MancerMale</SupportedUnitModelType>
  29. <SupportedUnitModelType>QuendarFemale</SupportedUnitModelType>
  30. <SupportedUnitModelType>QuendarMale</SupportedUnitModelType>
  31. <SupportedUnitModelType>Skeleton</SupportedUnitModelType>
  32. <SupportedUnitModelType>SlaveMale</SupportedUnitModelType>
  33. <SupportedUnitModelType>TarthanFemale</SupportedUnitModelType>
  34. <SupportedUnitModelType>TarthanMale</SupportedUnitModelType>
  35. <SupportedUnitModelType>UrxenFemale</SupportedUnitModelType>
  36. <SupportedUnitModelType>UrxenMale</SupportedUnitModelType>
  37. <SupportedUnitModelType>WraithFemale</SupportedUnitModelType>
  38. <SupportedUnitModelType>WraithMale</SupportedUnitModelType>
  39. <AIData AIPersonality="AI_General">
  40. <AIPriority>5</AIPriority>
  41. </AIData>
  42. </AbilityBonusOption>

- And finally make your staves without initiative penalty and make them have 1 Staff Proficiency as Prereq (change the internalname). e.g.

Code: xml
  1. <GameItemType InternalName="Staff_Incineration2">
  2. <DisplayName>Incineration Staff</DisplayName>
  3. <Description>A jet of fire can be coaxed from the embers that eternally burn on the tip of this staff.</Description>
  4. <Type>Weapon</Type>
  5. <Type>Defense</Type>
  6. <WeaponType>Staff</WeaponType>
  7. <WeaponUpgradeType>FireStaff</WeaponUpgradeType>
  8. <CanBeEquipped>1</CanBeEquipped>
  9. <AdditionalTrainingTurns>24</AdditionalTrainingTurns>
  10. <CustomizationPointCost>1</CustomizationPointCost>
  11. <ShopValue>150</ShopValue>
  12. <ProductionRequirement>
  13. <Type>Resource</Type>
  14. <Attribute>RefinedCrystal</Attribute>
  15. <Value>3</Value>
  16. </ProductionRequirement>
  17. <GameModifier>
  18. <ModType>Unit</ModType>
  19. <Attribute>AdjustUnitStat</Attribute>
  20. <StrVal>UnitStat_Attack_Fire</StrVal>
  21. <Value>6</Value>
  22. </GameModifier>
  23. <GameModifier>
  24. <GameModifier>
  25. <ModType>Unit</ModType>
  26. <Attribute>UnlockRangedAction</Attribute>
  27. <StrVal>BowAttack_Flaming</StrVal>
  28. <Provides>Ranged attack</Provides>
  29. </GameModifier>
  30. <IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>
  31. <Likelihood>200</Likelihood>
  32. <RarityDisplay>Uncommon</RarityDisplay>
  33. <TacticalRange>20</TacticalRange>
  34. <Prereq>
  35. <Type>RestrictedAbilityBonusOption</Type>
  36. <Attribute>NoRangedWeapons</Attribute>
  37. <Target>Player</Target>
  38. </Prereq>
  39. <Prereq>
  40. <Type>Tech</Type>
  41. <Attribute>Enchantment</Attribute>
  42. </Prereq>
  43. <Prereq>
  44. <Type>UnitStat</Type>
  45. <Attribute>UnitStat_StaffProficiency</Attribute>
  46. <Value>1</Value>
  47. </Prereq>
  48. <AIData AIPersonality="AI_General">
  49. <AIPrefType>AIPrefType_BLUNT</AIPrefType>
  50. <AIPriority>60</AIPriority>
  51. </AIData>
  52. <ArtDef>Staff_Incineration_ArtDef</ArtDef>
  53. <GameItemTypeArtDef InternalName="Staff_Incineration_ArtDef">
  54. <GameItemTypeModelPack InternalName="Staff_Incineration_Default">
  55. <IconFile>W_Staff_Incineration_Icon_01.png</IconFile>
  56. <TintR>0</TintR>
  57. <TintG>0</TintG>
  58. <TintB>0</TintB>
  59. <AttackSFX>Hit_FireStaff_01</AttackSFX>
  60. <AttackSFX>Hit_FireStaff_02</AttackSFX>
  61. <AttackSFX>Hit_FireStaff_03</AttackSFX>
  62. <EquipSFX>Equip_WoodenItem_01</EquipSFX>
  63. <EquipSFX>Equip_WoodenItem_02</EquipSFX>
  64. <EquipSFX>Equip_WoodenItem_03</EquipSFX>
  65. <OnHitParticleName>Staff_Attack</OnHitParticleName>
  66. <SoundPack>SoundPack_Staff_Fire</SoundPack>
  67. <SupportedUnitModelType>AmarianFemale</SupportedUnitModelType>
  68. <SupportedUnitModelType>AmarianMale</SupportedUnitModelType>
  69. <SupportedUnitModelType>Banshee</SupportedUnitModelType>
  70. <SupportedUnitModelType>DarklingMale</SupportedUnitModelType>
  71. <SupportedUnitModelType>EmpireFemale</SupportedUnitModelType>
  72. <SupportedUnitModelType>EmpireMale</SupportedUnitModelType>
  73. <SupportedUnitModelType>FallenFemale</SupportedUnitModelType>
  74. <SupportedUnitModelType>FallenMale</SupportedUnitModelType>
  75. <SupportedUnitModelType>HenchmanMale</SupportedUnitModelType>
  76. <SupportedUnitModelType>IroneerFemale</SupportedUnitModelType>
  77. <SupportedUnitModelType>IroneerMale</SupportedUnitModelType>
  78. <SupportedUnitModelType>KingdomFemale</SupportedUnitModelType>
  79. <SupportedUnitModelType>KingdomMale</SupportedUnitModelType>
  80. <SupportedUnitModelType>MancerFemale</SupportedUnitModelType>
  81. <SupportedUnitModelType>MancerMale</SupportedUnitModelType>
  82. <SupportedUnitModelType>QuendarFemale</SupportedUnitModelType>
  83. <SupportedUnitModelType>QuendarMale</SupportedUnitModelType>
  84. <SupportedUnitModelType>Skeleton</SupportedUnitModelType>
  85. <SupportedUnitModelType>SlaveMale</SupportedUnitModelType>
  86. <SupportedUnitModelType>TarthanFemale</SupportedUnitModelType>
  87. <SupportedUnitModelType>TarthanMale</SupportedUnitModelType>
  88. <SupportedUnitModelType>UrxenFemale</SupportedUnitModelType>
  89. <SupportedUnitModelType>UrxenMale</SupportedUnitModelType>
  90. <SupportedUnitModelType>WraithFemale</SupportedUnitModelType>
  91. <SupportedUnitModelType>WraithMale</SupportedUnitModelType>
  92. <GameItemTypeModel>
  93. <ModelFile>gfx/hkb/weapons/w_banishing_staff_mesh_02.hkb</ModelFile>
  94. <Texture_All>W_Club_Texture_01.png</Texture_All>
  95. <Attachment>hand_right_Lcf</Attachment>
  96. <Color_Metal>151, 39,39</Color_Metal>
  97. <EffectAttachment>
  98. <Attachment>Effect_Loc_04</Attachment>
  99. <EffectName>A_IncinerationStaff_Particle</EffectName>
  100. <EffectPosition>0,0,-5</EffectPosition>
  101. <EffectRotation>0,0,0</EffectRotation>
  102. <EffectScale>0.25</EffectScale>
  103. </EffectAttachment>
  104. </GameItemTypeModel>
  105. </GameItemTypeModelPack>
  106. </GameItemTypeArtDef>
  107. </GameItemType>

Reply #2 Top

Oh, okay, so you can use unitstats in that way.  Well, that's handy to know, thanks a lot for that. =)

Reply #4 Top

Quoting StevenAus, reply 3

Can you have prereqs for using a usable item?
End of StevenAus's quote

I don't think any of the current usables has a prereq, but they're in the files as GameItemType (same as armor and weapons), so it might be possible. I can't give a conclusive answer without testing though (and can't test it until the weekend)

Reply #7 Top

No, it doesn't appear to work, at least with Allegiance or Unitstats.  I overwrote the Salted Pork item to have a Kingdom allegiance, tested it, then instead to require Unitstat Armor Proficiency of 1 (Chain Armor Proficiency), and tested it.  Both times I used the same Empire Sov with no armor proficiency.  It still worked, it wasn't blocked, both times.

Code: xml
  1. <GameItemTypes>
  2.     <GameItemType InternalName="SaltedPork">
  3.         <DisplayName>Salted Pork</DisplayName>
  4.         <Description>A rare type of salted pork that works wonders for a weary soul.  Eat it to heal.</Description>
  5.         <ShopValue>30</ShopValue>
  6.         <GameModifier>
  7.             <ModType>Unit</ModType>
  8.             <Attribute>CurHealth</Attribute>
  9.             <Value>12</Value>
  10.             <Provides>Heals 12 Hit Points</Provides>
  11.         </GameModifier>
  12.         <Prereq>
  13.             <Type>Allegiance</Type>
  14.             <Attribute>Kingdom</Attribute>
  15.         </Prereq>
  16.         <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
  17.         <RarityDisplay>Common</RarityDisplay>
  18.         <IsUsable>1</IsUsable>
  19.         <UsableInBattle>1</UsableInBattle>
  20.         <ArtDef>SaltedPork_ArtDef</ArtDef>
  21.         <GameItemTypeArtDef InternalName="SaltedPork_ArtDef">
  22.             <GameItemTypeModelPack InternalName="SaltedPork_Default">
  23.                 <IconFile>SaltedPork_Item.png</IconFile>
  24.                 <MapParticle>T_Heal_Particle</MapParticle>
  25.                 <TintR>79</TintR>
  26.                 <TintG>48</TintG>
  27.                 <TintB>20</TintB>
  28.                 <SFX>Eating</SFX>
  29.                 <GameItemTypeModel>
  30.                 </GameItemTypeModel>
  31.             </GameItemTypeModelPack>
  32.         </GameItemTypeArtDef>
  33.     </GameItemType>
  34. </GameItemTypes>

Code: xml
  1. <GameItemTypes>
  2.     <GameItemType InternalName="SaltedPork">
  3.         <DisplayName>Salted Pork</DisplayName>
  4.         <Description>A rare type of salted pork that works wonders for a weary soul.  Eat it to heal.</Description>
  5.         <ShopValue>30</ShopValue>
  6.         <GameModifier>
  7.             <ModType>Unit</ModType>
  8.             <Attribute>CurHealth</Attribute>
  9.             <Value>12</Value>
  10.             <Provides>Heals 12 Hit Points</Provides>
  11.         </GameModifier>
  12.         <Prereq>
  13.             <Type>UnitStat</Type>
  14.             <Attribute>UnitStat_ArmorProficiency</Attribute>
  15.             <Value>1</Value>
  16.         </Prereq>
  17.         <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
  18.         <RarityDisplay>Common</RarityDisplay>
  19.         <IsUsable>1</IsUsable>
  20.         <UsableInBattle>1</UsableInBattle>
  21.         <ArtDef>SaltedPork_ArtDef</ArtDef>
  22.         <GameItemTypeArtDef InternalName="SaltedPork_ArtDef">
  23.             <GameItemTypeModelPack InternalName="SaltedPork_Default">
  24.                 <IconFile>SaltedPork_Item.png</IconFile>
  25.                 <MapParticle>T_Heal_Particle</MapParticle>
  26.                 <TintR>79</TintR>
  27.                 <TintG>48</TintG>
  28.                 <TintB>20</TintB>
  29.                 <SFX>Eating</SFX>
  30.                 <GameItemTypeModel>
  31.                 </GameItemTypeModel>
  32.             </GameItemTypeModelPack>
  33.         </GameItemTypeArtDef>
  34.     </GameItemType>
  35. </GameItemTypes>

So I hereby ask for the feature request of allowing Usable Items to be restricted to be able to be used only by champions whose side has a particular allegiance, tech, Player Skill, Global Resource (for the current player) or Unit Skill, Unit Level, or other Unit Unitstat (for the specific unit trying to use the item).

Reply #8 Top

Although you don't get a prereq, you can set up the game modifier to give health if you have armor proficiency and not give anything if you don't, sort of a wasted use type thing, but you can always use it.

Reply #9 Top

I only used Salted Pork because it was a starting item at shops and it was easy to test.  What I would like is stated at the start of the OP, and includes things like expendable Tomes or other one-use bonus items.  I suppose it would be even nicer if we could control the number of a particular item that can be bought by any player (or sold from a particular player shop), but I thought it was more realistic to allow prereq tags to also restrict use of one-use items, like they already do for equippable items.  That is my feature request, stated in the "EDIT:" part of the OP, and summarised in the thread title.

Reply #10 Top

again, like a global resource, there could be an on/off option for an item to use up a certain amount of a certain unitstat, to restrict the number of uses of the item for any unit does not have sufficient unitstat of a certain kind, or has used it all up
End of quote

I'm pretty sure UnitStats can drop to values below 0 (the game will treat and display them as 0, but will still subtract any value it's told to) e.g.: I had units with -24 defense in one of my custom factions. So if you want to make an item that removes X from a certain UnitStat, it will not become unusable once the UnitStat drops below X.

Reply #11 Top

The game would have to provide a check like is available for Quest/Event Dialog options that require enough Gildar/other resource etc. for this to work.  I hope if they do implement the suggestion in the OP of this thread that you can set a requirement so that when taking it away the number resulting is no less than zero.

Although it might be already possible to do this, not sure.

Reply #12 Top

You can make equippable items unusable if you give them a GameItemTypeArtDef whose GameItemTypeModelPack doesn't specify the undesirably type of unit's unittype in a SupportedUnitModelType node.  So you could, e.g. make an item that is not useable by Wraith units by not including 

Code: xml
  1. <SupportedUnitModelType>WraithFemale</SupportedUnitModelType>
  2. <SupportedUnitModelType>WraithMale</SupportedUnitModelType>

Depending on what you're looking for, this may or may not be good enough.