How difficult is it to create an upgradable weapon?
![Tome](https://forums.beamdog.com/uploads/userpics/185/n6R0D2G4RW3JE.jpg)
in BGII:EE Mods
Hey guys, I've been toying with the idea of having a 'signature' weapon for my Bhaalspawn this time round that grows with him as the game progresses. I managed the acquisition simply enough in BG:EE, just adding it to the inventory of the Demon Knight at the end of Durlag's Tower and should be able to add it easily to Irenicus' dungeon, so re-acquisition isn't a huge concern for me. However, I have no experience with item upgrades at all and was wondering if it was hard to learn. For context, I'm a pretty terrible modder: I can make functional items using DLTCEP with ease and have made a few kit mods for pre 2.0 that haven't been brought up to date and that is essentially the end of my abilities. I can't use WEIDU at all.
Worst case scenario I can just tweak the item as I go along using DLTCEP, but I'd rather keep it 'immersive' if at all possible so I don't need to enable the console. Thanks for any advice you can offer!
Worst case scenario I can just tweak the item as I go along using DLTCEP, but I'd rather keep it 'immersive' if at all possible so I don't need to enable the console. Thanks for any advice you can offer!
![:smile: :smile:](https://forums.beamdog.com/resources/emoji/smile.png)
0
Comments
Since you're using the awesomely powerful DLTCEP:
- Create a complete set of weapons beforehand, one separate item file for each progressive incarnation of it. Make sure to label them in a way that makes it easy for you to figure out which one is which.
- In the Extended Effects tab, add an ability to spawn the next item in the series to each variant except the final one. If you want, make this ability expend the existing weapon. One way to achieve this is to make the upgrade ability consume 1 charge and give the item a 1 charge maximum. This should link your items in a upgrade chain, such that allows you to replace your weapon with the next one at will.
Should be easy as that.I may be wrong though, as I don't have a BG2EE installation to check if it'd work like I remember it should.
However, know that you already are able to pull off a functional extra component mechanic with the very same method you just learned. Let me show you how.
Design a set of dedicated crafting items, one per upgrade, to be sacrificed in the upgrade process, or repurpose some already existing items if that's what you'd prefer. Once you have your crafting items nice and ready, instead of assigning a charged ability to the weapon itself, assign one to the extra component, such that will spawn your upgraded weapon as well as remove the previous one. For that purpose, you need to use two opcodes, the item creation opcode you already used, and a similar one that removes a referenced item (the old unwanted weapon) from the inventory. Ensure that both are placed under the same header, as you don't want two separate abilities on a 1 charge item, but rather one ability with two simultaneous effects. As a result, you will be able to use the extra component to upgrade the weapon. Once you have verified that the upgrades are working correctly in-game, simply place your items wherever you'd like to 'earn' them
Note that since there are no actual item checks present, the previous weapon is not explicitly required to create the upgraded variant. One could prevent the weapon from being removed just by dropping it, but I trust you can refrain from exploiting this.
Dialogues are a proper, exploit-proof way to implement a crafting system, but delving into that would be an overkill I think.