Designed to clean the area when no players are present. Custom functions/scripts contained here are used as follows for the Area:
OnEnter: [CheckForPC()] - Keeps track of the number of players in the area OnExit: [TimerCheck()] - Checks to see if any players remain in the area - Starts cleanup process when no PC is present
* In addition the following script is needed: OnUserDefined: 'area_clean_usr' - Performs the actual clearing of the area
NOTE: The first two are presented as functions so that they can be easily incorporated with any existing area scripts.
I cant get this to work, I've had mod crashes, game crashes or (when it seemed to work) non-removal of npc's, any idea why? _________________________ sorry, cant get my pen to work on the screen so no signature ^_^
Posted by MasterP at 2005-11-03 08:32:43 Voted 10.00 on 11/03/05
very good system to save ressources on a pw!
Posted by IllusiveMind at 2005-06-05 16:31:23 Voted 10.00 on 06/05/05
Short, accurate. An awesome alternative if you don't have NESS and PW Helper. Helped me lots. Keep up the good work.
---------------------------------------------------------
For a quick reminder:
The cleanup script runs after a delay. This delay can be set on the area, otherwise the default is used (180.0 seconds). In both cases, the delay value is used as the min (as is) & max (2x delay) range for the script to run the pre-cleanup scan of objects in the area. By default, 3-6 minutes.
When it finds a valid object, the object is set to destruction within the range of 0 to the "delay" setting of seconds. By default, this is an additional 0-1.5 minutes.
At anytime before the cleanup scan finished (but not after), it can be interrrupted by a player entering the area.
--------------------------------------------------------
Now that that's covered, to adjust the NPC clear delay you can modify a few parts of the "Area_clean_usr" script
First, add a new constant to hold the delay for spawned NPCs ...
Ex:
float NPC=10.0;
... modify the CleanCheck function to send a new signal when an NPC is found ...
... and add to the CleanArea function a matching response ...
Ex:
[after line 85] (before it gets the next item in area)
if(Verify==4){
float Delay=NPC*Random(20); // This gives an added 10 secs to a little more than 3 minutes
DelayCommand(Delay,DestroyObject(Trash));}
---------------------------------------------------------
For a quick reminder:
The cleanup script runs after a delay. This delay can be set on the area, otherwise the default is used (180.0 seconds). In both cases, the delay value is used as the min (as is) & max (2x delay) range for the script to run the pre-cleanup scan of objects in the area. By default, 3-6 minutes.
When it finds a valid object, the object is set to destruction within the range of 0 to the "delay" setting of seconds. By default, this is an additional 0-1.5 minutes.
At anytime before the cleanup scan finished (but not after), it can be interrrupted by a player entering the area.
--------------------------------------------------------
Now that that's covered, to ajust the NPC clear delay you can modify a few parts of the "Area_clean_usr" script
First, add a new constant to hold the delay for spawned NPCs ...
Ex:
float NPC=10.0;
... modify the CleanCheck function to send a new signal when an NPC is found ...
... and add to the CleanArea function a matching response ...
Ex:
[after line 85] (before it gets the next item in area)
if(Verify==4){
float Delay=NPC*Random(20); // This gives an added 10 secs to a little more than 3 minutes
DelayCommand(Delay,DestroyObject(Trash));}
Posted by puket ( ..xxx.xxx ) at 2004-03-11 11:27:00
Is it possible to give the creatures(NPC's)an extra "fdelay"
time for despawing?
Have you thought of makeing a compatable HCR vrs.? This would perfect on my mod. I'll look into implementing. Problem is, currently HCR drops a body and a body bag from dead PC's. (Inventory and PCT in bag)PCT is so another PC can drag dead body to a cleric to have him raised...
Sabbryn, I was looking through your code as I plan to use part of this, and thought of a question...
There's a reference to a "BodyBag" placeable that will have its inventory cleared before being destoyed. My question is what item uses the "BodyBag" tag? I thought that was an exclusive HCR thing, or is that the tag of the default HotU "Remains Bag" also?
For those wishing to not have it clear corpses for instances where you want the corpse to decay, then I can tell you what change you need to make.
Part of the concept for using an assignable "shop" for areas was to make it possible for recycling. Imagine a cavern crawl where anything lost/dropped in the caverns will be lost (sent to the shop) and recycled (as part of the "treasure horde" at the end and/or a source of arms and equipment for the spawned encounters) - thus still reclaimable - with effort.
Designed to clear areas of loot bags, dropped items and spawned NPCs.
Executes when no player remains in the area. Does not break when a player logs.
System keeps a running count of players entering and exiting the area (useful for other scripts to call).
Optional "store" can be assigned to the area so that cleared items can be recycled instead of destroyed.
If no time delay is assigned to the area, it will be assigned the default (see area_clean_inc).
[Details]
- Two scripts that are the core for my area cleaning system.
1. area_clean_inc
- contains functions to be included as part of an area's OnEnter and OnExit scripts
2. area_clean_usr
- script to be used as is on the area's OnUserDefined hook
- contains all functions necessary to automate the cleaning process for an area
* area_enter & area_exit scripts included for ease of incorporation
You must be Logged In to post comments in this section.