My First Mod: Logic Gates

  • iamdumb
    21st Aug 2014 Member 6 Permalink

    TPT Logic Gates Mod

    Elements Added

    AND: SPRKs nearby NSCN when powered by 2 or more PSCN

    OR: Conducts from PSCN to NSCN

    NOT: SPRKs nearby NSCN unless powered by PSCN

    XOR: SPRKs nearby NSCN when powered by ONE PSCN

    NAND: SPRKs nearby NSCN unless powered by 2 or more PSCN

    XNOR: SPRKs nearby NSCN unless powered by ONE PSCN

     

    Lua Source: http://pastebin.com/HM3LuEps

    How to use

    Simply save in your Powder Toy folder as tptlogic.lua (or another name) and in the TPT console (~) type dofile("tptlogic.lua")

     

    Changes

    • Gates now work in all directions
    • Changed NOT gates
    • Corrected Element descriptions, corrected some conditions. 

     

    Just one thing, I'm not sure what the 'nt' argument for the update function is for, so I ignored it. Could someone please inform me of it's purpose?

    Edited 3 times by iamdumb. Last: 28th Aug 2014
  • Darthan
    21st Aug 2014 Member 1 Permalink

    I guess your name lies, lol.

    Edited once by Darthan. Last: 21st Aug 2014
  • ChemGuy
    21st Aug 2014 Member 0 Permalink

    This is pretty cool, but I have noticed a couple of things:

     

    • AND, OR, NOT work fine, but NOT bugs sometimes.
    • XOR seems to be completely unaffected by the amount of PSCNs powering it, it conducts with any number (I understood it as 'there is exactly one PSCN powering it'. Am I wrong?).
    • The condition for NAND seems to be > 2, not >= 2, that is over 2 PSCN are needed. Just like NOT, it isn't very reliable.
    • XNOR is also pretty chancy (Looks like all gates that continuously spark have this), but other than that, it's fine.
    • Some logic gates interfere with others' performance, despite being a big distance apart.

     

    Also, not that this is a big deal, but the description for XNOR is the same as for AND. :P

    Edited 5 times by ChemGuy. Last: 21st Aug 2014
  • iamdumb
    21st Aug 2014 Member 0 Permalink

    I corrected that :P. Probably a typo.

     

    Thanks for the feedback.

    Edited once by iamdumb. Last: 21st Aug 2014
  • iamdumb
    27th Aug 2014 Member 0 Permalink

    I've made the NOT gates a bit more reliable now.

  • Protcom
    28th Aug 2014 Member 0 Permalink

    Why doesn't it work horizontally ? am I doing it wrong ?

     

    Anyway, your first mode really is awesome/amazing/cool, you really did some work on that. I didn't expect to see you do something like that, lol.

  • iamdumb
    28th Aug 2014 Member 0 Permalink

    Erm, no. That was me being incompetent with Lua. It should work in all directions now.

  • megamageiii
    17th Sep 2014 Member 0 Permalink

    The XOR gate acts like a normal OR gate, but besides that, it works fine. It is a great mod, especially for your first.

  • ry00001
    2nd Feb 2015 Member 0 Permalink

    This is cool! Gonna download it

  • Pixelguru
    12th Jul 2015 Member 1 Permalink

    This mod is amaze, use it all the time!

    Unfortunately, at least the NOT gate (not sure about the others) can only be used one at a time. If I try to place a second NOT gate, it doesn't work until I place it while the other one isn't spawning an electron and then the other NOT gate stops working.