They'll need their own table, w/ a reference to the player's id, a field
for the order in which they're written (rom does this w/ a recursive
algorithm, but you can get around it when using a database because you
can query for them in whatever order you want), and a field for the nest
value... when you query to retrieve them during character load, you can
query something similar to this:

query("SELECT * FROM obj_data WHERE char_id=\"%ld\" ORDER BY
nest_id,order_id",ch->id);

or you could use recursion like rom does, and query for them by order_id
alone, and just check for when the nest_id changes and start using
obj_to_obj to place it into the previous item's contents, and then if
you encounter another nest_id, begin using obj_to_obj to add to *that*
object's contents (or back to a previous level of object if the nest_id
drops down one instead of increasing), until you return to the original
nest level and to the obj_to_char calls...

Richard Lindsey
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 27, 2005 10:29 PM
To: [email protected]
Subject: Mysql Conversion, objects in pfiles

Ok, someone explain how I should do this maybe....

converting pfiles and whatnot over to database....here's my problem...

in a pfile, objects inside a container are read like so and wrote like 
so...
container
object with nest
container
object with nest
object object
 asdkfhsdfkl


yeah, well how do I do this with a table?
am I gonna be able to write them in order...and read them back just as 
easily....or is there a big thing that I have to go through, what do 
you guys think?

any other simple little tips and tricks used for pfile conversion are 
welcomed as well...
-- 
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom

Reply via email to