Skip to main content


Execute logic continuously?

  • jon-blue-eyes

    Oh and I can’t use a signal generator or timer because the detail on those can’t go lower then 10 updates per second!

  • phort

    I haven’t had any issues like what you describe. Some gadgets only trigger when a wire turns on or off though.

    Can you give more detail on what you’re trying to do and in what specific way it doesn’t work as you expect?

  • jon-blue-eyes

    Well I am trying to create my own input logic in a chip. So I want to execute some updates continuously when an input signal is on.

    (By input I mean chip input, not gamepad input)

    When I debug a simple version of this, e.g. if button pressed, and wire it into a counter... then the counter only updates when the signal changes. So in this example holding the button does not trigger pulses.

  • OreganoSpindle

    Still not totally sure what you're trying to accomplish.
    In your example, the counter goes up by one when a button is pressed. If you wanted one pulse and no more, you would wire the "counter full" to the reset and it wouldn't send a signal anymore.

    If you wanted it to stay on when a button is pressed and off when released, then you'd set up a signal modifier to pulse when off and then wire that to the reset. Then on the button press and when it's held, your counter would be full.
    Once released, the counter would reset and there would be no output signal.

  • theshepanator

    I'm not sure why you would need anything to update faster than 10 times a second, I'm not sure if it's possible to make a clock that's faster than that.

    Maybe try a tag in a timeline going ridiculously fast?

    In terms of making it work only when a certain input is on, use the on/off input of the microchip your logic is inside.
    Using your example, your clock is inside a microchip which is then wired to a counter. The X button goes to the on/off input of the microchip. Now when you click X the counter will go up with every pulse of the clock until you release the button.
    You could also get the same functionality with an AND gate. (One input is your clock, the other the X button )

  • jon-blue-eyes

    If you wire a NOT into itself you can force an update rate of 15fps.... which is 5fps faster then can be achieved with signal or timer. (Which is 10fps)

    The reason you might want to increase the rate of logic checking is because you want to create totally custom processing. For example what if you wanted to fire a gun faster then 10 times a second? Or maybe you wanted to create procedural generation into your level. You might want to execute your logic loop really fast here so that your level generation isn’t ultra slow!

  • phort

    Counters only activate when the input switches from off to on. What you want is either a Variable (in add-continuously mode) or a Timer.

  • phort

    Variable Modifier, rather

  • jon-blue-eyes

    Thanks phort!

    I thought I wasn’t going crazy.

    Had a look around, you can actually use the slider gadget and turn off show in game setting. This then just makes it a value that can be manipulated. The beauty is, it can be hooked up via wires (instead by name like variable) which means you can use it locally in a chip. The downside is it requires a bit of logic work to do the manipulation.

  • phort

    That’s a good tip, I hadn’t realized a Slider was another way to store a numeric value without needing to use a variable.

  • SnuggleBunzTV

    Actually Not Not Logic is very standard in coding.. Its worded differently but it really is a thing. :D

  • Croned

    15 fps is still incredibly slow for procedural generation. If you were to try to procedurally spawn Minecraft blocks for instance, 15 fps means 1/15 (0.067) second per block. Seems fast, but if you wanted to generate a small 10x10x10 block, that's 1000 blocks. 1000 blocks * 0.067 sec/block = 66.67 seconds, over a minute.

    This might be fine for procedurally generating a small scene if the player doesn't mind waiting for a couple minutes, but it means infinite procedural generation is impossible in Dreams's current state.

Please sign in to leave a comment.