Jump to content

Issues with ADD_ITEM_EFFECT


Skye

Recommended Posts

OK, checking it out: the t-add_spl_itm_header function at that link is broken, and doesn't calculate offsets correctly. Try this as a demonstration:

CREATE itm dwtest
	LPF t-add_spl_itm_header INT_VAR t-atk_type = 3 END
	//LPF ADD_ITEM_EFFECT END

If you look at the file in Near Infinity, you'll see that the first effect index in the new ability header is 114 rather than zero. If you uncomment the ADD_ITEM_EFFECT line you'll get an install-time error.

Link to comment
3 hours ago, subtledoctor said:

I don’t know that function but it looks like “t-atk_type = 3” is the header type.

I vaguely recall having similar(ish) problems when CREATE’ing a spell from scratch, and using Ardanis’ ADD_SPELL_HEADER function, and then adding effects with ADD_SPELL_EFFECT.  Something about the header or extended header index not being updated agead of the new effects being inserted.

The gist of it was, doing it all within a single COPY command led to problems. Try adding the header and the stopping; and then COPYing the item again and adding the new effects.

Yeah, I noticed that. Saving the item after the new header was created, closing, and then running the add_item_effect macros worked, but not in the same WeiDU instance, either because of the issue David mentions below, or because COPY_EXISTING doesn't get updated for the same resource in the same WEIDU instance (or maybe both?).

2 hours ago, DavidW said:

OK, checking it out: the t-add_spl_itm_header function at that link is broken, and doesn't calculate offsets correctly. Try this as a demonstration:

CREATE itm dwtest
	LPF t-add_spl_itm_header INT_VAR t-atk_type = 3 END
	//LPF ADD_ITEM_EFFECT END

If you look at the file in Near Infinity, you'll see that the first effect index in the new ability header is 114 rather than zero. If you uncomment the ADD_ITEM_EFFECT line you'll get an install-time error.

Thank you, that might be it. Can't run it now since I'm at work. Will Ardanis' macro that subtledoctor linked do a proper offset calculation? Will my code work as is if I just change one header macro for the other or is there something else screwed up?

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...