Skip to content

[Question] Non-stacking item buffs

AquadrizztAquadrizzt Member Posts: 1,065
Is it possible with currently available opcodes to have a system where two items that offer the same bonus (such as +2 Cha) do not stack? As in, if you equip either item A or item B, you will gain the +2 Cha, but if you equip both, you will still only gain +2 Cha.

If so, how would one set it up?

Comments

  • argent77argent77 Member Posts: 3,431
    edited February 2016
    You could add opcode 101 (Immunity to effect) to the items. It works, but it also has the side effect that you're immune to everything else which alters charisma.
    Post edited by argent77 on
  • AquadrizztAquadrizzt Member Posts: 1,065
    Thanks @argent77. *sighs* That side effect messes up too much. Wish we had an opcode that allowed you to specify immunity to custom effects.
    Grammarsalad
  • CamDawgCamDawg Member, Developer Posts: 3,438
    I struggled with this exact problem for the PnP Protection Items component for Tweaks. I was looking for a way to wear multiple X of Protection items but only enabling the save bonuses from the strongest one. In the end I concluded there's just not a good way to do it without massive and obtrusive tradeoffs.

    With spells you have all sorts of great mechanisms to dial this in, like custom secondary types, op 321, etc. The problem with items is there's no event/trigger for unequipping items, so trying to use the same tools usually just gets you lingering effects from the items. Y
  • AquadrizztAquadrizzt Member Posts: 1,065
    @CamDawg , glad to see I'm not alone in this regard. Many great ideas have come and gone because of the lack of an unequip trigger (for example, there are some items in Pillars of Eternity that add spells to your spellbook while they are equipped) and the inability to prevent effect stacking (for, say, a totally hypothetical attempt at emulating 5e style advantage/disadvantage).
  • kjeronkjeron Member Posts: 2,367

    (for example, there are some items in Pillars of Eternity that add spells to your spellbook while they are equipped)

    This can be done, but just like increasing spell slots, its not viable on weapons or anything you plan to switch out often. And if you already knew the spell, you would still lose it upon unequipping said item.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    edited February 2016

    Wait what? How does it know to remove the spell when the item is unequipped? Does opcode 171 work as a passive bonus when duration is set to "while equipped"...? Or is it some other method like having a script check every few seconds?

    Nevermind - the spells are lost if you save/reload.
    It involved using the Seven Eyes opcode, while equipped. The special abilities that it adds can be priest/wizard spells as well, and it is hardcoded to remove the ability it grants when its effect expires/unequipped. I guess somewhere in the loading process it isn't maintained. Sorry.

    Edit - this might be a bug. Innate spells are not lost 'while equipped' after a reload, and the wizard/priest spells remain known after a reload, its just their memorization's that are lost.
    Post edited by kjeron on
Sign In or Register to comment.