Inactive [MECH] SignLink v1.24 - Show text on signs based on keys [2320]

Discussion in 'Inactive/Unsupported Plugins' started by bergerkiller, Sep 3, 2011.

  1. Offline

    bergerkiller

    [​IMG]

    Description

    This plugin acts as a bridge between plugins and signs to easily display text on signs. Instead of entering commands, clicking the sign, or any other routine plugins could use, players can enter 'variables', key values starting (and ending) with %, to show information at that spot.

    It also includes features no other plugin is needed for, such as custom text and ticker values you can set in values.yml. Signs are stored on file, they survive reloads and server restarts.

    A simple video showing what it does:


    See WIKI page for more information

    Configuration

    The linkedsigns.txt contains information of where signs are located. The values.yml sets the (standard) usable keys. If your ticker message does not 'flow' over all signs, add more spaces at the end or start of your message. This is simply how it works. :)
    Show Spoiler

    Code:
    # In here you can set default values for this plugin.
    # The ticker property can be LEFT, RIGHT or NONE and sets the direction message is 'ticked'.
    # tickerInterval sets the amount of ticks (1/20 of a second) are between the ticker update.
    # The value is the thing to display or tick.
    # To use colors in your text, use the § sign followed up by a value from 0 - F.
    # Example: §cRed to display a red colored 'Red' message.
    # You can find all color codes on the internet (they may use & there, ignore that!)
    sign:
        ticker: NONE
        value: This is a regular message you can set and is updated only once.
    test:
        tickerInterval: 3
        ticker: LEFT
        value: 'This is a test message being ticked from right to left. '


    time and date formats

    These can be set in the config.yml file:
    You can find more help on the format on the internet, search for 'system date format'.

    pauses

    As for 1.o1 you can set ticker pauses. This example shows the test message, with a pause of 10 ticks (2 * 5) after each word.
    Show Spoiler
    Code:
    test:
        tickerInterval: 2
        ticker: LEFT
        pauseDelays: [5, 3, 2, 5, 8, 6, 7, 5, 6, 3, 6]
        pauseDurations: [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
        value: 'This is a test message being ticked from right to left. '

    Simply put: it ticks as long as the first delay, then pauses the duration, then goes to the next pause segment. This does not reset after ticking the full line, so try to use delays the length of the entire String. (or use none)

    Permissions and commands

    Use /togglesignupdate to turn sign updating on or off, just in case someone made a huge amount of updating signs that causes lag. Use /reloadsignlink to reload the values.yml.
    Permission nodes (Bukkit permissions):
    Code:
        signlink.addsign:
            description: Allows you to build signs containing variables
            default: op
        signlink.toggleupdate:
            description: Allows you to set if signs are being updated or not
            default: op
        signlink.reload:
            description: Allows you to reload the values.yml
            default: op
    TODO
    - Fix values.yml to allow multiple player-specific values (90% done)
    - Commands to set variables and tickers
    - Possible to set time and date formats

    Plugins that use SignLink

    TrainCarts (arrival signs)
    WebAuctionPlus

    Download

    Download SignLink from GitHub
    View the source code at GitHub

    Changelog

    Show your appreciation for my plugins by donating
    [​IMG]
     
    woodzy and fromgate like this.
  2. Offline

    Dmck2b

    Nice :) This could be very useful!
     
  3. Offline

    DomiStyle

    Gonna test it soon.

    edit:
    I already like it :D
     
  4. Offline

    Kohle

    Mind = Blown
     
    EarlyLegend and kahlilnc like this.
  5. Offline

    King_KYl3

    Shittttttttttttt you are a legend so many epic plugins good job btw dont understand how to use with Train carts XD
     
  6. Offline

    1337phreak

    It works great! I'm using it to show when the next train is to leave the station. I'm also thing about setting one up to show when the next will arrive as well, that might take a bit of trial & error to get the sign to display the correct time and server lag might thwart that idea too.
     
  7. Offline

    King_KYl3

    @1337phreak Can you please do a tut i am confused lol dont no how to use im noob :p
     
  8. Offline

    DomiStyle

    Watch the tutorial video in the first post, pretty much explains everything.

    Just place a sign under a rail with
    Code:
    [train]
    trigger
    yourvariablename
    00:00
    where 00:00 is the time you want and yourvariablename is the variable you want to set.
    For example:
    Code:
    [train]
    trigger
    timer
    00:50
    After that build a sign where you want the timer to be and write %timer% on it.
    You can also combine it like this:
    Code:
    Next cart:
    %timer%
    Now everytime a cart rolls over the sign it restarts the timer so you have to time it as you like it for your situation.
     
  9. Offline

    King_KYl3

    Ok so confusing lol come to my server and please show :D 8.217.133.173

    @DomiStyle ^^^

    Hey your online please join this to help test :D plz 8.217.133.173

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

    DomiStyle

    Also I believe you forgot the recommended build:
     
  11. Offline

    bergerkiller

    ugh forgot it again.. :)

    And @DomiStyle ... wow my mind is blown too! :eek:
    I knew it was smooth after lots and lots of testing, but didn't expect someone to actually make a 4-line ticker display :D
     
  12. Offline

    DomiStyle

    Incase someone wants the Nyan Cat:
    Code:
    nyan1:
        tickerInterval: 1
        ticker: RIGHT
        value: '-_-_-_-_-_-_-_,------,      o    +      o     +              o    +      o     +              o    +      o     +              o    +      o     +              o    +      o     +              o    +      o     +              o    +      o     +              o    +      o     +              o    +      o     +              o    +      o     +              o    '
    nyan2:
        tickerInterval: 1
        ticker: RIGHT
        value: '_-_-_-_-_-_-_-|   /\_/\              +             o     +       +    +             o     +       +    +             o     +       +    +             o     +       +    +             o     +       +    +             o     +       +    +             o     +       +    +             o     +       +    +             o     +       +    +             o     +       +'
    nyan3:
        tickerInterval: 1
        ticker: RIGHT
        value: '-_-_-_-_-_-_-~|__( ^ .^)  +     +o          +                     o          +                     o          +                     o          +                     o          +                     o          +                     o          +                     o          +                     o          +                     o          +                     '
    nyan4:
        tickerInterval: 1
        ticker: RIGHT
        value: '_-_-_-_-_-_-_-""  ""                 o  +           +        +        o  +           +        +        o  +           +        +        o  +           +        +        o  +           +        +        o  +           +        +        o  +           +        +        o  +           +        +        o  +           +        +        o  +           +        +    '
    Just copy into the values.yml and make a sign with:
    %nyan1
    %nyan2
    %nyan3
    %nyan4
    Then place some signs right from the sign you just made.
    NYANNYANNYANNYAN...
     
    hawkfalcon, S.L.P.Major and kahlilnc like this.
  13. Offline

    Gicon

    ok.. i guess i'm doing something wrong.. I can't get it to scroll across the signs.. mirroring you move for move from the video it's still not working for me. :/ Another thign I notice is that I don't get the "painting the signs" commentary you are in the video.. is that just verbose for yourself? or is this not functioning properly? no errors in the console.

    EDIT: I'm using stone instead of wood.. does that make a difference? I can get the scrolling to work on one sign.. the train arrival variable as well.. just not multiple signs.

    **EDIT: HAH!.. dunno what I did... but screw with it nonstop.. and got it working.. cheers.. ths is a lot of fun. ;)
     
  14. Offline

    bergerkiller

    I knew someone would notice the coloring...

    That is some other plugin we use on our server (part of a larger part, I'm trying to divide it up in bits). You click a sign and by scrolling you can change the color of all lines OR a single line.
     
  15. Offline

    emericask8ur

    HOLYYYYY SHITTTTTTTTTTTTTTTTTTTTTTTTT
     
    Mekixx1 and kahlilnc like this.
  16. Offline

    1994mat

    How much signs for the nyan cat? xD
     
  17. Offline

    bergerkiller

    I haven't tested...but maybe it's possible to make animated displays using signs? It only sends over the changed text, not the entire chunk, which allows for pretty powerful constructions. :)

    Would be pretty awesome to have a 16-bit color display with 16 pixels per sign...
     
  18. Offline

    DomiStyle

    2 feature requests:
    * Make signs scrollable up and down in the config.
    ticker: UP/DOWN

    * Add an option to pause the ticker after some time.
    Example:
    Code:
    test:
        tickerInterval: 1
        ticker: LEFT
        value: 'This is a test message.'
        pauseAfter: 10
        pauseFor: 5
    The code above would show the message "This is a test message" tickering left and it will pause after 10 seconds for 5 seconds.
     
  19. Offline

    bergerkiller

    @DomiStyle The first one is simply not possible, due to the fact that it can't set a single character on the sign. Text is centred on the lines, and every color used will also act as a 2 characters. Also wouldn't be possible to show multiple vertical lines side-by-side, since theres not enough room on the signs for the var. names

    The second one is possible, I'll consider adding this feature in the ticker. Note that it will use ticks (1/20th of a second), I like to keep things simple on the end side.

    Plus you can make it pause exactly at the same displayed text status, could be useful. PauseAt and PauseDuration will be an array list (so you can set multiple pauses).
     
  20. Offline

    DomiStyle

    @bergerkiller
    I see, good work anyway.
    Looking forward to the pause feature.
     
  21. Offline

    bergerkiller

    Ok TODO's for the next version:
    • Sign coloring feature (use &x for colors, automatically update the sign while you edit it)
    • SignTextChange event to interactively change text of signs being edited while the player edits it
    • Right click a sign using a sign to edit it (existing plugins fail BADLY)
    • Support for ticker pauses (80% done)
    • Add list support (top sign set %variable[]% to set all signs below automatically, variable[1], variable[2] etc.
     
  22. Offline

    bergerkiller

    Good news everyone! You just read this in my voice.

    I finally revived the dead sign editing plugins: SignLink can now edit signs by right-clicking a sign while holding a sign! It automatically hides the new sign and transfers the text between the two signs. Editing a sign was never this easy. :D

    On top of that, when in edit-mode, it will show the actual variables, and not the displayed text! This allows you to quickly change the format of displayed text and variables. :D

    Now adding interactive coloring support; text get colored as you type them in.
     
    confuzzler likes this.
  23. Offline

    bergerkiller

    Ok uploaded to v1.01 adding some awesome sign editing and coloring features, with a more advanced API.
     
  24. Offline

    alex4108

    Suggestion: Be able to edit signs from in-game

    I have a subway system, and an announcements board in each station. If I need to notify everyone trying to ride (train stops at xxx station, instead of yyy), it'd be nice to do it without a /reload
     
  25. Offline

    bergerkiller

    @alex4108 someone is working on a redstone extension for this plugin (I guess), which allows you to trigger levers using variables on signs, and change the text of variables when setting power to it. You also posted an error, I'll see how I can fix that. (index out of bounds)

    I'll add a reload command for signlink too, so you can reload the values easily.

    Got a breakthrough. :)

    In the next version you can set player-specific text on signs. Update routine no longer needed, this is done is a task. Reason this does not lag, is that I added changed checks from line to sign. This means you can now do:
    Code:
    Variables.set("key", "value", players[]);
    And it will manage all updating and others the next tick, fully automatic.
    Note that it is better to set a variables for multiple players at once, or it will do the same %key% check for every player. (with the same results obviously)

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

    alex4108

    I guess I'll give you another bug report while you're working :)
    Bug #1:
    I have a 3 sign long ticker, to the left. Variable bla
    if I %bla, it ticks the message properly across the three signs. However, at random times, the ticker will just stop. Also, if I /reload or /stop and start the server again, I get this
    %bla = TICKER MESSAGE TEST 123
    Sign 1:
    Information
    TICKER MESS

    Sign 2:
    Information
    AGE TEST

    Sign 3 (frozen):
    Information
    ICKER MESS


    Bug #2:
    It seems after a restart or /reload, all variables containing numbers are screwy, and don't display properly anymore
     
  27. Offline

    bergerkiller

    Thanks, although I already threw aboard the previous coding...lol

    At this point text is divided in two parts: one physical part (that is actually on the sign, the variable key) and a virtual part (the value of the key). This means nothing is altered on the signs, while allowing changes to flow through. (does require a variable update before it becomes visible)

    Only bug I currently have is that signs don't allow external changes anymore: for example, my external sign painting plugin fails. Changes done to the sign only apply after the variable gets updated...I need some way to update the sign when changes are done to the text itself. :)
     
  28. Offline

    bergerkiller

    Updated to v1.02
     
  29. Offline

    M4xwellou

    @bergerkiller

    Hey, first of all, thanks for the plugin :)

    Second, I'm trying to use it with TrainCart and I had this:

    Task of 'SignLink' generated an exception
    java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
    at java.util.HashMap$ValueIterator.next(Unknown Source)
    at com.bergerkiller.bukkit.sl.VirtualSign.updateAll(VirtualSign.java:65)
    at com.bergerkiller.bukkit.sl.SignLink$3.run(SignLink.java:158)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:428)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    I have to say that I also have Wirelessredstone wich use signs ;)
     
  30. Offline

    bergerkiller

    @M4xwellou lol I sometimes seriously hate Java. I use my own iterator instead of a for each loop and STILL it complains when I remove elements...I'll fix this and add a reload command with it. (forgot to add it)
     

Share This Page