logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Vanishing Objects...

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Oct 19, 2008 8:57    Post subject: Vanishing Objects... Reply with quote

I'm not sure where this is occurring NWNX or NWN1 (assuming the former - even against the evidence)

I'm using RCO to fetch objects from the database, and load them into a store object.
During the 'OnSpawn' of an NPC, I create a store and load it.
The objects are created in/for the store and an inventory scan can find them all. However when I go to Open the store - all but one (not the 1st, or last) is missing from the store. (I can even get multiple copies of remaining item, but I can't seem to find 'when' the others are disappearing.)

Just wondering if anyone has come across this type of behavior.

o OBJECT: 1346 bytes
‡ -> worth100 [worth100]
o OBJECT: 1340 bytes
‡ -> worth7 [worth7]

key
o = NWNX Log entry
‡ -> = GetName(obj) + GetTag(obj) from in game

Cheers
Gryphyn
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Mon Oct 20, 2008 3:37    Post subject: Reply with quote

Got it...a side-effect.

I was reassigning the #charges to the items I was fetching.
There is no sanity check on SetItemCharges(0) to only effect items that have a 'charges' property. So setting charges=0 on any item, effectively destroys the item (which occurs after the script completes)

Now that I'm only reapplying charges > 0, all my items are back.

Only one thing left to say

Doh!

Cheers
Gryphyn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group