Stack size and variables.
ReachPW
Member Posts: 27
I think variables are getting wiped from items when they become part of a stack.
I make two arrows (non-stacked) and set a local int, say "TEST" to 1.
The first arrow I pick up has this set (in mod acquire event). But the second arrow doesn't and stack size is two.
It looks like when an item becomes part of a stack all the local variables are lost. Is this true and is there any work around for this?
I can provide full example code if needed, but it's really simple
on acquire event:
First arrow is always 1, but everything after is 0
I make two arrows (non-stacked) and set a local int, say "TEST" to 1.
The first arrow I pick up has this set (in mod acquire event). But the second arrow doesn't and stack size is two.
It looks like when an item becomes part of a stack all the local variables are lost. Is this true and is there any work around for this?
I can provide full example code if needed, but it's really simple
on acquire event:
object oItem = GetModuleItemAcquired(); int nTest = GetLocalInt(oItem, "TEST"); FloatingTextStringOnCreature(IntToString(nTest), oPlayer, FALSE);
First arrow is always 1, but everything after is 0
0
Comments
With NWNX, there is a tweak that will prevent merging of stacks that have different variables:
https://nwnxee.github.io/unified/group__tweaks.html
(NWNX_TWEAKS_COMPARE_VARIABLES_WHEN_MERGING)