[WIP]Nano-Redstone - Automatic multi-purpose redstone machines!

Discussion in 'WIP and Development Status' started by chazicle, Mar 6, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    chazicle

    Nano-Redstone

    Nano-Restone is a plugin that adds programmable blocks or 'nodes'. There are many different types of nodes that so lots of different things.

    All nodes are blocks with a wall sign on. When redstone signal is directed at the sign it executed the script installed which can be written and set in-game!

    Types of Node
    Redstone IO Node
    Controls up to 3 redstone outputs (Lever/Buttons)
    Prints text to a sign
    Show Spoiler
    [​IMG]


    Relay Nodes
    Has an inventory (a chest on top)
    Can suck nearby items into it's inventory like a gravity well/field.
    Can throw items out of it's inventory at high velocity. (Like a dispenser) Can set type, amount and direction.

    Image of me throwing wool at the relay and the relay throwing the wool to the left:
    Show Spoiler
    [​IMG]


    Crafter Nodes
    Has an inventory (a chest on top)
    Can be instructed to craft something using inventory for raw materials
    Can take results out of furnace
    Can put fuel into furnace
    Can put items in furnace

    Show Spoiler
    [​IMG]


    Miner Nodes
    Has an inventory (a chest on top and 2 side chests for storage)
    Can dig vertically down and puts collected items into chests around it. It mines using pickaxe from it's top chest's inventory. Selecting a tool which is capable of mining through the next block. Sadly tools do still wear down but not as much.
    Collects water/lava source blocks using buckets in inventory
    Show Spoiler
    [​IMG]


    Quarry Nodes
    Can dig in a defined area (a chest on top and 2 side chests for storage)
    Area is defined by a player fencing off an area
    Can collect lava/water like miner nodes


    Logger Nodes
    Has an inventory (a chest to the side)
    Plants saplings on a block of dirt or grass. Once the tree has grown it can cut the tree down.
    This leaves wood all over the place but combine it with the RelayNode means you can collect it.

    Image of wood falling to the ground after the logger has cut it down:
    Show Spoiler
    [​IMG]


    MobController Nodes
    Spawns a mob (costly)
    Throws mobs away (Shows in screenshot below)
    Mob radar to find nearest mob. You can then get it to kill or heal the mob the radar finds.

    Image of pigs being through out of a box by a Mob Controller node underneath:
    Show Spoiler
    [​IMG]



    Nanite System (NRS's currency)
    Ore Generator Node
    Need a block of ore (doesn't use it up)
    Generates 1 nanite per tick
    The lower value the ore, the longer each tick takes.

    Geothermal Generator Node
    Needs a bucket of water in inventory
    Converts lava in buckets to obsidian, generating 50 nanites.

    Creative/Survival
    Survival Mode
    Each nodes needs Nanites to perform some instructions. These Nanites needs to be generated using a generator then enough need to be transferred to the node so it can perform the command.

    Creative Mode
    Nanites arn't a problem. Just use any commands.
    Some things are possible like spawning items from nowhere in Relay Nodes or Crafting without using raw materials from the Crafter Node's inventory.

    Scripting
    Each command is a capital letter follow by a parameter (if any).
    E.g. Cstick - Crafts a stick
    C means craft in the Crafter Node.
    stick tell it to craft a stick.
    It will then look for wood in the chest to make it.

    The scripting for each node is a set of commands seperated by a colon.
    <Command #1>:<Command #2>:<Command #3>
    The "execution flow" starts at the first command. Once executed it moves to the next, etc...
    If a command fails due to lack of nanites or some reason then it will skip and move to the next command.




    Variables
    All Nodes have built in variable storage (which is kept when the server restarts).
    Left clicking will show you defined variables on a node.
    Use the variables command to control variables
    V<variable name>=<variable value>

    Number variables allow you to use mathematical operations such as +-/* etc...
    Code:
    Vx=0  (Defines a variable x with value 0)
    Vx+=6  (Adds 6 onto variable x, now x=6)
    Vx*=5 (Multiplies x by 5, now x=30)
    Vx/=10 (Divides x by 10, now x=3)
    Now you have defined a variable X you can use it in ANY command.
    Read from node > All variables replaced > Command executed

    %x% will be replaced with the value of x. If x is not defined then it will not replace it.
    When x=1
    Code:
    <BLAH>:G%x%<BLAH>        =>      <BLAH>:G1<BLAH>
    When x is not defined
    Code:
    <BLAH>:G%x%<BLAH>        =>      <BLAH>:G%x%<BLAH>
    Flags
    Flags can be set in the script to move the execution flow to that command.
    Fexample (Defines a flag called example)

    Then you can use
    Gexample (Goes to a flag called example )

    So the script:
    Fexample:<ANYTHING>:Gexample
    will repeat forever until stopped and the <ANYTHING> will be executed every time it repeats.

    Combining Flags and variables
    Code:
    Vi=0:Fa:<ANYTHING>:G%i%:Ga:F10
    This example is the NRS equivalent of a FOR loop.
    Any instruction including Fa and Ga will repeat 10 times before the script stopps. Because when i is less then 10, G%i% will be replaced by the numbers 1-9 e.g. G%i% becomes G5 when i=5. But when i=10 it will create G10 which will move to F10 and stop the script.


    Some variables are dedicated to showing the user value.
    E.g. amp is a variable showing you the current redstone current used to start the script.
    Lets say there are 2 levers connected to a single redstone wire.
    The closest lever will have a higher redstone current than the furthest one. So you can write a script that checks the %amp% variable to see which lever has been used.




    List of available commands
    (These may change)


    All nodes
    F<flag name> - Defines a flag (See above)
    G<flag name> - Moves to a flag
    V<variable name><maths op>=<value> - Defines/Adjusts Variables
    E - Stops the script
    R - Restarts the script
    D<time> - Delay in ms for the node (Not the whole thread)
    N<ammount>><target> - Transfers an <amount> of Nanites to the <target> node

    Redstone IO Controller Nodes
    H<index> - Turns one of the levers/buttons on
    L<index> - Turns one of the levers/buttons off
    P<test> - Prints text to the sign (Seperate lines with "two \n lines")

    Relay Node
    I<type> - Throws the specified Item type out of the chest
    S<direction> - Set the node's direction of throwing (Can be N,E,S,W,U,D)

    Mob Node
    S<type> - Spawns a mob
    M - Scans for nearest Mob (Set variable TYPE to the type it finds and ID to it's entity id, must be living and not player)
    K - Kills the nearest mob
    H - Heals the nearest mob
    T - Throws all nearby mobs away (See above image)
    B - Bring all nearby mobs in (See above picture and image backwards)

    Crafter Node
    C<type> - Crafts the specified type taking the materials from the inventory
    S<type> - Smels the specified item (Only when there's 8 of them)
    A<type> - Adds fuel to the furnace
    T - Takes the result out of the furnace and puts it in the chest

    Logger Node
    C - Cuts down the tree
    P - Plants a Sapling

    Miner Node
    M - Mines below
    C - Checks what's below (costly)

    All generators have command T for tick.

    I will try to get a Devel version up soon.
     
  2. Offline

    chazicle

    Updated 8th June 2012.
    If anyone has any suggestion for other nodes/commands post them below.
     
Thread Status:
Not open for further replies.

Share This Page