Aller au contenu

Photo

Cleaning up the ground of all items


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

A thought occurred to me about the damn mess all over when you drop junk in NWN2. Is there not a way to detect if an item is on the ground (or the "area" is the container as opposed to a creature) and then delete it?

 

If there is a particular function that checks this status, I'd like to know. Then I can run an area script every few minutes that deletes such items left on the ground. 



#2
Tchos

Tchos
  • Members
  • 5 063 messages

Check the encounter scripts from SoZ.  They delete ground items.



#3
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

Would that be one of the encounter areas, and then in the on_Exit area slot?



#4
Tchos

Tchos
  • Members
  • 5 063 messages

Sounds right to me.  It's been a while since I looked through them, but that's a logical place.  Either that or in the conversation that fires when you leave the area.



#5
Dann-J

Dann-J
  • Members
  • 3 161 messages

The SoZ encounter area OnExit clean-up script gets rid of items dropped on the ground, loot bags / corpses, any remaining creatures, and persistent AOEs (delayed fireball, glyph of warding, etc).

 

I've adapted it even further, so that it checks whether you've dropped any items with the plot flag set to TRUE (you don't want to be destroying those!). My script also checks the value of items, and anything worth at least 50 gp gets sent to a garbage pile on the outskirts of a town (which is where plot items end up as well). That way you can be lazy and let the script sort out the valuable items for you.

 

The one problem I encountered is that GetGoldPieceValue() doesn't return the correct value for unidentified items. I therefore have to identify things before seeing what they're worth. I've had no luck setting the copied items to be unidentified again.

 

 

EDIT: I've since decided that any unidentified item automatically gets sent to the garbage pile, regardless of its worth. That avoids the unidentifying problem, and stops players from simply dropping unidentified items while in an encounter area and getting them identified for free. I may randomly send some of the items (and perhaps uncollected gold) to various stores as well.