logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Limbo properties

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon Jul 12, 2010 21:51    Post subject: Limbo properties Reply with quote

Im trying to clean up my NPC when last player exit area. I was thinking what would be better, send them into Limbo or set them nonexisting scripts (guess there is issue with no script at alll right) into all events?

Cos I worry if there isn't some limit for number of objects in Limbo, does anybody know?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Jul 13, 2010 21:20    Post subject: What I do Reply with quote

What I do instead, is use an on enter, and on exit script for the area in question.


When a player exits the area, and no other players are inside the area, it loops through all npcs, saves their resrefs, locations etc to local variables on the area, with incrementing unique id's.

eg
Creature_01
Creature_02

and so on

and the locations are stored with the same number as the creatures resref etc.

Then, when values are stored, they are also destroyed at the same time.

When a player enters the area, the creatures, are restored via their ResRef, basically as new objects, in their predesessers original locations.


So far, I use this in Taverns etc.
Works fine.

Objects existing in the module, no matter where, cost a small amount of memory, it makes sense to reclaim this memory, when not needed.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Jul 13, 2010 23:34    Post subject: Reply with quote

Im destroying them already, but I would like to avoid Destroy/Create object if its not necessary so Im thinking about new way. Limbo/EventScripts are two ideas, wonder what would be better.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jul 14, 2010 2:04    Post subject: Reply with quote

dont know if there is limits on the amount of npcs that can go into limbo, but I do know that it would be a hell of a mess for any dm's trying to use limbo for any RP'ing.


But as far as event scripts go.

You will actually need to make a script that does

Code:

void main()
{
return;
}


Blank events, tell nwn to run the default script for that event.

But if you make a script which does the minimum, such as a simple return, then this will be acceptable, and will effectivly minimize the drain from that particular creature.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group