[MECH] RedstoneChips 0.97 - Integrated circuits plugin [1.5.1-R0.2]

Discussion in 'Archived: Plugin Releases' started by eisental, Jan 19, 2011.

  1. Offline

    eisental

    RedstoneChips 0.97 / BasicCircuits 0.97 / SensorLibrary 0.34
    (Last update on April 30th, 2013, cb 1.5.1-R0.2)


    [​IMG]

    Features:
    • Build chips with any number of input and output pins, from compact 2 block chips up to whatever you can imagine.
    • Choose from over 50 different chip types and several 3rd party chip libraries.
    • Most chip types can work with a wide or infinte range of i/o configurations. Sign arguments allow you to customize chip behavior.
    • Chips can communicate through redstone, or directly by touching each other. Some chip types can also communicate over wireless channels.
    • Chips can be built in almost any imaginable structure allowing very compact circuits.
    • Debug and maintain large projects using various tools and commands.
    [​IMG]

    [cake] Help me spend more time working on RedstoneChips. Please donate

    Circuit libraries made by other people:
    Changelog (open)

    RedstoneChips 0.97 (Apr 30th, 2013)
    • Fixed the saving bug on cb 1.5.1.
    • Added an option to disable update checking.
    BasicCircuits 0.96 (Apr 30th, 2013)
    • pixel: Added a maximum distance value preference to prevent lags and server crashes. The max can be changed using/rcprefs pixel.maxDistance x and defaults to 7.
    • sram: Fixed a problem with anonymous memory.
    SensorLibrary 0.34 (Dec 1st, 2012)
    • daytime: Fixed daytime offset bug.



    Full changelogs and source code @ github.com:
    RedstoneChips [gunpowder] BasicCircuits [gunpowder] SensorLibrary
     
    DoomLord, Shamebot, Vecht and 6 others like this.
  2. Offline

    eisental

    There shouldn't be any problem using numbers in port names. Can you paste here the console messages you got?
     
  3. Offline

    treve

    i have A1 to H200 so that are numbers also, no problem with any transmitter or receiver
     
  4. Offline

    Malkierian

    Hey eisental, I'm trying to make my own library for converting daytime outputs into outputs for a digital clock, but I can't get it to enable, I was wondering if you might look at my Circuit code and see what was wrong? (yes, I know, it's a little simplistic, but I am just a beginner). Anyone else who can add any input on this is also welcome.

    http://pastie.org/1747752

    Error log:
    Code:
    2011-04-02 09:20:22 [SEVERE] Could not pass event PLAYER_INTERACT to RedstoneChips
    java.lang.NullPointerException
        at com.malkierian.redstonechips.ClockDisplay.dclock.inputChange(dclock.java:54)
        at org.tal.redstonechips.circuit.Circuit.initCircuit(Circuit.java:107)
        at org.tal.redstonechips.CircuitManager.checkForCircuit(CircuitManager.java:133)
        at org.tal.redstonechips.RedstoneChips$4.onPlayerInteract(RedstoneChips.java:160)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:217)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
        at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:207)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:447)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
     
  5. Offline

    eisental

    @Malkierian
    The exception is thrown because you're not initializing your bits[] array. There should be a line somewhere saying bits = new boolean[arraylength]; probably in init().
    Your way of calculating seems to be very complicated. It's easy to get the integer representation of your input bits like so:
    Code:
    int i = BitSetUtils.bitSetToSignedInt(inputBits, 0, inputs.length)
    Also there's no need to clear the outputBits directly. sendOutput(), sendInt() and sendBitSet() also update outputBits. Clearing outputBits won't actually change the output levers of your circuit.
    It might help if you explained exactly what your algorithm is trying to do because I didn't really understand it.

    There's also @zach-hinchy s pull request. It basically solves this problem and I intend to release it (with some changes probably) in a few days.
    Could be interesting to turn it into a general purpose digit divider, though, capable of working with more than 2 digits for 7bit+ inputs.
     
  6. Offline

    Malkierian

    Ah, yes, that makes sense. Unfortunately, it couldn't be initialized in init() because it's dynamic, based on whether the chip is functioning as an hour or a minute converter.

    Basically, the point of this chip is to take the output from daytime (5 for hours, 6 for minutes) and output to a set of pins that would allow for individual activation of digital clock transmission circuits (right now, because the FalseBook ICs are smaller, I'm using its transmitters and receivers, but the function is still the same). Therefore:

    5 input pins = hours.

    Outputs: 8. 1-6 are hour markers; 7 is a modifier where if it's on, 1-6 mean 7-12; 8 is AM/PM marker (for those who want to output a 24-hour clock instead of a 12-hour clock). So, knowing daytime outputs 00000 bits for 7AM (integer 0), that in the outputs would be 10000010 (bit-order least to greatest), which would then be an integer output of 64 (pin 7) + 1 (pin 1).

    Of course, now that you told me the BinUtil function (I saw the toByteArray() in BitSet7, but that wasn't what I needed, and I couldn't find anything else), I can rework the hourIndex array so that I can take the output from bitSetToSignedInt directly (i.e., index 0 will now output the value for 7am instead of 1am, as it does now). That will definitely make it a lot simpler to output (and I mean a LOT simpler, like 2-3 lines of code :p).

    Minutes would be a little different, and I'm not quite sure, but I'm thinking I'm going to have to have one chip for the minutes outputting one set with the minute-ones digit and another with the minute-tens digit (which would mean it would have 6 for the ones (1-5, pin6 1-5 for 6-10) and 4 for the tens (0-2, 3-5 with pin-10 mod). But that's a separate chip mode from hours.
     
  7. Offline

    eisental

    @Malkierian Ok, seems to have some more function than merely separating the digits. I don't see the problem with initializing the bits[] array though (if its still necessary).

    Should be something like that:
    Code:
    @Override
    protected boolean init(CommandSender sender, String[] args) {
    .
    .
    .
        if (mode==chipMode.hour) bits = new boolean[5];
        else if (mode==chipMode.minute_double) bits = new boolean[6];
    
    }
    
    @Luckz Was this the error you saw?
    19:50:29 [SEVERE] Could not pass event REDSTONE_CHANGE to RedstoneChips
    java.lang.IndexOutOfBoundsException: toIndex < 0: -1

    If so, it's probably because you made a receiver with no outputs at all. I'll make a fix to catch this error in time.

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

    Malkierian

    @eisental, yeah, it's not necessary anymore, and here's why:

    All of that code I had using bits[] is replaced with a simple sendInt, as so:

    Code:
    public void inputChange(int inIdx, boolean state) {
            if(mode == chipMode.hour)
            {
                if(!earthtime)
                {
                    int bitsInt = BitSetUtils.bitSetToUnsignedInt(inputBits, 0, inputs.length);
                    if(bitsInt > 24)
                    {
                        bitsInt = 24;
                    }
                    sendInt(0, outputs.length, hourIndex[bitsInt]);
                }
            }
    
        }
    
    That's my inputChange now, and it works perfectly![/CODE]
     
  9. Offline

    eisental

    @Malkierian Cool, always happy to help make something simpler :)
     
  10. I actually did the clock, think im gonna record the clock, its only the 2 way atm, (meaning 4 pads) but I'm considering doing a full Big Ben later on =)

    If you want to, i can explain. My problem was just that i expected i could take 24 outputs making them singled out. Apparantly, thats a no no. One of the reasons why im gonna redo it when planning the recreation.
     
  11. Offline

    eisental

    You can get 24 outputs by connecting a daytime chip with 'gametime hour' on the sign to a decoder chip with 6 inputs and 32 outputs. 1st decoder input should be connected to the clock chip and 2nd-6th inputs connected to the outputs of the daytime chip. Then each hour will turn the next output of the decoder which is, I think, what you're looking for.
    The last 8 outputs will remain unused but they currently must be there for the decoder to activate.
     
  12. Offline

    Malkierian

    I would actually like to see that. I'm not quite sure what you mean by 4 pads.

    @eisental OK, so I decided to rework my chip to, instead of outputting the digit values, it will output the digital bar values instead (i.e., if, going top-bottom, left-right in counting digit sections, 1 would require sections 6 and 7, and 0 would require all sections but 4), to make for easy transmission (no more manual digit-section conversions that take up 5 9x3x24 cuboids...).

    Once this is done, I plan on releasing it, and I will make detailed instructions there. Needless to say, this will make digital clocks as easy as 1-2-3-4! (daytime-dclock-transmit-pixel :D Yay for simplicity).

    EDIT: OK, so I thought I had everything worked out, but when I enable my chip, even with inputs coming in, nothing happens! No outputs are triggered. Here's my current code:

    http://pastie.org/1749612

    Why isn't it triggering?

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

    treve

    i would love to see the time on a mega display, when asked by a player. when you got it working, can you help me to import it to my display? but i dont know how that can be done, because the output should be converted into big-screen-language then. yesterday i made a 4000 pixel display (not working, only pixels) but there was some lava also, and now, all pixels are burned away.
     
  14. Alright, as i came in i found out that after a update the times were all messed up, they are suddenly random after updating, i have no clue what happend, the time pattern is totally diffrent, and is not even remotely close to what it was before. Seems like i have to redo the first tower.
    What i mean is i have 4 big pixels that i like to call pads, because their kind of shaped like them, They were running on a slightly odd but matching to the light, i even think i recall it was based on the clock you can make ingame.
    But i'm not sure this is the addons fault, because when i try to modify the time, it seems to screw up while using /time = lets say 12000 which should be 12, it suddenly is 20. I'll see if i can manage to fix this.

    Oh and i noticed this bug while actually recording this, hehe...

    EDIT: Apparantly the clock works now, i did a test outside to see if my saved info was right. And apparantly it matched outside, first i tried destroying some of the daytime chip, (some of the sandstone) then see, still the same awkward one, i had to actually remove the sign then it would recognise, now remember when i upload this video, i'm going to make a Full 24 hour clock later on, however NOT for this building.
     
  15. Offline

    eisental

    The only reason I can see for it to not trigger is if you're trying to use chipMode.minute or gametime arg which you didn't add cases for yet, but that's pretty obvious I guess...
    Do I understand correctly that you're trying to replace segdriver with your chip? If so it would be probably better to use the standard segment order - i.e. clockwise order .

    @killervalon So are you still getting bad time readings? Which update made that happen? RC, craftbukkit, or MC1.4? If it's still going on please give some more details about it.

    You would have to make a bitmap font system of some kind stored in memory, storing each character as a separate image and be able to display more than one character at specific coordinates on the screen at the same time. I have no idea how it's done on a real video adapter but it sounds pretty complicated :) Would be probably easier to do on a bunch of smaller screens. 1 screen for each character.
    Could be great for writing alphabet letters. I don't think there's any other way to do that currently.

    EDIT: Something like this

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 6, 2016
  16. Well, as of basic Bukkit, i'm getting the problem that i have to for example write /time =4000 to get 12, but apparantly the big clock seems to fuck up again. However the small circuit i had outside still works as it should, so the 'big' system is screwing, but the other small one which isnt connected to anything but just turning on / off redstone, the video i made which i'm currently editing did work fine, until right at the end, one of the pads turned on too early, so i just cut it from there. I'm seriously in love with this plugin, it beats all the others. It's like its one of the Indian gods, where the religion is bukkit =)

    EDIT: Rendering now - its saying crappy 50min.
    Uploading now

     
  17. Offline

    Malkierian

    Heh... Segdriver... I didn't even know that was there. LOL. Anyway, yes, that was the basic idea of it (except for replacing the segdriver, because I didn't know it existed). However, I think I may still need a chip for converting time values to separate digit values (i.e. minutes output from daytime into a tens-minute and a ones-minute). Especially so I can use that blanking pin thingy. Now, to figure out how it works...
    This is game time, unfortunately. It's a little stupid to have it so lopsided, but that's the way Notch decided to make it, and so we're stuck with it, and have to convert it back when we want to do a clock...
     
  18. I have no clue what your talking about, the only thing diffrent from ingame / IRL time is how fast it passes by, just like The Sims. However after the lastest Bukkit update, changing time gives it the wrong value. And even the help thing is still bugged, it says use /time 13 to set it to 13, but when you do that, it just gives you the help syntax's again. Bukkit seems to be a bit screwy on its own stuff...
     
  19. Offline

    Malkierian

    I don't see that on mine. I can only use /time day or /time night. But what I was referring to is the fact that the daytime chip outputs game time. Gametime 6AM is daytime 00000, which I assume is getting it directly from the 0-24000 game time values directly. However, I would think to put 0 as midnight (or 0-hundred hours, military-time, or 0:00 in 24-hour time). This is what confuses me.

    @eisental The question now would be, would it be best to simply make a circuit to take in daytime values and separate the digit places and output those and leave the segmentation for the segdriver?
     
  20. Offline

    Mordenkainen

    Something did change with the time in game....

    I think it's bukkit, and seems to affect all time related plugins in one way or another.

    Before tick 0 was 8AM, now it is 6AM. The /time command from the General plugin only reports the hour, not the full time, and in a weird way... For example, 8:37AM is displayed as 8:0. Also, the time command does not appear to actually change the time when used. Dynamap 1.5 seems to show the correct time.

    When you actually get the time to change by some means, it seems to cause redstone clocks (like a 5 clock, not a digital clock made with RC) to freeze and need to be rebuilt a little to start running again.

    I don't think this is an RC problem, looks like a problem in the new Bukkit, or underlying MineCraft server.

    On a side note, is the Clock chip now considered stable? Are people still seeing crashes when using it?

    I am currently working on a Digital Clock tut for the RC wiki, but the issues with the servers are causing me a lot of trouble right now. Also have started some initial design on a Glyph Cache (what eisental was talking about above) for my next project, a scrolling marquee that players can put their own custom messages on.

    Morden.
     
  21. do /time ? you will get all the syntaxes.

    @Mordenkainen Something has changed, but i think its more of a bug than a feature. I still get 8, as it were before, however it glitches after a while on my big system as i explained in a earlier post, i think somebody should ask what the heck is going on to bukkit, it could be a error in the code.. One of the main reasons i use this plugin is because of daytime, however i plan to use the other functions more often.

    @eisental didn't you make a mistake within the docs and wiki, instead of high - low it should be on - off, as it actually is. Cause there isnt a diffrence on frequences, because they don't really exist.
     
  22. Offline

    Malkierian

    @killervalon You and I are using different plugins, because Essentials only allows /time day and /time night. When I type /time by itself it tells me "Error: /time only supports day/night"

    By the way, I still think gametime is ridiculous, as not only is "0" 6/8 (whatever it is), 6 isn't even sunrise/sunset! The sun is more at 7:30 when I do day/time (and I calculated this off of what time is output from daytime when the sun is at noon-position).
     
  23. Offline

    treve

    still building on giant screen, so when i am ready to build memory, the daytime will be fixed i guess :)
    if i understand you good, the daytime circuit will have to lead to my input adres of memory chip? or maybe converted into some adress and then for every time (hour/min) i will need to program the time tekst .first ?
    display dimensions: 100 long, and very high, cant get much higher.... 5000 pixels i guess? still naming them, 800 done so far, 4200 to go, or something near that. i will need as much sram-chips as pixels, so i hope wireless inputs/adres and wireless outputs will be there soon, but as long as i am still naming pixels, there is no hurry...
     
  24. I'm not using any plugins for it, i'm quite sure thats how Bukkit is by default.
     
  25. Offline

    Malkierian

    So you're telling me Essentials is overriding a better default? That's stupid...

    I'm gonna have to put in a plugin then to restore that functionality.
     
  26. Offline

    treve

    transmitter channel numbers are not working :(
    transmitter channel 788 will not work, a788 will. can you fix that in next update as well?
     
  27. Offline

    eisental

    Did 0-787 worked? What did exactly happen?

    @killervalon I guess high and low can be confusing. It's just a figure of speech...

    I would leave the segments for the segdriver. That way the chip can work with other display types later.

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

    Mordenkainen

    @eisental:

    Another suggestion, this one purely selfish.

    I use the SimpleSignEdit plugin for changing the text on my signs. This makes it a lot easier when copying an entire circuit and then updating the signs for different values. It kicks in when you right click on a sign while holding another sign. This has an odd interaction with RC where the right-click to change the text activates the copied chip, so once done editing you must "/rc-reset" it.

    The following modification to RedstonChips.java will prevent chips from activating when right-clicked while holding a sign, preventing you from having to use /rc-reset if changing the text before activating a chip and avoiding the "Circuit is already activated" message when editing an existing one:

    Code:
    Imports:
    import org.bukkit.Material;
    
    RedstoneChips.java line 159:
    if (event.getAction()==Action.RIGHT_CLICK_BLOCK)
    {
          Material holding = event.getPlayer().getItemInHand().getType();
          if(holding == Material.SIGN) return;
          circuitManager.checkForCircuit(event.getClickedBlock(), event.getPlayer());
    }
    Code is shamelessly stolen from Celtic Minstrels SimpleSignEdit plugin.

    Morden.
     
  29. Offline

    Malkierian

    Alright, then, have a look:
    http://forums.bukkit.org/threads/me...al-clock-library-for-redstonechips-617.11206/
    I've released it in the form it has now, I have only to test 24-hour mode and implement earthtime. I have two 7-segment digit clocks running on my server right now showcasing this.
     
  30. Offline

    Mordenkainen

    Thanks Malkierian!

    Guess we won't need the clock tutorial now...
    Though showing how to do it without additional plugins is may still be an interesting exercise.
     
  31. Offline

    Malkierian

    Without any plugins? That would be a nightmare. Even trying to do it with only displaytime was so bad my server started freezing from all of the transmission ICs being triggered... If I'd known about the segdriver back then, I may never have even gotten started on ClockDisplay :p
     

Share This Page