Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  Area Cleaning Trashcan
Author  semajack
Submitted / Updated  08-10-2003 / 11-22-2006
Category  Area
Expansions  Works on all versions
View Code  

Select All Text | View Code in separate window
Format  Code Only
Type  Type - Other
Includes  BioWare Standard
Description
When this script is put onHeartbeat of an object that has an inventory it will search the area for dropped remains and transfer everything into its own inventory. It is set only for remains but can be adjusted to pick up items too. I made this script in order to clean my spawning room and city without having to mess with the NPC version that may get killed, be to slow, or just a plain hassle. You can also adjust the timeing. There may be a little lag because it is a hearbeat script but I have 56k and it hasn't bothered me yet. I have tested it and worked out all the bugs I know of. If you have any questions or tips on how to make it better email me at [email protected]

Files

NameTypeSizeDownloads
NO FILES
SCORE OUT OF 10
10
1 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (7):

Posted by Shirei at 2007-09-22 20:19:29    Voted 10.00 on 09/22/07
Thanks for the script. I have been looking for something that you don't need to put on a module event (like OnUnAquire). I use it for a personal PW-type mod for fairly training characters.
_________________________
Evil Overlord Rule #4: Shooting is *not* too good for my enemies.

Posted by semajack at 2006-01-01 13:42:49    
Well,
I got some great feedback from users and thought I'd update this thing by posting a faster and making the appropiate changes to pick up items and everything dropped in the remains. I prefer to give players a chance to pick stuff up but it seems a lot of users want a more fast acting script so here ya go.
void TrashObject(object oTrash, string sResref, int iStack)
{
object oItem;
if(GetHasInventory(oTrash) == TRUE)
{
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
oItem = GetFirstItemInInventory(oTrash);
while(GetIsObjectValid(oItem))
{
iStack = GetItemStackSize(oItem);
sResref = GetResRef(oItem);
CreateItemOnObject(sResref,OBJECT_SELF,iStack);
DestroyObject(oItem);
oItem = GetNextItemInInventory(oTrash);
}
}
else
{
iStack = GetItemStackSize(oTrash);
sResref = GetResRef(oTrash);
CreateItemOnObject(sResref,OBJECT_SELF,iStack);
DestroyObject(oTrash);
}
}
void main()
{
//int oGo = GetLocalInt(OBJECT_SELF,"go");
object oTrash = GetFirstObjectInArea();
string sResref;
int iStack;
//if(oGo == 5)
//{
SetLocalInt(OBJECT_SELF,"go",0);
while(GetIsObjectValid(oTrash))
{
if(GetObjectType(oTrash) == OBJECT_TYPE_PLACEABLE && GetTag(oTrash) == "BodyBag")
{
TrashObject(oTrash, sResref, iStack);
}
else
{
if(GetObjectType(oTrash) == OBJECT_TYPE_ITEM)
{
CopyObject(oTrash, GetLocation(oTrash), OBJECT_SELF);
DestroyObject(oTrash);//TrashObject(oTrash, sResref, iStack);
}
}
oTrash = GetNextObjectInArea();
}
}
//else
//{
//++oGo;
//SetLocalInt(OBJECT_SELF,"go",oGo);
//SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), FALSE);
//}
}

Thanks again for all the positive responses.
Happy New Years,

Semajack

Posted by semajack at 2004-07-17 12:02:00    
If you uncomment the lines under the while statement at this point it will work for items. Sorry for the lack of script comments.

else
{//Uncomment these lines to trash items too
//if(GetObjectType(oTrash) == OBJECT_TYPE_ITEM)
//TrashObject(oTrash, sResref, iStack);
}

Posted by semajack at 2004-07-17 12:02:00    
If you uncomment the lines under the while statement at this point it will work for items. Sorry for the lack of script comments.

else
{//Uncomment these lines to trash items too
//if(GetObjectType(oTrash) == OBJECT_TYPE_ITEM)
//TrashObject(oTrash, sResref, iStack);
}

Posted by s0ad. ( 24.174.xxx.xxx ) at 2004-05-27 13:17:00    
Kelio, the description clearly states that it was not made for items, just for remains (i.e. the little bags creatures drop when they die.).

Posted by kelio ( 66.191.xxx.xxx ) at 2004-04-22 21:40:00    
don't mine me but it will not work for me I used a chest for my trashcan and I put your script on it's heartbeat then i when into the mode to test and layed down and item then i left the area and when i got back the item was still where i left it

Posted by DARK VETEG A PRINCE ( ..xxx.xxx ) at 2003-08-15 17:47:00    
Hey thanks I been looking for something like this to clean up areas.

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Tools


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters