[NWN] Respawning stuff

Morrus

Well, that was fun
Staff member
It's probably obvious, but I can't figure it out.

1) How do you set a specific monster/NPC t respawn (as oppposed to an encounter generated by the computer).

2) How do you set treasure (including locks and traps on chests) to reset/respawn?

I left my module going for a few hours, came back and found it was empty. People had killed all the NPCs (goodness only knows why...), all the treasure was gone, and the specifically placed monsters were all gone. The only thing left were the few random encounters I had placed.

And why is EVERYONE level 15+?!? Cheapens the whole game in my eyes. Not exactly much challenge in advancing there.
 

log in or register to remove this ad

I'm not sure if there's a way to respawn treasure and specific encounters by just clicking a button. My gut instinct would be to create a script that checks to see if the treasure has been taken (or guy killed) and respawn if necessary. You could put this on the "OnHeartbeat" event of the area, which is called every 6 seconds, if I recall correctly.

That said, I haven't had time at all this weekend to work on NWN. But I did have time to go miniature golfing, make two dinners, and tomorrow I'm going strawberry picking. So someone else probably would know better than me - my goal tomorrow night/monday is to play with making dungeons some more.

NPCs can be set so that they can't be killed. I forget the specific option, but if you open up the NPC's properties, I believe there's an option on the Advanced tab.

And why is everyone level 15+? I could write a whole treatise on the subject, but pretty much people see this as a game like Diablo II, and not as a means for role-playing. Which is unfortunate.

There's two ways to combat this. First, you could require characters to be stored server-side - that is to say, on your computer. Takes up space, but guarantees characters that are the way you want them. Second, you could set a level limit on your server - restrict it to people between levels 1-6, for instance. I haven't tinkered with the DM program yet, so I couldn't tell you much about how that would be done.
 

LightPhoenix said:
my goal tomorrow night/monday is to play with making dungeons some more.

Heh, that's my favorite part of the game. I haven't actually played the single player game since last Saturday. I spend all my free time just playing with the toolset. Getting close to finishing my first mod. Just three more areas to go. Then I need to go back and tighten up some of the story/npc aspects.

But to get back on topic...

Morrus,

I'm not sure how to set specifically placed NPCs to respawn, but I reckon it must be able to be done somehow. As for why people kill all your merchants and stuff..., well, that's just the world we live in I guess. It's NWN vandalism. ;-)
 
Last edited:

LightPhoenix said:
You could put this on the "OnHeartbeat" event of the area, which is called every 6 seconds, if I recall correctly.

How do you know that sort of stuff? I'm not doubting you in the slightest, but myself have abosultely no idea what a script called "ON_xhgrunf_rkjnf" does (OK, I'm exaggerating - but none of this info is in the manual).
 

Morrus said:


How do you know that sort of stuff? I'm not doubting you in the slightest, but myself have abosultely no idea what a script called "ON_xhgrunf_rkjnf" does (OK, I'm exaggerating - but none of this info is in the manual).

Well, for one thing, I've done basic coding in the past, with a number of different languages and systems - nothing past the basics, but it's enough for me to pick this up relatively easily.

Secondly, I've done a LOT of searching of the official NWN boards (nwn.bioware.com). Those people know a ton, way more than they should at this point. :) It's been invaluable looking through stuff there to figure stuff out. OnHeartbeat, for example, is mentioned there a lot.

There's some limited info in the World Builder Guide, which I'm not sure has come out over there. You should check it out though, I've heard it goes over a lot of the basics of scripting, and while incomplete provides a very good start for those looking to expand their module-making skills.
 

I believe anything that has the 'Plot' option ticked becomes indestructable. You can tick the plot option for doors, NPC's, signs, pretty much anything. It can also be altered dynamically via scripts.
 

If you're interested in learning by example, I'll zip up my module and post it so you can download it and pick it apart at your leisure. I'll post the link later.

To generally answer your questions:


1) To get a particular critter or NPC to respawn, you have to make a custom encounter that has just that critter or NPC on the creature list. Set it so it generates 1-1 (i.e. just one) of these creatures, and then create the encounter as normal (on the Advanced tab, select the checkboxes for respawning and infinite respawn; and then return to the main tab and select Continuous).

2) To get treasure to respawn, you must first create a container (say, a chest). Open the chest's properties. On the scripts tab, select one of the following scripts to activate OnOpen and OnDestroyed (?):

nw_o2_classhig
nw_o2_boss

There are others that generate other treasures but start with one of these for now.

Now Edit the script you picked. Add the following line just after the ShoutDisturbed line and before the closing }:

DelayCommand (60.0, SetLocalInt (OBJECT_SELF, "NW_DO_ONCE",0));

That will delay the chest's ability to respawn for 60 seconds; when that time passes the chest thinks it hasn't been opened yet and will generate a new treasure next time it's opened.
 

Thanks, Eric! My next project is a semi-persistent world (my server is my home PC, so I can't leave it up for more than a few hours at a time), so the chest thing will be particularly helpful. I'd already stumbled on the encounter trick.
 

Cool - thanks, Eric! I'll try that.

Bleh. Now I have to go and edit every treasure item in my module....
 


Remove ads

Top