[INACTIVE][MECH] Transmute v0.9 - Alchemy with blocks [740]

Discussion in 'Inactive/Unsupported Plugins' started by Uristqwerty, Apr 27, 2011.

  1. Offline

    Uristqwerty

    Transmute - Alchemy with blocks
    Version: v0.9

    This plugin is rather simple: Once enabled, it reads a text file that defines a number of patterns, each with a pattern of blocks to look for, a pattern of blocks to replace it with, and a trigger to tell it when to check.

    When the triggering event occurs (for example, a player igniting the centre log in a square of logs with their flint and steel), the plugin looks for every pattern that matches the trigger (ignite space above log with flint and steel), and then, if it finds a matching pattern, replaces nearby blocks according to that pattern.

    Features:
    * Fully configurable pattern replacement.
    * Only responds to events
    * Supports 3D patterns, and rotation/mirroring. Each can be enabled/disabled individually for each pattern!
    * Pattern file can include additional files, included files inheriting comparison definitions from it's parent file!

    Download:
    v0.9: Attached file, or <Edit by Moderator: Redacted mediafire url>
    v0.2: Attached file, or <Edit by Moderator: Redacted mediafire url>
    v0.1: Attached file, or <Edit by Moderator: Redacted mediafire url>


    For an example,
    [​IMG]

    becomes a fairly plain, instant, 3d house! Just add fire!

    [​IMG]

    (Note: Some installation required: the door didn't appear correctly, though that could have been a mistake in the definition)

    [​IMG]

    (That entire house? It's defined in a text file, easily editable in your editor of choice. I wrote it in notepad!


    Show Spoiler
    Code:
    comparison d
    [
        = multi
    
        1 = dirt
        2 = grass
    ]
    
    comparison a = air
    comparison g = 14
    comparison * [find = any; replace = unchanged]
    comparison w = wood
    comparison D = 64
    comparison G = glass
    comparison L = log
    
    pattern house
    [
    
        3d = true
    
        find
        [
          0 [
                0 = "Lddggddd"
                1 = "ddgddgdd"
                2 = "dgddddgd"
                3 = "gddddddg"
                4 = "dgdgddgd"
                5 = "dgdgddgd"
                6 = "dggggggd"
                7 = "dddddddd"
            ]
          1 [
                0 = "aaaaaaaa"
                1 = "aaaaaaaa"
                2 = "aaaaaaaa"
                3 = "aaaaaaaa"
                4 = "aaaaaaaa"
                5 = "aaaaaaaa"
                6 = "aaaaaaaa"
                7 = "aaaaaaaa"
            ]
          2 [
                0 = "aaaaaaaa"
                1 = "aaaaaaaa"
                2 = "aaaaaaaa"
                3 = "aaaaaaaa"
                4 = "aaaaaaaa"
                5 = "aaaaaaaa"
                6 = "aaaaaaaa"
                7 = "aaaaaaaa"
            ]
          3 [
                0 = "aaaaaaaa"
                1 = "aaaaaaaa"
                2 = "aaaaaaaa"
                3 = "aaaaaaaa"
                4 = "aaaaaaaa"
                5 = "aaaaaaaa"
                6 = "aaaaaaaa"
                7 = "aaaaaaaa"
            ]
          4 [
                0 = "*aaaaaa*"
                1 = "*aaaaaa*"
                2 = "*aaaaaa*"
                3 = "*aaaaaa*"
                4 = "*aaaaaa*"
                5 = "*aaaaaa*"
                6 = "*aaaaaa*"
                7 = "*aaaaaa*"
            ]
          5 [
                0 = "**aaaa**"
                1 = "**aaaa**"
                2 = "**aaaa**"
                3 = "**aaaa**"
                4 = "**aaaa**"
                5 = "**aaaa**"
                6 = "**aaaa**"
                7 = "**aaaa**"
            ]
          6 [
                0 = "***aa***"
                1 = "***aa***"
                2 = "***aa***"
                3 = "***aa***"
                4 = "***aa***"
                5 = "***aa***"
                6 = "***aa***"
                7 = "***aa***"
            ]
        ]
    
        replace
        [
          0 [
                0 = "ssssssss"
                1 = "swwwwwws"
                2 = "swwwwwws"
                3 = "swwwwwws"
                4 = "swwwwwws"
                5 = "swwwwwws"
                6 = "swwwwwws"
                7 = "ssssssss"
            ]
          1 [
                0 = "wwDwwwww"
                1 = "waaaaaaw"
                2 = "waaaaaaw"
                3 = "waaaaaaw"
                4 = "waaaaaaw"
                5 = "waaaaaaw"
                6 = "waaaaaaw"
                7 = "wwwwwwww"
            ]
          2 [
                0 = "wwawwGww"
                1 = "waaaaaaw"
                2 = "waaaaaaw"
                3 = "Gaaaaaaw"
                4 = "Gaaaaaaw"
                5 = "waaaaaaw"
                6 = "waaaaaaw"
                7 = "wwwwwwww"
            ]
          3 [
                0 = "wwwwwwww"
                1 = "waaaaaaw"
                2 = "waaaaaaw"
                3 = "waaaaaaw"
                4 = "waaaaaaw"
                5 = "waaaaaaw"
                6 = "waaaaaaw"
                7 = "wwwwwwww"
            ]
          4 [
                0 = "*wwwwww*"
                1 = "*waaaaw*"
                2 = "*waaaaw*"
                3 = "*waaaaw*"
                4 = "*waaaaG*"
                5 = "*waaaaG*"
                6 = "*waaaaw*"
                7 = "*wwwwww*"
            ]
          5 [
                0 = "**wwww**"
                1 = "**waaw**"
                2 = "**waaw**"
                3 = "**waaw**"
                4 = "**waaG**"
                5 = "**waaG**"
                6 = "**waaw**"
                7 = "**wwww**"
            ]
          6 [
                0 = "***ww***"
                1 = "***ww***"
                2 = "***ww***"
                3 = "***ww***"
                4 = "***ww***"
                5 = "***ww***"
                6 = "***ww***"
                7 = "***ww***"
            ]
        ]
        trigger
        [
            type = "ignite"
            offset = "(0, 0, 0)"
        ]
    
        symmetry
        [
            rotate = true
        ]
    ]



    This is still a fairly early version, and there is still plenty of room for improvement (more trigger types, a better selection of default patterns, etc.), so your feedback is greatly appreciated.

    The source is in the jar, and a few pattern files are included as well. Some of the pattern files are meant to be examples, so tend to use many features, even if they aren't needed.

    Note: There are NO special block checks, so if putting the wrong two blocks next to each other crashes the server or corrupts the save, don't create a pattern that could put them together.


    Changelog:
    Version 0.9
    * Some potential NPEs prevented
    * Not comparison type (acts just like multi, but fails if any of the contained comparisons are false)
    * New patterns, old ones disabled but not removed. The new ones focus on "alchemy" (converting block types), currently just a series of reactions for converting logs -> coal -> iron -> gold -> diamond (taking 4 each step to produce 1, plus an additional log to fuel each reaction, for a total of 5 stacks and 21 logs per block of diamond ore. Note that this allows players to gather diamond ore and coal ore blocks, not normally obtainable in-game
    * find and replace properties can have an ignore-spaces property. If true, and spaces before and after a comparison name are ignored.

    Version 0.2
    * Damage event
    * Block data values for both find and replace
    * Simple patterns, that avoid having to use comparisons
    * Multiple triggers per pattern
    * Triggers can require certain item types

    Version 0.1
    * First public version
     

    Attached Files:

    Last edited by a moderator: Dec 14, 2016
    kahlilnc likes this.
  2. Offline

    Plague

    You need to provide a link to download for non-members
    Also please move features to the top
     
  3. Offline

    kahlilnc

    I like the idea. I will try.
     
  4. Offline

    ChaoticTrack

    What brick I use? Whenever I do it on stone, if it has a space open anywhere next to it, it moves.
     
  5. Offline

    Uristqwerty

    Yeah...

    It comes with a set of patterns that would best be described as a demonstration more than anything useful. One of the examples is that a stone block will swap with a neighboring air block, as an example showing the option to automatically create rotated copies of a pattern, so that it doesn't have to face, for example, north.

    Actually, I think I should write a quick overview of the pattern syntax:


    (Sorry, this will be long and tedious, I'm going to try not to make any assumptions about what you might already know, and since it uses a custom data format, it means starting with the basics of what that format can do.)


    It uses a custom file format, where each of the following mean the same thing:

    Code:
    a.b.c = 5
    a.b.d = 6
    Code:
    a b c = 5
    a b d = 6
    Code:
    a[b.c = 5
    b.d = 6]
    Spaces and new lines are unnecessary, as long as it can clearly find the breaks between the words (or whatever you want to call them).

    Using quotes, you can specify things that contain spaces and other special characters.

    If you write a \, then the next character is read literally, ignoring any other meaning (That means that, as most programmers are familliar with, you put a literal quotation mark in a quoted string "like \" this".) As a special case, \n is interpreted as a newline character that is part of a word, and \t is a tab character.

    A \ at the end of a line will make it continue reading onto the next line as if it was all one line.

    A # makes it ignore the rest of the line, useful for leaving comments or temporarily removing parts of the file.

    Now, most of that is just unnessecarily fancy, and you probably don't care about it, but it's rather basic, so it's good to know.

    Next, the important parts of the file syntax: Spaces, periods, tabs, newlines, and closing quotes mark the end of a word or quoted phrase. If you write a series of words/phrases, it will interpret each one as an extra bit of information added on to the last. So, config.bukkit.something would be read as "config" has a property called "bukkit" that has a property called "something". A pair of square brackets means that a word/phrase has multiple properties, and they are each listed in the square brackets.

    An equal sign assigns a value to a property and any words after the value start as an entirely new property for the current innermost pair of []s, or, if there are none, the file itself.


    Still reading? Now onto the useful stuff: The words that this plugin looks for:

    First it looks for comparisons. Each comparison is a property of "comparison".

    For a simple comparison, you would use something like
    Code:
    comparison a = air
    Since if the comparison only has a value, and no properties, it's value is read as a block name, a block id, or "any" (which means anything).

    If the comparison has a replace property, then it means that it behaves differently when used to describe what replaces the old blocks, and the value of the replace property is used instead of the value of the name of the comparison. The replace property has a few special things as well. If the value is "unchanged", it means that it doesn't do anything when replacing a block. Very useful for filling space, like in

    Code:
    comparison * [find = any; replace = unchanged]
    (if a comparison has a find property, it uses the value of that instead of the value of the comparison name when checking to see if a pattern matches the blocks that you just interacted with)

    a replace property can have an item property, which, if it is "true", will replace the block with air, and make it drop the item version of the block that would otherwise have been created.


    Code:
    comparison {si} = stone
    comparison {si}.replace = stone
    comparison {si}.replace.item = true
    (You don't need the {}s, I have just used them in my examples where a comparison name is more than one character long to clearly mark it as more than one character long. This will become more important later one, once I get to patterns.)


    One last comparison feature, if the value is "multi", then it will match any of a number of blocks when searching. Each of those blocks should be expressed as a property of the comparison thst is named with a positive integer.

    Code:
    comparison d
    [
        = multi
    
        1 = dirt
        2 = grass
    ]


    Okay, finally on to patterns, the relatively interesting part.

    A pattern tells Transmute about a certain pattern of blocks to look for in response to an event, and, if it finds it, what to replace them with.

    I'll explain them by describing how the following example pattern works:

    Code:
    pattern rotateTest
    [
        find
        [
            0 = "sa"
        ]
    
        replace
        [
            0 = "as"
        ]
    
        trigger
        [
            type = "ignite"
            offset = "(0, 0)"
        ]
    
        symmetry
        [
            rotate = true
            flip = false
        ]
    ]
    First, the find property: It should have a number of properties of it's own, each should be an integer, describing how many z rows that row of the pattern is offset from the "top left corner if viewed from above with north(or some other direction, I don't really know.) facing towards the top of your screen" (a negative number would mean further than the top of your screen).

    Since this example only has one row, it is numbered 0 for simplicity.

    The value of the row should be a string of comparison names. It goes through it, looking for a comparison name that matches, and, if it finds one, it starts looking for the next one right after the end of the one it just found. If it could match more than one comparison name, it could pick any one of them, so it is best to keep comparison names that are more than one character long distinct from the rest, so that it isn't confused about which one to use.

    As a quick side note, it breaks

    Code:
    comparison a = air
    comparison "{si}" = stone
    comparison "{si}".replace = stone
    comparison "{si}".replace.item = true
    
    ...
    2 = "a{si}{si}{si}a"
    ...
    down into "air, stone item, stone item, stone item, air" (well, not like that, it's far more complex and computery, and unless you were a programmer you wouldn't understand. For programmers: It breaks it down into a series of references to the previously defined comparisons, all implementing a shared comparson interface (a different interface for find than for replace comparisons, though), and then stores them by pairing them with a 3d offset in a HashMap)


    Next, the replacement:
    Basically, the same as the find property, except instead of looking for a pattern that matches the nearby blocks, it's replacing the nearby blocks that it already found with a new set, perhaps slightly altered.


    Then, the trigger property:
    It has two important properties, type (currently must be "ignite"), and an offset from the imaginary top left corner of 0, 0 where the pattern needs to be interacted with to trigger it. In most of my examples, there has been a log there.


    The find, replace, and trigger properties are mandatory, otherwise the pattern will be skipped.


    There are two extra properties that don't have to be used:
    symmetry can have two properties, rotate and flip, which tells the plugin if it should create rotated and/or flipped copies of the pattern, so that you only have to describe the pattern once, even if it isn't symmetrical, and the plugin will check the different rotations.

    For example,

    Code:
    
        symmetry
        [
            rotate = true
            flip = false
        ]
    tells it to create a copy of the pattern facing north, one facing south, one facing east, and one facing west.

    patterns can also have the 3d property which, if "true", instead of listing rows in the find and replace properties, you list layers, and each layer lists rows. Check 3d.txt for some examples.


    One final point:
    along side comparisons and patterns, you also have includes. Basically,
    Code:
    include "3d.txt";
    
    (the semicolon IS required)

    tells it to, once it finishes reading this file, go through 3d.txt as well.
    In the included file, when looking for matching comparisons for the patterns, it tries the comparisons defined in that file first, then it goes through the file that included it, and if it still can't find any, tries the file that included that one, and so on.


    Now, one last thing.

    Just to make sure you understand, lets go through the process of creating a new pattern.

    We will create a pattern that allows you to quickly "draw" a 3-wide road of cobblestone, with the middle row replaced with lightstone. It will be in the shape of an arrow, and lighting different parts of it will rotate it, move it forwards, or finish building the road.

    First, we will need a few comparisons.

    Code:
    comparison * [find = any; replace = unchanged]
    comparison c = cobblestone
    comparison G = 89   #the id of glowstone is 89
    comparison O = obsidian
    
    Next, lets make the arrow move forward.

    Code:
    pattern roadmaker_forward
    [
    find [
      0 = "***"
      1 = "*O*"
      2 = "OcO"
      3 = "*G*"]
    
    replace [
      0 = "*O*"
      1 = "OcO"
      2 = "*G*"
      3 = "***"]
    ]
    Now, it needs a trigger. We will have it trigger when the "tip" of the arrow is lit (in the find pattern, one row down and one character right, so (1, 1)).
    We will also tell it that we don't care about what direction it is pointing.
    The forward pattern is now

    Code:
    pattern roadmaker_forward
    [
    find [
      0 = "***"
      1 = "*O*"
      2 = "OcO"
      3 = "*G*"]
    replace [
      0 = "*O*"
      1 = "OcO"
      2 = "*G*"
      3 = "***"]
    trigger [
      type = "ignite"
      offset = "(1, 1)"]
    symmetry [
      rotate = true]
    ]
    Great!

    Next, we want to be able to rotate it 90 degrees left or right by igniting that side of the arrow.

    This is just about the same as the other one, so I won't go into much detail. Basically, turn left if the left side is lit. However, also tell it that you don't mind if the pattern is mirrored, so you also get a free "ignite right to turn right"!

    To get it to rotate around the glowstone, just make the glowstone the centre of the pattern (at (0, 0), or by padding the sides).

    Code:
    pattern roadmaker_turn
    [
    find [
      0 = "**O**"
      1 = "*OcO*"
      2 = "**G**"
      3 = "*****"
      4 = "*****"]
    replace [
      0 = "*****"
      1 = "*O***"
      2 = "OcG**"
      3 = "*O***"
      4 = "*****"]
    trigger [
      type = "ignite"
      offset = "(1, 1)"]
    symmetry [
       rotate = true
      flip = true]
    ]
    Now, just one one last pattern. To make it easy to cleanup when you are done:

    Code:
    pattern roadmaker_remove
    [
    find [
      0 = "*O*"
      1 = "OcO"
      2 = "*G*"]
    replace [
      0 = "ccc"
      1 = "cGc"
      2 = "*G*"]
    trigger [
      type = "ignite"
      offset = "(1, 1)"]
    symmetry [
      rotate = true]
    ]

    (Unexpectedly, each of those three triggered at (1, 1). It's only a coincidence, though, try looking at other examples to see some different trigger offsets)


    So, putting them together, we have

    Code:
    comparison * [find = any; replace = unchanged]
    comparison c = cobblestone
    comparison G = 89  #the id of glowstone is 89
    comparison O = obsidian
     
    pattern roadmaker_forward
    [
    
    find [
      0 = "***"
      1 = "*O*"
      2 = "OcO"
      3 = "*G*"]
    
    replace [
      0 = "*O*"
      1 = "OcO"
      2 = "cGc"
      3 = "***"]
    
    trigger [
      type = "ignite"
      offset = "(1, 1)"]
    
    symmetry [
      rotate = true]
    
    ]
     
    pattern roadmaker_turn
    [
    
    find [
      0 = "**O**"
      1 = "*OcO*"
      2 = "**G**"
      3 = "*****"
      4 = "*****"]
    
    replace [
      0 = "**c**"
      1 = "*Occ*"
      2 = "OcG**"
      3 = "*O***"
      4 = "*****"]
    
    trigger [
      type = "ignite"
      offset = "(1, 1)"]
    
    symmetry [
      rotate = true
      flip = true]
    
    ]
    
    pattern roadmaker_remove
    [
    
    find [
      0 = "*O*"
      1 = "OcO"
      2 = "*G*"]
    
    replace [
      0 = "ccc"
      1 = "cGc"
      2 = "*G*"]
    
    trigger [
      type = "ignite"
      offset = "(1, 1)"]
    
    symmetry [
      rotate = true]
    
    ]
    Actually, a considerable ammount of text, but hopefully you can see how it is broken down into simple steps.

    (Side note: After I finished, I tried it in-game. It worked (woo), except it didn't replace the old obsidian with cobblestone as it moved (ugh). Corrected that mistake, it it worked even better than I expected!)
    (Oh, and the fires were a problem. Once I upgrade it to allow more than just the ignite event, though, that shouldn't be an issue)
     
  6. Offline

    ShockBuddy

    A Generator Will be fine for that, it looks very difficult!
     
  7. Offline

    matttman8910

    Soooooo... I am very confused as to how am I supposed to use this plugin (I tried to make the house from the picyures but for some reason it wouldn't work). Help anyone?
     
  8. Offline

    TheGurw

    i like this....but is it possible to make it compatible with a blueprint plugin, so as to be easier for non-coding people (like myself)?
     
  9. Offline

    Deej1990

    Great plugin! I expect to have a lot of fun tinkering with possible transmutes in the near future thanks to this.

    I also created a really cheesy 3d heart to make sure I understood the process.

    Code:
    comparison p = 79
    comparison P = 80
    
    pattern heart
    [
    
        3d = true
    
        find
        [
          0 [
                0 = "L******"
                1 = "**s*s**"
                2 = "*s*s*s*"
                3 = "*s***s*"
                4 = "**s*s**"
                5 = "***s***"
                6 = "*******"
            ]
          1 [
                0 = "*******"
                1 = "*******"
                2 = "*******"
                3 = "*******"
                4 = "*******"
                5 = "*******"
                6 = "*******"
            ]
          2 [
                0 = "*******"
                1 = "*******"
                2 = "*******"
                3 = "*******"
                4 = "*******"
                5 = "*******"
                6 = "*******"
            ]
          3 [
                0 = "*******"
                1 = "*******"
                2 = "*******"
                3 = "*******"
                4 = "*******"
                5 = "*******"
                6 = "*******"
            ]
          4 [
                0 = "*******"
                1 = "*******"
                2 = "*******"
                3 = "*******"
                4 = "*******"
                5 = "*******"
                6 = "*******"
            ]
          5 [
                0 = "*******"
                1 = "*******"
                2 = "*******"
                3 = "*******"
                4 = "*******"
                5 = "*******"
                6 = "*******"
            ]
          6 [
                0 = "*******"
                1 = "*******"
                2 = "*******"
                3 = "*******"
                4 = "*******"
                5 = "*******"
                6 = "*******"
            ]
        ]
    
        replace
        [
          0 [
                0 = "aaaaaaa"
                1 = "aaaaaaa"
                2 = "aaaaaaa"
                3 = "aasssaa"
                4 = "aaaaaaa"
                5 = "aaaaaaa"
                6 = "aaaaaaa"
            ]
          1 [
                0 = "aaaaaaa"
                1 = "aaaaaaa"
                2 = "aaaaaaa"
                3 = "asspssa"
                4 = "aaaaaaa"
                5 = "aaaaaaa"
                6 = "aaaaaaa"
            ]
          2 [
                0 = "aaaaaaa"
                1 = "aaaaaaa"
                2 = "aaaaaaa"
                3 = "sspPpss"
                4 = "aaaaaaa"
                5 = "aaaaaaa"
                6 = "aaaaaaa"
            ]
          3 [
                0 = "aaaaaaa"
                1 = "aaaaaaa"
                2 = "aaaaaaa"
                3 = "spPPPps"
                4 = "aaaaaaa"
                5 = "aaaaaaa"
                6 = "aaaaaaa"
            ]
          4 [
                0 = "aaaaaaa"
                1 = "aaaaaaa"
                2 = "aaaaaaa"
                3 = "spPpPps"
                4 = "aaaaaaa"
                5 = "aaaaaaa"
                6 = "aaaaaaa"
            ]
          5 [
                0 = "aaaaaaa"
                1 = "aaaaaaa"
                2 = "aaaaaaa"
                3 = "sspspss"
                4 = "aaaaaaa"
                5 = "aaaaaaa"
                6 = "aaaaaaa"
            ]
          6 [
                0 = "aaaaaaa"
                1 = "aaaaaaa"
                2 = "aaaaaaa"
                3 = "asssssa"
                4 = "aaaaaaa"
                5 = "aaaaaaa"
                6 = "aaaaaaa"
            ]
        ]
        trigger
        [
            type = "ignite"
            offset = "(0, 0, 0)"
        ]
    
        symmetry
        [
            rotate = true
        ]
    
    ]
    This obviously requires the patterns.txt and a few of the comparisons listed from the house pattern in the 3d.txt (which is where I placed this script), but that's a given.

    However, I do have one question. I started with "p" and "P" because I was going to use pink and purple wool. The system seems to recognize original decimal data values for the blocks, but I'm not sure how to cycle through the different colors of wool (35-1, 35-2, etc.) or if it's even possible. Keep up the good work!
     
  10. Offline

    Uristqwerty

    No, block data can't be checked yet.

    However, I have decided to work on, next:
    - Block data (wool colour, etc.)
    - a simple format (I'm thinking of someting like:
    Code:
    simple pattern aaaawhatever [
      find =
    "00 00 80 80 80 00 00,
     00 80 80 ** 80 80 00,
     80 80 12 12 12 80 80,
     80 ** 12 04 12 ** 80,
     80 80 12 12 12 80 80,
     00 80 80 ** 80 80 00,
     00 00 80 80 80 00 00"
    
      replace =
    "00 00 08 08 08 00 00,
     00 08 08 ** 08 08 00,
     08 08 12 12 12 08 08,
     08 ** 12 48 12 ** 08,
     08 08 12 12 12 08 08,
     00 08 08 ** 08 08 00,
     00 00 08 08 08 00 00"
    
      trigger
      [
        type = "ignite"
        offset = "(3, 3)"
      ]
    ]
    Where it uses two-character sequences of (hex, if some property is set) digits for the block number, or ** for unchanged, with a comma at the end of each row. Spaces would be ignored.)

    - Also, the ever-present need for more trigger types
    - Perhaps a trigger offset of "center", that would find the middlemost block and use that as the trigger.
    - Multiple triggers? (code supports it already, but no way to load it from file yet)

    Well, Version 0.2 is now out.

    The simple pattern type described above was added. It uses block ids (and ** for any/unchanged) in a single string, with commas marking the end of a row (no 3d or data support, though), though it uses the same symmetry and trigger syntax.

    In addition, comparisons can now have a data property (containing an integer between 0 an 15, inclusive), that restricts what block it matches, or applies that data to the replacement block.

    "damage" is now accepted as a trigger type, and will trigger as soon as a player attacks a block.

    Triggers now have an optional item property, that can be any material id, material name, or "any". It sets what item must be held when triggering a pattern with the damage event(and any future events that can occur with different held items).

    You can also use multiple triggers for a single pattern. If any properties of a trigger are named with a positive integer, it will ignore the trigger and instead recurse to the numbered children. However, any type and item properties will be applied to the children (unless overridden), and any offsets are added.


    One thing to note, and this works in v0.1 as well, is that, due to the file syntax, you can disable any pattern just by prefixing it with "disabled" or "unused", or just about anything else. (as long as it doesn't end in a semicolon, closing square bracket, or an assignment, that is.)

    One quick example that I wrote to test the damage trigger type, item requirement, and data detection/changing:

    Code:
    pattern data_test
    [
        find[0 = "{wool: white}"]
        replace[0 = "{wool: cyan}"]
        trigger
        [
            type = "damage"
            item = 259
        ]
    ]
    
    pattern data_test2
    [
        find[0 = "{wool: cyan}"]
        replace[0 = "{wool: green}"]
        trigger
        [
            type = "damage"
            item = 259
        ]
    ]
    
    pattern data_test3
    [
        find[0 = "{wool: green}"]
        replace[0 = "{wool: blue}"]
        trigger
        [
            type = "damage"
            item = 259
        ]
    ]
    
    pattern data_test4
    [
        find[0 = "{wool: blue}"]
        replace[0 = "{wool: white}"]
        trigger
        [
            type = "damage"
            item = 259
        ]
    ]
    It causes left clicking wool cycle it through white, cyan, dark green, and blue (other colours are unaffected), but only if you are holding a flint and steel.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  11. Offline

    Uristqwerty

    Well, I feel that it is nearly at "version 1.0", it just needs enough useful patterns.

    So, all of the old ones are not enabled by default, but there are four new ones, for converting logs into coal ore, coal ore into iron ore, iron ore into gold ore, and gold ore into diamond ore (each created as an item, allowing regular players to acquire coal ore blocks and diamond ore blocks), though at a cost, as it takes four (+ one log as fuel) plus a certain pattern to create one of the next level up. (that's a total of 5 stacks and 21 logs to make one diamond ore, plus a very significant time investment, and likely one or two fling and steels)

    Here are the required shapes:
    2011-05-06_17.29.54.png

    Each is activated by igniting the centre log - but beware, if you get it wrong, you might burn up the nearby wool!

    The wool colour matches the block that you place there.

    The four corners of each 5x5 pattern can be anything.


    I am currently working on some documentation, you can find it at uristqwerty.co.cc.

    As always, feedback is important.
     
  12. Offline

    MonsieurApple

    Considered inactive.
     
  13. Offline

    Morgan Wellman

    Come on Uristqwerty, this was a cool mod. I would really like to see this thing continue. The idea was amazing. I really wanted to incorporate this into a server along side runecraft. Runecraft is amazing, but it lacks the creativity this one brings!

    I really wanted to see some runes on a much larger scale, but that's up to me right? a rune that is 128x128 or 256x256 which would remove all the trees, kill all the mobs, remove all the wood, remove all the water, remove ground above the level the rune was put on, and convert the remaining grass into dirt inside the rune. This would be a circle with some lines leading into a smaller ring in the middle. After the rune is activated, by lighting the four points on the outer circle that would intersect a bounding box, the area in the rune would die essentially. And in the center of the rune, Diamond blocks would be produced. The amount of diamond would be the radius of the over 8, so for the 256 that would be 128/8 equaling 16 diamond. I know this is a stretch, but I think large scale runes that hold lots of power, require lots of time, precision, and detail would add to the fun. About lighting them all at once, log catches with lava. Rig something to spill lave in a hole right on the outside of the rune not interfering with the design. In a server this would make for quite a bit of role-play. Having the players try to stop the evil mage before he converts the land into power. He would have to build underground to avoid people finding out about his evil plan. Sorry for the long annoying message :p I really like the work you've put in thus far. I think I'm going to try to make a big rune. kthxbye

    Oh quick question (sorry for the spam I feel bad) Is it possible to have another trigger source other than ignition? And with ignition could it be the ignition of another material other than log such as Netherrack? sorry if I missed that

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016

Share This Page