View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Mon Jul 05, 2010 0:12 Post subject: |
|
|
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 |
|
|
Tenshar
Joined: 18 Apr 2010 Posts: 13
|
Posted: Mon Jul 05, 2010 11:43 Post subject: |
|
|
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 |
|
|
Disco
Joined: 06 Dec 2006 Posts: 152
|
Posted: Tue Jul 06, 2010 10:04 Post subject: |
|
|
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 |
|
|
Tenshar
Joined: 18 Apr 2010 Posts: 13
|
Posted: Tue Jul 06, 2010 14:07 Post subject: |
|
|
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 |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Tue Jul 06, 2010 22:21 Post subject: |
|
|
StoreCampaignObject and RetrieveCampaignObject. You can do this with or without NWNX. With requires some extra scripting. |
|
Back to top |
|
|
Tenshar
Joined: 18 Apr 2010 Posts: 13
|
Posted: Wed Jul 07, 2010 13:24 Post subject: |
|
|
Right its working now, thanks for all the help
- Tenshar |
|
Back to top |
|
|
|