Respawning NPC caves/dungeons

Post » Sat Dec 10, 2011 8:35 am

I worked out ages ago a method to make all those bandit caves turn into levelled content AFTER you've killed the original owners. That way that cave by seyda neen won't stay empty, some new fellas will move in.

I would need to add a very simple script to EVERY named NPC that appears in these caves/ruins, but, will this cause conflicts with all other mods out there? Always a bit wary of changing NPCs and Scripts :D

Plus, any interest in this? Quite a big task to identify every NPC that needs this script, and then make a whole load of generic/random NPC entries. Bit like "MCA for dungeons".
User avatar
Tiffany Holmes
 
Posts: 3351
Joined: Sun Sep 10, 2006 2:28 am

Post » Sat Dec 10, 2011 10:43 am

Doesn't MCA add bandits, outlaws and such to dungeons anyway?
User avatar
Emerald Dreams
 
Posts: 3376
Joined: Sun Jan 07, 2007 2:52 pm

Post » Sat Dec 10, 2011 2:02 pm

I'd be down, but it should probably be optional if you include it as part of Creatures.
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Sat Dec 10, 2011 2:30 am

I would be interested but I would not edit the vanilla NPCs in any way. I would rather add something to the caves (which would be easier seeing that there aren't as many caves as there are NPCs) that adds the new NPCs after the PCs first visit maybe.
User avatar
Alexxxxxx
 
Posts: 3417
Joined: Mon Jul 31, 2006 10:55 am

Post » Sat Dec 10, 2011 6:39 am

I'm very interested in this for a personal project of mine can you pm me the script I don't care about compatibilty since I tweak all the mods I use
User avatar
Nadia Nad
 
Posts: 3391
Joined: Thu Aug 31, 2006 3:17 pm

Post » Sat Dec 10, 2011 5:17 am

You don't necessarily have to add a script to every named NPC to check whether they're dead. I don't think it'd take much more time to get the ID of every NPC in a cave and add a condition for their death, since you're going to have to identify them all anyway ? Maybe one of the advanced editors can even automate that.
User avatar
Philip Rua
 
Posts: 3348
Joined: Sun May 06, 2007 11:53 am

Post » Sat Dec 10, 2011 2:49 am

I like the idea of this, and would like to see it done. Though I wonder if it would be possible to add some "totem" items which, when placed into one of the dungeons it will prevent the people from spawning there. I say this because on occasion, I like to inhabit a cave with my character and it'd be annoying if people started spawning there while I was away.

I think this may not be too hard if you went with Rot's suggestion (which definitely sounds plausible to me).
User avatar
Dalley hussain
 
Posts: 3480
Joined: Sun Jun 18, 2006 2:45 am

Post » Sat Dec 10, 2011 11:24 am

Well, the beauty of my script is that it takes into account any possible dungeons you make a home. It works by placing an activator at the corpse. If 2 days have passed (with some randomness put in) and the player hasn't been around, then the activtor will place a spawn marker. If the player visits, the timer resets. Seems to work OK with a quite test over a week period.
User avatar
Jason Rice
 
Posts: 3445
Joined: Thu Aug 16, 2007 3:42 pm

Post » Sat Dec 10, 2011 12:01 am

So, what if the player went to solstheim for few months? Would there be bandits in the cave when they returned.
User avatar
Evaa
 
Posts: 3502
Joined: Mon Dec 18, 2006 9:11 am

Post » Sat Dec 10, 2011 9:00 am

Yep, I'm afraid so, you'll find them looting your home in your absence....
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm

Post » Sat Dec 10, 2011 2:42 am

Yep, I'm afraid so, you'll find them looting your home in your absence....

Well if I was a homeless bandit and knew about a cave that had been abandoned for over a month I'd consider moving in too. :P
User avatar
Nicholas C
 
Posts: 3489
Joined: Tue Aug 07, 2007 8:20 am

Post » Fri Dec 09, 2011 11:43 pm

Yeah that isn't so bad, actually kind of nifty, it makes sense that they'd want in there if it wasn't being used.

Once you did come back, would they continue spawning forever then? Even if you visited everyday after your long absence?
User avatar
Brooke Turner
 
Posts: 3319
Joined: Wed Nov 01, 2006 11:13 am

Post » Sat Dec 10, 2011 10:21 am

I'm not too sure on the answer to that one. Does placing a levelled spawn point via a script place a true spawn point, or just a single creature from that levelled list? I'd have to do some further testing on that one. Only tested so far to prove the theory works, that a cave system with placed NPCs can turn into a levelled type system once the original NPCs are dead.
User avatar
Scarlet Devil
 
Posts: 3410
Joined: Wed Aug 16, 2006 6:31 pm

Post » Sat Dec 10, 2011 1:15 pm

That's okay, I was just curious. I still think this sounds like a cool idea.
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Sat Dec 10, 2011 3:19 am

personally I have always loved going into a cave killing everyone and the turning it into my own base of sorts, its one of the things I hated in oblivion, thanks to the respawning npcs

I vote for this to be optional or not touch the existing caves at all by simply making new ones (not a simple thing though, more tedious then anything else)
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Sat Dec 10, 2011 1:35 pm

I do like the idea, and have wanted to do something like it because I hate the way MCA did it.

I don't think placing spawn points with a script is a good idea for what you want to do though, because as far as I know you can't delete them. I just took a look at Creatures, and I see that it places spawn points using this method. Over time more and more spawn points will be created, and this will eventually cause problems. I just checked it in-game with the bandit bosses as a test subject, and sure enough, the bandits spawned by the boss are always there. Spawning more bosses further adds to the other bandits spawned. This seems like a very bad way to do it, in my opinion.

There is also a bug with spawn points that causes them to respawn every time you change cells after clearing the corpse, independent of fCorpseClearDelay. So once something spawns, the cave will never be vacant again unless you actively modify the leveled list/spawned actors with scripts, or leave the corpse and visit frequently enough. It becomes exactly like MCA, in other words.

I vote against scripting the actors directly if you don't need to. I don't know why you would want to place the activator at the corpse, as I think that would only lead to problems if the actor were to die in an unexpected place, like underwater, in lava, or places where they get stuck. There is also the possibility of luring the actor away from their initial cell to worry about. Though if you insist on doing it that way you still don't need to place a script on the actors, instead checking for the actors death and using "actor_id"->PlaceAtMe, "spawn_activator" in a script attached to a persistent activator. It seems inefficient to me though.

Placing some some activators at appropriate places that would only spawn a new actor once the original actors are dead really seems like the ideal way to do it. You could randomize what points spawn and keep bandits from repopulating the dungeon too often as well. While you would have to specify what actors to spawn in the script (who can be scripted for randomness, as you know), it seems overall safer than using spawn points. And, while you could modify the leveled lists at run-time, it seems rather redundant in comparison to the activator method.
User avatar
Rodney C
 
Posts: 3520
Joined: Sat Aug 18, 2007 12:54 am

Post » Sat Dec 10, 2011 2:04 pm

I think this is a great idea, myself. I don't know enough about scripting to offer any useful insights into that part, but I really love the idea that they only spawn if you don't visit the cave frequently. It seems to me like this adds a great level of realism.
User avatar
Lory Da Costa
 
Posts: 3463
Joined: Fri Dec 15, 2006 12:30 pm

Post » Sat Dec 10, 2011 10:46 am

I do like the idea, and have wanted to do something like it because I hate the way MCA did it.

I don't think placing spawn points with a script is a good idea for what you want to do though, because as far as I know you can't delete them. I just took a look at Creatures, and I see that it places spawn points using this method. Over time more and more spawn points will be created, and this will eventually cause problems. I just checked it in-game with the bandit bosses as a test subject, and sure enough, the bandits spawned by the boss are always there. Spawning more bosses further adds to the other bandits spawned. This seems like a very bad way to do it, in my opinion.

Now this was something I wasn't aware off, short term testing doesn't highlight this problem. Surprised that it's not been reported in Creatures before. I'll have to adjust the scripts in Creatures to actually place the NPCs instead of relying on levelled lists (big shame, makes the scripts bigger, not complex, just annoyingly bigger :D)

There is also a bug with spawn points that causes them to respawn every time you change cells after clearing the corpse, independent of fCorpseClearDelay. So once something spawns, the cave will never be vacant again unless you actively modify the leveled list/spawned actors with scripts, or leave the corpse and visit frequently enough. It becomes exactly like MCA, in other words.

I'm aware of this bug, in my play style, I make a point of NOT clearing corpses outside of entrances to interiors

I vote against scripting the actors directly if you don't need to. I don't know why you would want to place the activator at the corpse, as I think that would only lead to problems if the actor were to die in an unexpected place, like underwater, in lava, or places where they get stuck. There is also the possibility of luring the actor away from their initial cell to worry about. Though if you insist on doing it that way you still don't need to place a script on the actors, instead checking for the actors death and using "actor_id"->PlaceAtMe, "spawn_activator" in a script attached to a persistent activator. It seems inefficient to me though.

Placing some some activators at appropriate places that would only spawn a new actor once the original actors are dead really seems like the ideal way to do it. You could randomize what points spawn and keep bandits from repopulating the dungeon too often as well. While you would have to specify what actors to spawn in the script (who can be scripted for randomness, as you know), it seems overall safer than using spawn points. And, while you could modify the leveled lists at run-time, it seems rather redundant in comparison to the activator method.

Placing at the corpse was the easiest and simpliest way I could think of doing it. The only test required is if the NPC the script is on is dead, and if so, place an activator. This activator then does it's time delay stuff, and then when everything calculates as True, place a new NPC at the activators location, and then delete the activator (to stop it spawning new stuff and taking memory resources). The new "generic" bandits that then spawn have the same script on, so then you get constant time delayed renewal. I understand the problem of spawns being in bad places due to where corpses are. Something else to think about. I'm also thinking about normal MW, where you can't drag enemies into different cells.

By having an activator in each interior that checks the health status of the NPCs, and placing/dealing with activtors does lead to other issues. The script first time round has to deal with specific NPCs, then after that, it has to check for every possible random NPC that could be spawned by the script, turning in a monster script.

Hmm, everything has pro's and con's. Just what I love about MW modding :D

But definately, I need to avoid using levelled lists to place random stuff, since it's actually placing a spawn marker and not the actual NPC/creature from the list. Something else to add to the Creatures update.
User avatar
matt white
 
Posts: 3444
Joined: Fri Jul 27, 2007 2:43 pm

Post » Sat Dec 10, 2011 12:50 am

personally I have always loved going into a cave killing everyone and the turning it into my own base of sorts, its one of the things I hated in oblivion, thanks to the respawning npcs

I vote for this to be optional or not touch the existing caves at all by simply making new ones (not a simple thing though, more tedious then anything else)

Installing mods is always optional. :wink_smile:
User avatar
Sarah Knight
 
Posts: 3416
Joined: Mon Jun 19, 2006 5:02 am

Post » Sat Dec 10, 2011 6:41 am

Now this was something I wasn't aware off, short term testing doesn't highlight this problem. Surprised that it's not been reported in Creatures before. I'll have to adjust the scripts in Creatures to actually place the NPCs instead of relying on levelled lists (big shame, makes the scripts bigger, not complex, just annoyingly bigger :D)

I just consoled in the bandit boss, since the chance for them spawning was so low. It is the kind of thing that probably wouldn't appear during play-testing, so you have to invite it. Even with the low boss spawn, I would think people might notice the other bandits appearing without a boss.

I'm aware of this bug, in my play style, I make a point of NOT clearing corpses outside of entrances to interiors

Same here, though a bull netch was blocking my way into a cave earlier, so I had no choice. =/

Placing at the corpse was the easiest and simpliest way I could think of doing it. The only test required is if the NPC the script is on is dead, and if so, place an activator. This activator then does it's time delay stuff, and then when everything calculates as True, place a new NPC at the activators location, and then delete the activator (to stop it spawning new stuff and taking memory resources). The new "generic" bandits that then spawn have the same script on, so then you get constant time delayed renewal. I understand the problem of spawns being in bad places due to where corpses are. Something else to think about. I'm also thinking about normal MW, where you can't drag enemies into different cells.

I was pretty sure that you would have scripted the NPCs, but I wanted to make the point to be sure. As for moving actors to different cells, they can always be commanded in vanilla.

By having an activator in each interior that checks the health status of the NPCs, and placing/dealing with activtors does lead to other issues. The script first time round has to deal with specific NPCs, then after that, it has to check for every possible random NPC that could be spawned by the script, turning in a monster script.

Yes, they will be longer, but not so long that it should make a real problem. Proper use of states and returns should keep it from slowing down anything since it will only need to run once once enough time has passed. You could also delete the activator/s that check for death and place or enable the spawning ones. Plus, interiors are almost never a problem with slowdown in my experience. I'm all for things being no more complicated than they need to be to make them function without problems, but given what problems I foresaw I don't see another way that is reliable without being overly complicated.

Hmm, everything has pro's and con's. Just what I love about MW modding :D

True, true, so very true.
User avatar
Leanne Molloy
 
Posts: 3342
Joined: Sat Sep 02, 2006 1:09 am

Post » Sat Dec 10, 2011 3:06 am

I'm not too sure on the answer to that one. Does placing a levelled spawn point via a script place a true spawn point, or just a single creature from that levelled list?
The first one, It will probably double each generation, not good
User avatar
Stacey Mason
 
Posts: 3350
Joined: Wed Nov 08, 2006 6:18 am


Return to III - Morrowind