Jump to content

Welcome to FTB Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Usage sections powered by SMW


25 replies to this topic

#1
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

I had this idea...

 

http://ftbwiki.org/U...Recipe_tracking

 

Crafting grid templates could automatically set a SMW subobject storing a single input/output pair. This might not be the best way to store recipes (especially with more than one input AND output) but it is easy to query and use to generate usage lists. These of course won't be full grid templates, but a list of itemrefs of possible output items. Any more detailed information can be found by clicking the link, which would make the usage sections MUCH easier to maintain. If we could make this use Nulifier's dynamic table CSS it would be even better.

 

Technical stuff:

Multiple identical pairs on one page will not duplicate, because SMW uses a hash of the subobject's properties and values to generate "unnamed" names. It might be better to generate names like "Stick -> Wooden Pickaxe" so there won't be any cross-page dupes either.

According to the parser timing data shown during page preview this also shouldn't have any major impact on parsing time, definitely not as bad as the infoboxes :P


  • ZL123 and timrem like this

#2
felinoel

felinoel

    Steampunk Alchemist

  • Administrators
  • 3860 posts
  • Location:Somewhere, possibly?
  • IGN:felinoel
  • Modpack:FTB Mage Quest

Crafting grid templates could automatically set a SMW subobject storing a single input/output pair.

That sounds pretty awesome actually, but there are a LOT of mods and if we are going to document every mod as we plan to then the article for wooden planks would be almost infinitely long...
Watch all of my different Let's Play series, Minecraft and more!
player.me/felinoel


We need to make default article pages! Discuss their designs here!

#3
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2
Queries are by default limited in how many items they show, and the limit can be adjusted for each query. If there are more results than the limit there will be a link to a (paged) full result list. See the infobox on the Minecraft Forge page, the "addon mods" and "modpacks" rows both use limited SMW queries.

#4
RZR0

RZR0

    Administrator

  • Operator
  • 1980 posts
  • IGN:RZR0
  • Modpack:Private Pack

I was actually thinking the same thing the other day. Would make it much easier to keep usage complete and up-to-date. Parsing time isn't really an issue as long as the server load isn't too high, which due to the caching it generally isn't.



#5
felinoel

felinoel

    Steampunk Alchemist

  • Administrators
  • 3860 posts
  • Location:Somewhere, possibly?
  • IGN:felinoel
  • Modpack:FTB Mage Quest

Queries are by default limited in how many items they show

Oh, cool nvm then.
Watch all of my different Let's Play series, Minecraft and more!
player.me/felinoel


We need to make default article pages! Discuss their designs here!

#6
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

FYI, Template:Usage exists now and can be used to make dynamic usage lists. Opinions? If it's fine with everyone we could start using this.



#7
felinoel

felinoel

    Steampunk Alchemist

  • Administrators
  • 3860 posts
  • Location:Somewhere, possibly?
  • IGN:felinoel
  • Modpack:FTB Mage Quest

FYI, Template:Usage exists now and can be used to make dynamic usage lists. Opinions? If it's fine with everyone we could start using this.

Is there any way we could somehow select a specific recipe to not be displayed?

 

Like say random mod from MC Beta 1.2 had a recipe for grass blocks that made a jet engine, we wouldn't want to display that on the grass block article.


  • ZL123 likes this
Watch all of my different Let's Play series, Minecraft and more!
player.me/felinoel


We need to make default article pages! Discuss their designs here!

#8
RZR0

RZR0

    Administrator

  • Operator
  • 1980 posts
  • IGN:RZR0
  • Modpack:Private Pack

FYI, Template:Usage exists now and can be used to make dynamic usage lists. Opinions? If it's fine with everyone we could start using this.

I've noticed duplicates being listed often, is there any way to fix that? http://ftbwiki.org/Booster_Engine



#9
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

Is there any way we could somehow select a specific recipe to not be displayed?

 

Like say random mod from MC Beta 1.2 had a recipe for grass blocks that made a jet engine, we wouldn't want to display that on the grass block article.

Recipes are usually not *that* odd. If someone sees that Glowstone is used for a Collector Mk3, they won't check the page if they don't care. New recipes are often similar to old ones, it is very rare that recipes change so drastically over versions that it would make absolutely no sense to link to them anymore. Even if the new recipe uses e. g. item casings instead of ingots you probably wouldn't wonder "why the heck is this linked here, this makes no sense."

 

I've noticed duplicates being listed often, is there any way to fix that? http://ftbwiki.org/Booster_Engine

I'll need to see what I can do there. SMW has no built-in feature to remove duplicate results (like SELECT DISTINCT in SQL), but it might be possible to use subqueries (if that is a thing in SMW).



#10
felinoel

felinoel

    Steampunk Alchemist

  • Administrators
  • 3860 posts
  • Location:Somewhere, possibly?
  • IGN:felinoel
  • Modpack:FTB Mage Quest

Recipes are usually not *that* odd. If someone sees that Glowstone is used for a Collector Mk3, they won't check the page if they don't care. New recipes are often similar to old ones, it is very rare that recipes change so drastically over versions that it would make absolutely no sense to link to them anymore. Even if the new recipe uses e. g. item casings instead of ingots you probably wouldn't wonder "why the heck is this linked here, this makes no sense."

