Page 1 of 1
Skill Requirements for Items
Posted: Sun Feb 22, 2015 8:59 am
by David Ward
How should I go about making new skill requirements for items?
Right now, the "Armor" skill has the effect of reducing evasion if the light armor and heavy armor traits, which are acquired by having 2 and 4 on the Armor skill respectively. Is there a way to change this to make it so that there could be, say, reduced protection from the armor if the character does not have Armor skill 1, or 2, or 3, 4, all the way up to 5?
Would it be better to just make a completely new skill that ties into armor-based items, with new traits to go with that?
Re: Skill Requirements for Items
Posted: Sun Feb 22, 2015 9:16 am
by minmay
Sure. Just use the onRecomputeStats() hook of your skill to modify protection/evasion/etc depending on equipped items.
Re: Skill Requirements for Items
Posted: Sun Feb 22, 2015 5:16 pm
by David Ward
Seems simple, but not so easy to put into code. Will do some mucking around with onRecomputeStats() then.
Re: Skill Requirements for Items
Posted: Sun Feb 22, 2015 8:02 pm
by David Ward
So here's the thing, minmay.
I made a piece of armor and added in the following:
requirements = { "armors", 3 },
When I load the game in the editor for testing, this warning appears:
warning! invalid component property equipmentitem.requirements
No skill requirements appear on the item's stat sheet in the inventory, and no skill requirement is applied (i.e. I can equip the piece of armor and get its protection bonuses even if the character equipping it doesn't meet the intended skill requirements).
What would be your best suggestion on how to fix that?
Re: Skill Requirements for Items
Posted: Sun Feb 22, 2015 8:11 pm
by minmay
EquipmentItemComponent does not have a requirements field. ItemActionComponents and UsableItemComponents do.
David Ward wrote:No skill requirements appear on the item's stat sheet in the inventory, and no skill requirement is applied (i.e. I can equip the piece of armor and get its protection bonuses even if the character equipping it doesn't meet the intended skill requirements).
If you want to prevent the player from getting EquipmentItemComponent bonuses if they do not meet the requirements, you have to add a RunePanelComponent and place your requirements there; it is the only ItemActionComponent that prevents EquipmentItemComponent from conferring bonuses. See
this post.
Re: Skill Requirements for Items
Posted: Sun Feb 22, 2015 10:04 pm
by David Ward
Thank you very much, minmay.