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 
 
Locations: 1.06 to 1.07 Update SQLScript

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
RQScott



Joined: 09 Jun 2005
Posts: 6

PostPosted: Tue Jan 30, 2007 19:37    Post subject: Locations: 1.06 to 1.07 Update SQLScript Reply with quote

Since i have already used the SetPersistentLocation-Function (I used the SQLLocationToString/SQLStringToLocation) i thought it might be usefull to provide a script to "convert" the old values to the new ones, used from Prototype 1.07.

Using MySQL!

Backup your data before executing any SQL Scripts!

For use with the "pwdata"-table as provided by nwnx:
Code:

update pwdata set val = replace(val,'#AREA#','#A#'), val = replace(val, '#POSITION_Y#', '#Y#'), val = replace(val, '#POSITION_X#', '#X#'), val = replace(val, '#POSITION_Z#', '#Z#'), val = replace(val, '#ORIENTATION#', '#O#');


Recognize, that the script will replace all matching substrings. If you dont use strings like "#POSITION_X#" or the other changed substrings for other data, you dont have to worry about the other records.

For use with custom tables:

Change the above Script:

a) pwdata to your tables name
b) val to the column name used for locations
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Sat Jul 21, 2007 5:46    Post subject: Reply with quote

I had need of this tonight -- thanks for posting it!
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
Back to top
View user's profile Send private message
nosfe



Joined: 25 Apr 2007
Posts: 22

PostPosted: Mon Sep 03, 2007 10:08    Post subject: Reply with quote

What is it the good last Location ? the short name or large name ?

Shocked
Back to top
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Fri Oct 19, 2007 4:35    Post subject: Reply with quote

This may seem really stupid, but did I miss something?
My areas are still in the #AREA#...#POSITION_X#...#POSITION_Y#...#POSITION_Z#...#ORIENTATION# format.

Just checking?
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri
Back to top
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Fri Oct 19, 2007 6:35    Post subject: Reply with quote

Urlord wrote:
This may seem really stupid, but did I miss something?
My areas are still in the #AREA#...#POSITION_X#...#POSITION_Y#...#POSITION_Z#...#ORIENTATION# format.

Just checking?


When you update to 1.08 (the above) old locations - as strings - exceed the length of the buffer (capped at 128bytes). The simple solution is to re-format the encoding to #A#...#X#...#Y#...#Z#...#F#...#E# and shrink the string length. It does mean you need to 'convert' any existing data, and use the new 'seperators'

Cheers
Gryphyn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development 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