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 
 
Database vs In Mod Storage
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Mon Jul 05, 2010 0:12    Post subject: Reply with quote

with some work... yes


You would need to script the onModLoad event, to reload the data onto the creature.


And then everytime you update the creature with new data, you need to make sure it writes the new values to the database at the same time.


This way, if the server resets, it will have the most recent data, and will load it up when the server loads up again.
Back to top
View user's profile Send private message
Tenshar



Joined: 18 Apr 2010
Posts: 13

PostPosted: Mon Jul 05, 2010 11:43    Post subject: Reply with quote

Baaleos wrote:
with some work... yes


You would need to script the onModLoad event, to reload the data onto the creature.


How can you do that?


Baaleos wrote:

And then everytime you update the creature with new data, you need to make sure it writes the new values to the database at the same time.


What database?
Back to top
View user's profile Send private message
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Tue Jul 06, 2010 10:04    Post subject: Reply with quote

I think you're getting a bit confused here. We're basically talking about two different things in this thread:

1. Caching of existent data on a waypoint for quick access. This would be a scenario like you got a small list of say colors in a database and you don't want to make a query every time you need a color. So, you do this:

- make an SQL query that retrieves the colors
- store them on a waypoint
- store the waypoint on the module as an object (so you don't need to run GetWaypointByTag() all the time)

This would eliminate a lot of database calls.

2. Collecting data and storing it in one convenient package, for example in the standard BioWare database. What you do is this:

- store your data on a creature (or item) as local variables
- store this creature (or item) in your database as a persistent object when your server closes
- spawn this creature when your server starts so you can read and update your data

I'd personally do #2 with a proper database and dedicated tables, though.
Back to top
View user's profile Send private message
Tenshar



Joined: 18 Apr 2010
Posts: 13

PostPosted: Tue Jul 06, 2010 14:07    Post subject: Reply with quote

Disco wrote:
- store this creature (or item) in your database as a persistent object when your server closes
- spawn this creature when your server starts so you can read and update your data


Thanks for making some things clear but I'm still having trouble with those two lines lol, what I'm trying to do is to store the creature as a persistent object but the problem is I don't know how to do that lol.
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue Jul 06, 2010 22:21    Post subject: Reply with quote

StoreCampaignObject and RetrieveCampaignObject. You can do this with or without NWNX. With requires some extra scripting.
Back to top
View user's profile Send private message
Tenshar



Joined: 18 Apr 2010
Posts: 13

PostPosted: Wed Jul 07, 2010 13:24    Post subject: Reply with quote

Right its working now, thanks for all the help Very Happy

- Tenshar
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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