Need help/treasure respawn script

God damn it so it used to work before i don’t know what’s going on im using ivalace’s treasure respawn/random script so when my corpses respawn they become unclickable… I don’t understand my source chests are hidden in the same map and the loot works unti lthey respawn unclickable im lost :frowning: help

Som1 help!!!

^^

Could you link the system you’re using, and explain how exactly you set it up - and what you’d like to be happening that isn’t happening? Corpses respawning sounds a little odd to begin with.

https://neverwintervault.org/project/nwn1/script/simple-treasure-system sure thing thisi s what im using and i set it up like in the demo/like it should work by using corpses containers instead of chests… And the loot generation works and selects from source chests it’s when they’re supposed to respawn that they are unclickable/unlooteable corpses that are just pointless, I’m lost ;(

Guys they respawn now ((By using low chest container corpses instead of my own custom)) :)!!! All day i struggled, now the issue is that the loot is not generated anymore after they respawn, it uses default cep low treasure thingy but ill find a way

Did any body notice how to help me? Now they respawn but with no loot then disappear completly god i suck lol

It might be that no one here is using that package - if so, a more specific question might help.

It sounds like you’re tweaking scripts somehow. Most of the problems you describe can be fixed by using SetIsDestroyable correctly.

If you’re using Extended Edition, I heard there was a specific bug with lootable corpses, which is fixed in the latest development release.

Hello i think i know my issue, perhaps i don’t know where to set up the T1 String variable? Does it need to be in the same area as the looteable chest? Or on the area variables of the source chests? Im a bit confused? Or does it need to be inside every source chest as variable? Im using nwn ee and dev branch but they still disappear…

Alright so i’m begging for help i spent 3 days nonstop trying to get this to work as it prevents me from development of my world :frowning: I think random loot that respawns is essential to every adventurer… I need treasures that are random generated and respawn every 10 minutes like my enemy triggers, so i can move on in my development, help^please!

unfortunately there are too many interacting parts for peeps to say what’s wrong.

i can suggest how to debug problems generally: Get familiar with “events” – module events, creature events, placeable events, etc.

In the toolset, events have scripts. For example, each creature has an OnSpawn event that fires a script like ‘nw_c2_default9’. That script can generate treasure, etc. But other events/scripts could also be responsible for generating treasure …

Basically, an event needs to fire a script that calls a function that generates treasure.

 
 
The only person who really knows what is supposed to generate treasure ( or do respawns every 10 min ) is the person designing and building the module – that’s why you’re the best person to debug the issue  :)

Investigated problem. ::wearing detective hat::

  • There are no variables set on any of the areas in the demo module
  • There are no variables set on the module
  • There are variables set on the placeables in the module (int nGold, int nLoot, int nRespawn, string sLoot)
  • The placeables have scripts making use of the OnOpen (treas_onopen), OnClosed (treas_onclosed), and OnDeath (treas_onopen) events of the placeables.
  • The documentation describes floats to be set on the module (fTreasRespawn and fTreasClear), but they are not set by default.

By default, the demo module does not display the behaviour @toupzykin is describing. Opened chests do not despawn until the fRespawn float is set on the module (or maybe I just wasn’t waiting long enough, also possible).

The OnClosed script, treas_onclosed, suggest that it should be handling the respawning, but there is no code in that script that involves anything about triggering a respawn; only a line for destroying the closed placeable if nRespawn is zero on it.

Instead, the respawning appears to be done in the OnOpen script.

Investigating the code for respawning the placeable led to finding the culprit to blame for lack of placeable respawn in the original demo module setup: The placeables did not respawn because no blueprints for them existed. Adding them to the palette now allows them to respawn.

This makes my suspect for what’s wrong here that the respawned placeable containers are unclickable because the blueprints the new placeable is created from are set to unusable.

@toupzykin
Try this:
Open the properties window for the placeable blueprint in the palette, and check that Useable is ticked active. Do not confuse this with the properties of the placeable currently placed in the area; if the placeable in the area is set to Useable, but the blueprint used for respawning it is not, then the original placeable would be usable, and the new placeable spawned in on respawn would not, leading to the exact situation you’ve described.

Fingers crossed.

Wow first of all thanks so much for the detailed reply and investigation i will try as soon as i can :slight_smile: and let you know good llad

1 Like

Good news it doesnt disappear and does respawn physicly but when i click it after the timer: sLoot:T1 instead of saying T1junk so either i suck with setting up variables or do it the wrong way… I will study more i can’t give up im testing endlessly

If the first problem was that the blueprint differs from the original, I’d suspect that this is the case here again. Have you checked whether the variables set on the blueprint match the variables set on the original placeable?

If not, try deleting the current blueprint, and then right-click the placeable container and hit “Add to Palette” to create a new blueprint from the original. Then, the new blueprint will be identical to the original.

IIRC there was an explanation of the formula used to find the matching loot chest at the top of the OnOpen script.

IT WORKS IM SO HAPPY thanks so much!!!

1 Like