bar_onareaexit
On Area Exit script:
- Cleans up loot bags, encounter creatures, dead creatures and hostile creatures when last char leaves the area.
- Does not kill friendly merchants and NPCs, suitable for all areas in most mods.
- New revision introduces delay, players can reenter to prevent clean up with in two minutes. Requires one placable in area to latch on to.
- Old revision seemed to fire a bit too often. In practice did in fact clean up when players where in the area.
Posted by Natala at 2011-02-24 09:09:38 Voted 9.00 on 02/24/11
Very useful, haven't had the chance to try it live but if it does what it says on the package I'll be putting this in most wilderness and cave areas. :) Love none Heartbeat scripts. _________________________ Tales of Nelanther PW Link
Hardcore roleplay with moderate combat, Intimate Player Community with high-DM Interaction, 4th Edition Forgotten Realms setting - NWN2 3.5 ruleset.
Posted by Qrizz at 2010-05-13 23:52:59 Voted 9.75 on 05/13/10
Great ! _________________________ Qrizz
Middle Earth Arnor PW Link
Posted by Sepelio at 2009-03-10 16:21:35 Voted 9.00 on 03/10/09
Seems to run under my testing conditions in a server empty of players. I've stuck it in most areas that have hostile spawns now. Hope it performs just as well under load.
In my case its replacing a hearbeat script that was put in by a previous developer.
Posted by Sepelio at 2009-03-09 15:45:51 Voted 9.00 on 03/10/09
I'll be using this script in a pwc. Once I actually get the chance to see it run I'll rate :)
Posted by barfubaz at 2008-06-21 14:59:57 Voted 10.00 on 05/23/08
Arvigo,
Thank you for the feedback.
To answer your questions:
Well, didn't use the module object because I was doing the area. In practice I prefer to do lower overhead scripts, besides try not to make a script that can wipe out monsters as they fight them (although could have coded around that). Honestly a full module clean doesn't make much sense to me since I am trying to preserve the feel of the area being persistent and only cleaning up when the chars are out of the specific area long enough to lose sense of continuity. If full module clean works for you then using the module for the delay would make sense.
Yes, you may want to customize the creature cleanup condition if you have more complex requirements.
Heh "The code in TrashObject function could be cleaner" ... irony. Was the bit that took from someone else so kept that as close to the original as possible, but yeah I suppose I could have cleaned up the trash better *chuckles*.
- Bar
Posted by Arvirago at 2008-06-20 05:24:12 Voted 6.50 on 06/20/08
Why don't you use the module object to do the actions, instead of looking for a placeable?
That's what I did in NWN1 to have a script cleaning all bodybags for the whole module (instead of working on a per area basis).
The script is OK, but when you have different factions where one can be ostile to some players and not to others you have to be aware that the script will clean all but the commoners.
Also remember to set the respawn time of your encounters accordingly, so you can't just get away with them exiting the areas (2 minutes delay).
The code in TrashObject function could be cleaner. _________________________ Reino de Aldor
Posted by over_my_head at 2008-05-31 02:55:54 Voted 8.50 on 05/31/08
Hey Barfubaz,
Thanks for the quick reply. And indeed, I should take that into account. I used Sir Elric's system due to its simplicity, but you are right in assuming it causes lag. Until now my computer can handle it, but what's the point in causing extra lag when this can be overcome. I just like the flexibility of editing every single creature placed. Determining where they should spawn is more time-consuming, and encounter triggers reduces the flexibilty. I will have a look at what is the best solution. Though, thank you for the note, and for the quick reply and solution.
Yours sincerely,
Over My Head
Posted by barfubaz at 2008-05-30 21:14:36 Voted 10.00 on 05/23/08
Over_my_head:
Re: compatability with "Sir Elric's Simple NPC Respawning"
Looking at Sir Elric's code, I see he depends on the on death event. So verbatum use of my script would destroy the creatures and not fire the death script and you'd end up with an empty module right quick.
If you just want to clean up the loot bags, change the long if expression to just:
As a note our experiments show that empty areas with NPCs in them do take up CPU, so if you are experiencing lag due to CPU you may want to reconsider how you spawn.
- Bar
Posted by over_my_head at 2008-05-29 03:05:05 Voted 8.50 on 05/31/08
What if we do not use encounters which are triggered, but place creatures in the Toolset which respawn after they have been killed by a player. I use Sir Elric's Simple NPC Respawning. Will it cause the event to stop since the creature has not been destroyed, or will the script assume the NPC has been destroyed and respawn after set interval and remain until a PC enters and exits the area again?
Posted by barfubaz at 2008-05-23 09:58:56 Voted 10.00 on 05/23/08
Please post here if are using this script.
- Bar
You must be Logged In to post comments in this section.
10 - A Masterpiece, Genuinely Groundbreaking 9 - Outstanding, a Must Have 8 - Excellent, Recommended to Anyone 7 - Very Good, Deserves a Look 6 - Good, Qualified Recommendation 5 - Fair, Solid yet Unremarkable 4 - Some Merit, Requires Improvements 3 - Poor Execution, Potential Unrealized 2 - Very Little Appeal 1 - Not Recommended to Anyone