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 
 
Store all placeables in an area script

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
xtrick8



Joined: 31 Jul 2006
Posts: 8
Location: Melbourne, Australia

PostPosted: Mon Jul 31, 2006 16:35    Post subject: Store all placeables in an area script Reply with quote

Just wondering is there a way to store all the placeables in an area, including their location and orientation ?

I am using APS for the persistence in our mod, successfully saving player locations, storage, housing etc..., but cannot see how to store both the object and the location.

What I really want to be able to do is onenter an area, delete all placeables and load them from the DB. onexit an area, save all placeables to the database.

Thanks in advance.
_________________
- xtrick8 (Lead Writer for Noreshia)
http://www.noreshia.com/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Mon Jul 31, 2006 17:11    Post subject: Reply with quote

Its a two step process....

First, you store the object. I actually used the default DB for this one instead; it was easier for me to use and worked fine.

Then you store the location with SetPersistentLocation.

You need to use a variable scheme that makes it easy to tie the object and the location together. To make it easier to determine what objects are in what area I would suggest looking at using a different table per area. Check for existance and create the table if it doesn't exist, store the information for the placeables afterwards. Make sure your areas are unique tags also, I have always used edge-to-edge transitions so my areas are all laid out in a grid with tags like p50p50p00 to show where they are in relationship to each other.

There is a sample persistent placeable script on the Vault that I modified for my use, you should be able to use it as an example:

http://nwvault.ign.com/View.php?view=scripts.Detail&id=2778

Luck!
Back to top
View user's profile Send private message
xtrick8



Joined: 31 Jul 2006
Posts: 8
Location: Melbourne, Australia

PostPosted: Tue Aug 01, 2006 1:35    Post subject: Reply with quote

Yeah had a look at that one and also the furniture mod which both seem to use the standard bioware functions to store the object with the location. I am a little confused about how to convert this code over to use APS. Also if I understand this correctly you need to restore the item, then destroy it and then place it so that it is a placeable....
_________________
- xtrick8 (Lead Writer for Noreshia)
http://www.noreshia.com/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related 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