Aller au contenu

Photo

Default loot drops


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

#1
casadechrisso

casadechrisso
  • Members
  • 726 messages
 Could be this is Custom Content or something scripting related too, no idea...

After a long time I was playing around with encounters in my module again and noticed a bug(?) I've not seen before: Every single creature, regardless if NWN2 default or custom, default scripts or custom set, drops a Bastard Sword on death.
Of course I don't want that, but wouldn't have a clue where to start changing this behavior. Since I've worked excessively with 2das, I could imagine it's a 2da thing, but I can't remember changing any loot-related 2das. Or is loot handled by the OnDeath script? Any pointers where I should start looking would be highly appreciated. 

#2
Morbane

Morbane
  • Members
  • 1 883 messages
check the itm_rand*** 2das - is it possible you edited one of those?

then there is treas_rand** 2das....

and treasurescale 2da

those are all of the one I would think to check anyway - never had a problem with drops myself so I am not too sure about what could be wrong.

plus the default inventory for your creatures could be the source check that as well.

Modifié par Morbane, 05 février 2011 - 07:14 .


#3
casadechrisso

casadechrisso
  • Members
  • 726 messages
Hmm, no, I never touched those 2das.... weird. And as I said, it happens with standard creatures from NWN2 too, not only the ones I made. I never dropped a bastard sword into any creature's inventory.

#4
c i p h e r

c i p h e r
  • Members
  • 261 messages
It's definitely tied to OnDeath so if you modified those scripts for the creatures in question, something in the code is amiss.

#5
MasterChanger

MasterChanger
  • Members
  • 686 messages

ç i p h é r wrote...

It's definitely tied to OnDeath so if you modified those scripts for the creatures in question, something in the code is amiss.


No, I actually think it's tied to OnSpawn. Treasure is generally generated into the creature's inventory during spawn. It does some checks--like if the no-treasure flag (don't recall the exact var name right now) is set, or the creature is an animal--and then checks the treasure tables.

#6
c i p h e r

c i p h e r
  • Members
  • 261 messages
I just looked through the onspawn script (nw_c2_default9) and MC is right. Default scripts generate random treasure on spawn. A quick way to test your setup though might be to login as DM and examine creature inventory. If all your creatures have bastard swords in their inventories, the loot scripts in your mod are running on spawn.

Loot generating script appears to be x0_i0_treasure. It's pretty well documented so worth a read if you want to not only fix but fine tune treasure your drops. That is, if you're not running a custom system of your own.

Modifié par ç i p h é r, 05 février 2011 - 10:38 .


#7
casadechrisso

casadechrisso
  • Members
  • 726 messages
I do in fact run a custom system, not of my own, but it might be the cause. That said, does the OnSpawn script even create loot on hand-placed creatures? I've not used any encounters or spawn points so far. Anyway, thanks for the replies so far, it gives me an idea where to look.

#8
c i p h e r

c i p h e r
  • Members
  • 261 messages
OnSpawn should still fire whether a creature is created by hand or by script. So as long as you are using OnSpawn for loot gen, scripts attached to that event will run. But ... it would be more efficient to determine "random treasure" OnDeath so you don't have treasure just sitting in every creature's inventory needlessly consuming memory.

#9
casadechrisso

casadechrisso
  • Members
  • 726 messages
I actually intended to have baddies, at least human ones, not dropping random loot, but the stuff they actually use (or items that look like it) + maybe a small amount of random stuff like some GP etc.

Actually, I've never looked into loot creation before, it's been something way down on my to-do list. I remember in NWN1 we used loot chests with standard treasure inside that were placed in a non-accessible area and the random loot scripts drew from that. Is that still an option in NWN2?



Anyway, still not wiser with that bastard sword problem, I can't figure out what causes it. I'll look into the x0_i0_treasure thing, but it's another component I've never touched and that was never altered, so I still wonder what caused the bug in the first place.

#10
casadechrisso

casadechrisso
  • Members
  • 726 messages
Just looked at the NPCs as a DM, and all of them have a Bastard Sword in their inventory. Must be an OnSpawn thing then, because I surely didn't add those.

#11
c i p h e r

c i p h e r
  • Members
  • 261 messages
What were they dropping before?

If you read the comments at the top of the treasure generation script, it provides instructions on setting up loot chests. So it looks like it will do what you want.

#12
casadechrisso

casadechrisso
  • Members
  • 726 messages
Okay, I figured this one out. The problem was an outdated nw_c2_default9 script I used as a base to play a bit with the old ambient system... NWN2 comes with 3 versions of this script and apparently I grabbed the oldest one for my edits... deleted my edited one and no more bastard swords.



Thank you anyway for the tip with the treasure script, this will be very helpful soon.

#13
twcheney

twcheney
  • Members
  • 36 messages
I too am having a problem with bastard sword drops. I do not run custom treasure scripts. What do I need to fix? Also, all the creatures in the toolset cannot change their scripts. How do you work around this. I am trying to create a PW if this makes a difference.

#14
c i p h e r

c i p h e r
  • Members
  • 261 messages
Do you see "nw_c2_default9" in your module scripts area (usually the left hand pane)? If you do, this means you have a customized version. Try renaming that to something else and see if it fixes your problem.