Using display blocks to name adjacent blocks

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I was thinking that it might be a good addition to allow players to name their rail dockers. It would work in a similar way to how we can name inner ship remotes. This way you knew if you were firing the right docker from your hot bar or not.
    We already have display modules which schema could use to name adjacent blocks.
    [named]BlockType => "[xyz]±XXX±YYY±ZZZ"
    Renaming anything via a linked or adjacent display block is a great idea. I'd recommend creating a whole new suggestion thread for this, and see how it flies.
    If you want to name a rail-block with an adjacent display module you should be able to do it with:
    Code:
    display module:
       input/text (example): "[named above]myRailDocker"
       content/text (auto): "[named ±±±]myRailDocker@±XXX±YYY±ZZZ"
       displays/text (auto): "myRailDocker@±XXX±YYY±ZZZ" (similar to an email address so that regex can filter it)
    another display module:
       input+content/text: "[xyz]myRailDocker:enable"
       displays/text (auto): "myRailDocker@±XXX±YYY±ZZZ"
          as long as there is a display module containing "[named*]myRailDocker@±XXX±YYY±ZZZ"
       displays/text (fail): "myRailDocker@unavailable"
    
    use "above", "below", "right", "left", "behind", "infront" for "±±±" in "[named ±±±]" (or "ABRLHF" as alias)

    And this is "What :schema:The Cat" needs to implement it:
    (It might sound complicated, but it's standard for experienced developers)

    (the text/string operations only run once when the block contents change, not constantly)
    For user-friendly coordinates:
    1. check for "[named]" or "[named "
      1. check for lowercase and check "above]", "below]", …
      2. or check for uppercase and check "ABRLHF"
      3. or check for +++, --- and === for which a/bel/r/l/beh/i and ABRLHF are aliases for.
    2. check for a following "]"
    3. check for a non-alphanumeric (0..9, a..z, A..Z) name length delimiter and use java's .substring()
    4. check for a "@" and if not existent, add a text like "@+0-3+65" before saving it
    For using the block:
    1. check for "[xyz]"
    2. check for a alphanumeric (0..9, a..z, A..Z) name
    3. check for a ±num±num±num (±x±y±z) coordinate (± being + or -)
    4. search a wordbook for the name/coordinate (the wordbook can be a standard binary tree or anything with a reference to a class-instance storing the blocks position-3int/name-string and contents)
    5. check for ":"
    6. search a wordbook for alphanumerics in place of "enable" to get the command-number from it's entry
    7. search the non-alphanumeric delimiter
    8. do commands[number].run(x, y, z, ACTIVATE_LOGIC) this action only changes when the block text changes, thus not as often as it is used.
      • commands[] implement the interface runable.run(int, int, int, enum)
    Theoretically, this is possible with regex, but it's not newbie-friendly and requires quite a few blocks (maybe 5-8 instead of 2) to do so, which is less time spent for building. You would also need to enter the coordinates manually.
     
    Last edited:
    • Like
    Reactions: Sgtwisky
    Joined
    Mar 31, 2015
    Messages
    281
    Reaction score
    95
    • Purchased!
    • Legacy Citizen 5