Daeros_Trollkiller Posted June 6, 2020 Share Posted June 6, 2020 Heya folks, I was wondering if anyone has ever done any work with opcode 122 - create inventory item? Specifically, what I want to do is modify an existing item with charges to create scrolls for a new spell for one of my mods. I figure that after I "copy existing" for the item, that it would start with: LPF ADD_ITEM_EFFECT INT_VAR opcode = 122, but I'm not sure what would come next. If anyone has any pointers, I'd appreciate it! Quote Link to comment
Jarno Mikkola Posted June 6, 2020 Share Posted June 6, 2020 (edited) If you copy existing, you first should delete... then add... and you should have the item already ready, in this code it's custitem.itm, as you can then just add it via: LPF ADD_ITEM_EFFECT INT_VAR opcode = 122 STR_VAR resource=custitem END PS: the item name can only feature 8 characters +.itm ... and you might need to customize other features, like the effect duration etc. with the other INT_VAR -variables. Edited June 6, 2020 by Jarno Mikkola Quote Link to comment
Daeros_Trollkiller Posted June 9, 2020 Author Share Posted June 9, 2020 On 6/6/2020 at 1:14 AM, Jarno Mikkola said: If you copy existing, you first should delete... then add... and you should have the item already ready, in this code it's custitem.itm, as you can then just add it via: LPF ADD_ITEM_EFFECT INT_VAR opcode = 122 STR_VAR resource=custitem END PS: the item name can only feature 8 characters +.itm ... and you might need to customize other features, like the effect duration etc. with the other INT_VAR -variables. I've been working with this, and researching the existing documentation, but so far no success. To be clear, here is what I am trying to do: I want to add a new item ability (magical) to the existing item Robe of Vecna. Within that new ability, I want to have an effect using opcode 122 to create the new scroll in a character's inventory. The robe doesn't currently have the ability at all, so I am looking for any examples of how to do this from scratch. Quote Link to comment
subtledoctor Posted June 9, 2020 Share Posted June 9, 2020 An item ability needs a header to contain the effect, not just an effect. Weidu can create new headers, but it's probably more trouble than it's worth. Do you use Near Infinity? If so, open an item with an ability - the ring of energy or necklace of missiles, or something. Scroll to the bottom, and right-click and copy the ability header. Then open the Robe, scroll to the bottom of the window, and right-click to paste the ability header there. Open the ability header, change the icon to whatever it should be, change the first effects to 122 and whatever else you need, and delete any unneeded effects. Save it, close it, put the modified Robe file into your mod folder, and copy it in during installation. Quote Link to comment
Daeros_Trollkiller Posted June 9, 2020 Author Share Posted June 9, 2020 3 hours ago, subtledoctor said: An item ability needs a header to contain the effect, not just an effect. Weidu can create new headers, but it's probably more trouble than it's worth. Do you use Near Infinity? If so, open an item with an ability - the ring of energy or necklace of missiles, or something. Scroll to the bottom, and right-click and copy the ability header. Then open the Robe, scroll to the bottom of the window, and right-click to paste the ability header there. Open the ability header, change the icon to whatever it should be, change the first effects to 122 and whatever else you need, and delete any unneeded effects. Save it, close it, put the modified Robe file into your mod folder, and copy it in during installation. I had a feeling it was going to be a tricky one to do in WeiDu. I am very familiar with NI and can use it to accomplish what I am trying to do no problem, but my goal was to try to do it using WeiDu, copying existing, to keep it compatible with other mods, etc... If it's more trouble than it's worth, I do have a plan B, so no worries at all. Juice probably isn't worth the squeeze on this one. Quote Link to comment
subtledoctor Posted June 9, 2020 Share Posted June 9, 2020 Maybe look around over here, someone might have made an ADD_ITEM_HEADER function. If anyone's done it, my money would be on @Ardanis. Ah, right, we used an "ADD_NEW_EMPTY_SPELL_HEADER" function here, you could probably adapt that to item headers... but it's not for the faint of heart. Quote Link to comment
Ardanis Posted June 10, 2020 Share Posted June 10, 2020 ADD_ITEM_HEADER https://github.com/Gibberlings3/ItemRevisions/blob/master/item_rev/lib/macros.tpa Maybe check WeiDu readme/history, I won't be surprised if it's been included, or there's a similar function. Quote Link to comment
Daeros_Trollkiller Posted June 17, 2020 Author Share Posted June 17, 2020 Thank you very much! I will check into this and see if I can get it working the way I want it to. Quote Link to comment
Daeros_Trollkiller Posted July 1, 2020 Author Share Posted July 1, 2020 Just wanted to thank Ardanis and all who responded to this. I was able to accomplish what I set out to do with your help! Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.