Schematics question and suggestion

Submit ideas and suggestions on how we display, catalogue and export the schematics.

Moderator: Forum Moderator

Post Reply
Gwreng
Novice Crafter
Posts: 12
Joined: Mon Dec 29, 2008 4:01 pm

Schematics question and suggestion

Post by Gwreng » Mon Dec 29, 2008 4:19 pm

Hello,

I was wondering when a schematic is listed and it has multiple sub components does the total resources used include sub components?

For example http://www.swgcraft.co.uk/dev/viewschem ... ?schem=997

The total resources used is 27,770
Requires a few sub components, are the sub components included in the total resources?

I wrote a program some years ago called Tailor's Buddy. I hand typed all of the data from this website into the program. I have considered expanding this program, but it would take me months to hand type all of the information on total resources used.

Is there any API, that you have that will share the total resources for a schematic? Using the previous example, I would need to be able to import the total resources used, and the schematic name. An xml format for this would be great.

Thanks,
Gwreng

User avatar
Sobuno
Developer
Posts: 2589
Joined: Sun Mar 25, 2007 2:17 am
Contact:

Re: Schematics question and suggestion

Post by Sobuno » Mon Dec 29, 2008 5:16 pm

Yes, the subcomponents are included (See http://www.swgcraft.co.uk/dev/viewschem ... ?schem=746, in that one you can toggle the optional subcomponents on and off and the page will reflect that)

There is a file containing schematics data, it auto-updates on the 1st of every month: http://www.swgcraft.co.uk/dev/sendfile. ... =schem.xml. It is still in development though, and the structure may change

Gwreng
Novice Crafter
Posts: 12
Joined: Mon Dec 29, 2008 4:01 pm

Re: Schematics question and suggestion

Post by Gwreng » Mon Dec 29, 2008 5:39 pm

Brilliant! Thanks!

Gwreng
Novice Crafter
Posts: 12
Joined: Mon Dec 29, 2008 4:01 pm

Re: Schematics question and suggestion

Post by Gwreng » Mon Dec 29, 2008 5:48 pm

Been looking at the way the xml data, I'm having trouble seeing where the total resource count is? Is this included in it or is it split up based off resource?

User avatar
Sobuno
Developer
Posts: 2589
Joined: Sun Mar 25, 2007 2:17 am
Contact:

Re: Schematics question and suggestion

Post by Sobuno » Mon Dec 29, 2008 6:44 pm

Gwreng wrote:Been looking at the way the xml data, I'm having trouble seeing where the total resource count is? Is this included in it or is it split up based off resource?
The total resource count is not listed, but should be able to be calculated based on the information present in the file.

Gwreng
Novice Crafter
Posts: 12
Joined: Mon Dec 29, 2008 4:01 pm

Re: Schematics question and suggestion

Post by Gwreng » Mon Dec 29, 2008 7:04 pm

Sobuno wrote:
Gwreng wrote:Been looking at the way the xml data, I'm having trouble seeing where the total resource count is? Is this included in it or is it split up based off resource?
The total resource count is not listed, but should be able to be calculated based on the information present in the file.

K Thanks, I will be playing around with this for a little bit. I presume that this does not include sub components then if I have to calculate the total resources myself?

User avatar
Sobuno
Developer
Posts: 2589
Joined: Sun Mar 25, 2007 2:17 am
Contact:

Re: Schematics question and suggestion

Post by Sobuno » Mon Dec 29, 2008 7:43 pm

Gwreng wrote:
Sobuno wrote:
Gwreng wrote:Been looking at the way the xml data, I'm having trouble seeing where the total resource count is? Is this included in it or is it split up based off resource?
The total resource count is not listed, but should be able to be calculated based on the information present in the file.

K Thanks, I will be playing around with this for a little bit. I presume that this does not include sub components then if I have to calculate the total resources myself?
Not if you just add up the <resource> entries, that would only be the item itself, you would have to go to the entry for each component and add them up aswell as their subcomponents etc.

Gwreng
Novice Crafter
Posts: 12
Joined: Mon Dec 29, 2008 4:01 pm

Re: Schematics question and suggestion

Post by Gwreng » Mon Dec 29, 2008 9:27 pm

Thanks for getting this data out I really appreciate it :D. I'd be able to use it almost immediately I think if it had a total resources.

I'm not that great with XML, so I'm still learning a bit. I've been playing with it in .Net, and a few other programs and so far I've been able to pull out some of the basic data. Although one thing that causes some confusion, especially if I were to create a dataset, or something like that you have in the <schematic> tag, an attribute of swgcraft_id, as well as in the <resources> tag. Also not every item in the list has swgcraft ID in the <schematic> tag like the acidic paragon vibro axe for example. So I'm having trouble finding a field that I could use as a primary key, do you have any suggestions?

User avatar
Sobuno
Developer
Posts: 2589
Joined: Sun Mar 25, 2007 2:17 am
Contact:

Re: Schematics question and suggestion

Post by Sobuno » Mon Dec 29, 2008 9:36 pm

Every <schematic> is supposed to contain an unique swgcraft_id, I lack the imagination to come up with proper ones though, so most recently-added schematics lack it.

The swgcraft_id for the <resource> tags relate that resource to its full name, found here: http://www.swgcraft.co.uk/dev/sendfile. ... cetree.xml

Gwreng
Novice Crafter
Posts: 12
Joined: Mon Dec 29, 2008 4:01 pm

Re: Schematics question and suggestion

Post by Gwreng » Wed Dec 31, 2008 2:15 pm

Alrighty :) what about just assigning it a sequential number to the schematic? Keep swgcraft_id for the resources etc, but give schematics a Schematic_ID or every item in the database a Item_ID with in the <schematic> tag. Would be a lot easier than having to make them up based on the names.

User avatar
Sobuno
Developer
Posts: 2589
Joined: Sun Mar 25, 2007 2:17 am
Contact:

Re: Schematics question and suggestion

Post by Sobuno » Wed Dec 31, 2008 3:26 pm

Gwreng wrote:Alrighty :) what about just assigning it a sequential number to the schematic? Keep swgcraft_id for the resources etc, but give schematics a Schematic_ID or every item in the database a Item_ID with in the <schematic> tag. Would be a lot easier than having to make them up based on the names.
Yep, that's what is being considered at the moment. The file was requested by the SWGAide developers so I usually ask them before making any changes.

I've added an attribute named id, so the <schematic> tag now looks like this:

Code: Select all

<schematic name="Advanced Camp" id="920" swgcraft_id="advcamp">
and the component tag looks like this:

Code: Select all

<component id="1444" swgcraft_id="chreun" name="Chemical Reactive Unit" number="1" identical="no" optional="no" looted_only_component="no" description="" /> 
or (For categories)

Code: Select all

<component id="N/A" swgcraft_id="N/A" name="Drink Container" number="1" identical="no" optional="no" looted_only_component="no" description="N/A" /> 
I started the script for generating a file manually (It normally runs on the 1st of every month so a new file will be generated tomorrow too), so a new file should be up for download now.

Gwreng
Novice Crafter
Posts: 12
Joined: Mon Dec 29, 2008 4:01 pm

Re: Schematics question and suggestion

Post by Gwreng » Wed Dec 31, 2008 3:37 pm

Ah that is brilliant! Thanks :)

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests