Jump to content

Anyone familliar with opcode 122? (create inventory item)


Recommended Posts

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!

Link to comment

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 by Jarno Mikkola
Link to comment
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.

Link to comment

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.

Link to comment
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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...