Rimmilin1
Recruit
MadVader said:Use capitalization and punctuation, this is not a chat.
It is easy to implement skill-modifying items (like the 3 books), see script_game_get_skill_modifier_for_troop.
Changing attributes like STR is more difficult.
You need both to increase STR when the item is equipped or gets in inventory, and remove the STR bonus when it's unequiped or get sold or lost. Nothing too easy about it.
I did something like this in a mod. I defined an item slot to tell me if the item bonus is active or not (0/1). Then wrote a trigger that checked for all such attribute-changing items, if they are equipped or in inventory (depending on the item).
For example, we had a ring that gave you STR+1 when in inventory. The trigger code checks two things:
- if the ring is in inventory and its bonus is not applied (item slot = 0), increase player STR by 1 and set item slot = 1; the ring was just obtained
- if the ring is not in inventory and its bonus is applied (item slot = 1), decrease player STR by 1 and set item slot = 0; the ring was lost
More complicated conditions like dependencies between items are easy to do, it's just few more lines of code.
hrrrn yeah? so I need to define an item that always has the stat bonus triggered but is turned off if the item is not found within the inventory? is that what you are saying? ok well enough I understand.
You say for dependencies it requires a few more lines of code? how would this look like for example? do i simply define the item slots as normal but when i have tier branch item slots i tell it to turn item_slot## = 0 while its turned to = 1. but what does that code look like? should i just google tutorials for triggers is that covered in them?
thanks for the assistance.