lol so the answer is no, ok then, just thought I would ask just in case.


Watch all of my different Let's Play series, Minecraft and more!
player.me/felinoel


We need to make default article pages! Discuss their designs here!

#11
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

lol so the answer is no, ok then, just thought I would ask just in case.

Well if it is absolutely necessary we can add a parameter to the crafting grid template that stops the subobject from being set. That would mean that the recipe is never registered and it won't be included in the query.



#12
ZL123

ZL123

    Me.

  • Administrators
  • 2079 posts
  • Location:Not somewhere where people say a fake location to try to be funny
  • IGN:ZL123
  • Modpack:Private Pack

My thoughts:

 

"This will take a long time."

"Should we make a thing indicating which version the crafting recipe is for to address fel's interesting scenario?"

"This will be very cool."

"What about a similar 'Recipe' template?"

"Yes!"

"This is GR8."

"Should we keep the {{Grid/Crafting Table}}s? I mean it is useful to see the actual recipes, but the thing'll be redundant. Can we discuss more on this? Maybe we can have a tooltip-type-thing that appears when you hover over the thing showing you the recipe."

"Yeah."


-ZL123
Hope I helped!

YT: http://youtube.com/ZL234
Twitter: https://twitter.com/ZL234


#13
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

Err, we need actual grids in either the recipe or the usage section at least. We can't make both dynamic, else where are the recipes going to come from? :P In any case I think it's a good idea to have the recipes for an item always visible as a crafting grid. Unlike with the usage section you usually want to see the full recipe for the item right away.
 

The following items are used to craft the Quarry: Diamond Pickaxe, Diamond Gear, Gold Gear, Iron Gear, Redstone
 
Gee thanks. Now would you please tell me in what frickin' order I place those in the workbench?


  • ZL123 and felinoel like this

#14
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

Regarding the duplicates, it is apparently not possible to nest #asks, which means that subqueries are not possible. (They would have also caused the "full list" overflow link to disappear.) However it looks like another change I made a week ago (setting the subobject only if output item == page name) also causes none of the recipes to be registered more than once - subobjects are named after the page they are on, plus a custom name including the input and output item names. This means that equal combinations on one page will not register twice, and on other pages they aren't registered at all. There are probably still duplicates somewhere, because this change was made some time after the recipe tracking was added, so in the time between the two edits a few recipes were registered twice.



#15
RZR0

RZR0

    Administrator

  • Operator
  • 1980 posts
  • IGN:RZR0
  • Modpack:Private Pack

There are probably still duplicates somewhere, because this change was made some time after the recipe tracking was added, so in the time between the two edits a few recipes were registered twice.


I don't quite follow what it is you mean. My understanding of SMW is limited as I still haven't had the time to properly study how it works.

The example I started with now displays without duplicates, but this one for example doesn't: http://ftbwiki.org/Cooling_Core
I'm guessing you mean that the recipe is registered on 2 pages, which causes the duplicates? In that case, is there a way to track down on which pages they were registered with a query to SMW?

Also, I put it up on this page: http://ftbwiki.org/Heat_Vent#Usage
But it doesn't list http://ftbwiki.org/Component_Heat_Vent

#16
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

Those are caching issues - you need to purge any pages where the duplicate item is listed in a usage section, and then the page on which the duplicates are listed. Then the duplicate should disappear.



#17
RZR0

RZR0

    Administrator

  • Operator
  • 1980 posts
  • IGN:RZR0
  • Modpack:Private Pack

Those are caching issues - you need to purge any pages where the duplicate item is listed in a usage section, and then the page on which the duplicates are listed. Then the duplicate should disappear.


Oh ok. I'll do a server-wide purge later then.

Hmm... I've added the template to the Wooden Gear and Stone Gear pages. They show each show duplicates for the Redstone Engine and Stirling Engine respectively. I've purged the pages, but unlike with other duplicates, that didn't seem to solve the issue.



#18
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

The Engine article still had a grid template that wasn't purged yet. A full purge of all pages is indeed the easiest solution in this case, there are just too many pages with grids like these where you don't expect them.



#19
felinoel

felinoel

    Steampunk Alchemist

  • Administrators
  • 3860 posts
  • Location:Somewhere, possibly?
  • IGN:felinoel
  • Modpack:FTB Mage Quest

Oh it only lists what it is used in, not the entire recipe for what it is used in, that would save a lot of space compared to how I imagined it.


Watch all of my different Let's Play series, Minecraft and more!
player.me/felinoel


We need to make default article pages! Discuss their designs here!

#20
RZR0

RZR0

    Administrator

  • Operator
  • 1980 posts
  • IGN:RZR0
  • Modpack:Private Pack

The Engine article still had a grid template that wasn't purged yet. A full purge of all pages is indeed the easiest solution in this case, there are just too many pages with grids like these where you don't expect them.

I've purged the object caching server. The wiki might respond a bit slower until things are recached, but that should take care of it I hope.


  • timrem and dgelessus like this



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users