ID Consistency
I am having difficulty grasping a concept in the database. If you do a packet collect, and then the SQL is generated it may have something like this at the top. This is from a GFAY generated SQL.
Code:
set @StartingNPCTypeID = 54000; Code:
SELECT * FROM spawnentry WHERE npcid>54000 AND npcid<54999; Code:
spawngroupID npcID chance Or maybe this.... Code:
SELECT max(id) FROM npc_types WHERE id>54000 AND id<54999; Code:
pID npcID chance |
This actually confused the crap out of me for a few days because I had to adjustfire on work I was doing when taking it from my DB and inputting it to another server.
I'm sure someone that is more knowledgeable will chim in but you'll see how the spawngroup.id = spawn2.spawngroupID = spawnentry.spawngroupID and spawn2.id is just another thing. The spawngroupID is just a auto incrementing field and lots of stuff wont be "in order" but its not important in terms of the npcID so your query Code:
SELECT max(id) FROM npc_types WHERE id>54000 AND id<54999; No idea why the collector is feeding the starting ID's as I've never touched that but wouldnt be that hard for you to column edit with notepad++ into usable values. Of course I really dont know that much about this, just a little I learned by trial and breaking my db error. Kinda tired so this might not even be on topic. |
From - http://www.eqemulator.org/forums/sho...ight=extractor
Quote:
Depending on what you are trying to submit to, your own or the PEQ database, you may want Cavedude's input on how some zones are inserted. But to insert against your own database cleanly with free ID's you can use something similar to this: Code:
set @zone = "moors"; Still not understanding completely what you are trying to achieve even though you should know by now that ID's aren't completely consistent across the board. Maybe this query will help you figure out ID ranges of a particular zone: *This includes all fields of all tables besides the npc_types table, npc_types select only pulls id and name for reference *Just put the zone shortname at the bottom of the query: Code:
SELECT |
I am just trying to remain consistent man. If I find something and want to submit it for Cavedude to add to the database, I want to present it to him properly.
|
I have made heavy modifications to EQExtractor and posted it here:
https://code.google.com/p/projecteqdb/downloads/list It simplifies IDs a bit by removing many that aren't needed (since they use auto-increment), adds new features, and fixes a few bugs. I have to merge some of my work into the EQEmu SVN, as some of the bugs are severe (like for example, the grid DELETE is NOT safe - it WILL delete grids in multiple zones!) But, most of my features will remain exclusive to my version since to be honest they are more meant for experienced world builders. Derision's version is safe relatively speaking, but some of the check boxes in my version can really mess you up if you don't know what you are doing - so just a word of warning. The IDs PEQ uses are simple... NPCID starts at zoneid*1000. spawn2, spawngroup, objects, ground_spawns are all incremental, grids are incremental BY zoneid (something that needs to be fixed in the stock EQExtractor) as are doors. Merchantlist should be just the NPCID, but admittedly we have lost our way in regards to that, however I will be fixing that soon. By default, neither version of EQExtractor will give you the proper IDs for spawn2, spawngroup, grids, doors, or merchantlist (my version does not require IDs for other tables.) It has no connection to MySQL, so it has no way of knowing what the next available ID is. That's why Derision was awesome to have the queries use variables. That way, we can pass our outputted SQLs around, and not have to worry about IDs conflicting. PEQ SVN is ALWAYS behind (even if it was updated the same day) so I'm going to have to change IDs anyway. |
Quote:
Thanks for the help clarifying for him :) Nice touches on the Extractor I didn't even know you had modified it |
Okay, now I have an explanation, awesome.
|
I never made a post because i didn't want to step on Derision's toes. At first, I just added some features for my own benefit. But I then came across some bugs that I needed to fix. I will be merging those bug fixes and some of the minor functionality changes into the EQEmu SVN when I get time. But the removed ID boxes, added feature check boxes, and major functionality changes will be left exclusive to my version. I don't want to be blamed when somebody updates their database and it changes all their NPC levels or something similar :)
|
All times are GMT -4. The time now is 11:37 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.