Cuberite Forum
*** Recipe Updates *** - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: *** Recipe Updates *** (/thread-423.html)

Pages: 1 2 3 4 5 6 7 8


RE: *** Recipe Updates *** - Luksor - 06-03-2012

(06-03-2012, 08:39 PM)xoft Wrote: Luksor, I put the items.ini in. I decided not to delete most of the stuff you deleted, for compatibility reasons. So the lightstonedust stays Smile
OkTongue


RE: *** Recipe Updates *** - NiLSPACE - 06-03-2012

creating a map is more difficult than i thougd Sad it confuses me that you say something different then the recipe.txt Sad are there 2 ways??
yay got it Smile the line is 3x3,1:2:339:1,1:3:339:1,1:1:339:1,2:1:339:1,3:1:339:1,3:2:339:1,3:3:339:1,2:3:339:1,2:2:345:1@358:1 #-> Map


RE: *** Recipe Updates *** - xoft - 06-03-2012

I was proposing a new format to replace the current recipes.txt format:
https://forum.cuberite.org/showthread.php?tid=423&pid=3096#pid3096


RE: *** Recipe Updates *** - xoft - 06-03-2012

I have written a parser for the new grammar, its code is even a bit shorter than the old parser, and I'd say it's much more cleaner, as it's separated into several functions etc.

Now I need to write the recipe matching - get the recipe that represents the current arrangement on the crafting table. This is gonna be a bit more difficult Smile
It seems that the "*:2"-style coords would make the recipe matcher too complicated. I think I'll step down from that feature. So the coord grammar is revised:
Code:
<IngredientN> = <ItemType>, <Coord1>, <Coord2>, ... <CordN>
<CoordN> = <X>:<Y> or *
This means that either full coords must be given, or a single asterisk, meaning "anywhere".

Note that "anywhere" may match already matched items, so the following recipe wouldn't work:
Code:
# Sticks:
Planks, *, * | Stick, 4
# This would match even a single pile of at least 2 planks



RE: *** Recipe Updates *** - FakeTruth - 06-04-2012

I like your recipes syntax much more than the one used right nowTongue

The only difficulty I see with it, is comparing the user input to a recipe with the "*:2"-style coordsTongue Which you already seem to have encountered


RE: *** Recipe Updates *** - Luksor - 06-04-2012

I'm leaving on a school trip tomorrow, so i wont be able to work on the recipes until Thursday.
See you later. Wink


RE: *** Recipe Updates *** - xoft - 06-04-2012

I'll keep both recipe formats in for the time being, then. If I manage to finish them at all Smile

FakeTruth, I'm glad you like it. I hope you'll like the parser, too Smile
It seems that I accidentally managed to get even the "*:1" coords working. The only problem with them is if you combine two such definitions in a crossing directions, such as "*:1, 1:*". Then the recipe matcher may be unable to match the recipe to a crafting grid of "1:1, 2:1". But hey, I don't think there's any such recipe Smile


RE: *** Recipe Updates *** - xoft - 06-04-2012

A few details:

Which of the following formats do you think is the best?
Format 1 (as specified earlier):
Code:
<Ingredient1> | <Ingredient2> | ... | <IngredientN> | <Result>
Stick, 2:2, 2:3 | Cobblestone, 2:1, *:1 | StoneHoe

Format 2
Code:
<Result> | <Ingredient1> | <Ingredient2> | ... | <IngredientN>
StoneHoe | Stick, 2:2, 2:3 | Cobblestone, 2:1, *:1

Format 3
Code:
<Ingredient1> + <Ingredient2> + ... + <IngredientN> = <Result>
Stick, 2:2, 2:3 + Cobblestone, 2:1, *:1 = StoneHoe

Format 4
Code:
<Result> = <Ingredient1> + <Ingredient2> + ... + <IngredientN>
StoneHoe = Stick, 2:2, 2:3 + Cobblestone, 2:1, *:1

Or a different one?
Wife says the best format is this one:
Code:
<Result> = <Ingredient1> | <Ingredient2> | ... | <IngredientN>
StoneHoe = Stick, 2:2, 2:3 | Cobblestone, 2:1, *:1
Planks^0, 4 = Log^0, *
She was preferring the + as the divider, until she noticed we're using a * for coords, and it's too close to + visually.


RE: *** Recipe Updates *** - Taugeshtu - 06-04-2012

Listen to your wife Smile I like 5 format the most


RE: *** Recipe Updates *** - FakeTruth - 06-04-2012

Smart wifeBig Grin