For some reason, there is a distinct lack of counters in StarMade. Not sure why. They are the heart of most sequential systems, fixed repetition systems, calculators, etc. I suspect when rails show up, they'll come into more use.
I did find this monster.
http://starmadedock.net/content/logic-counter.2143/updates
It's really cool that it's essentially a binary computer. It's not really cool in that it's freakin' massive for what it does. So without further ado, my solution to a Starmade counter. Most digits are 6 blocks with the zero digit (left) and the reset circuit (right) being different.
Just fyi: that array can count from 0-9 and is currently at 0.
The zero digit consists of a SvenCell™ (AND/OR) memory cell, a NOR, and an AND. The NOR/AND combination allows the system to recover from null state (no memory cells active) as well as automatically set to zero when the digits reset. The counter should never actually be in the null state, but it'll recover if something freaky happens and all your memory circuits get shut off. The zero digit, like everything in my counter, takes it's input from the non-memory AND. The other input into the AND is from the NOT of the NOR. The OR of the NOR receives input from the output of every single cell in your first set of digit cells, including the zero cell and outputs into the NOT.
In other words, the zero cell is blocked from receiving direct input if any other memory cell in the first digit, but will update when the digits all reset. Like I said, it shouldn't go null, but if it does, it'll recover the next time the zero cell gets an input.
At the other end, the reset cell is simply a 1 second delayed AND linked into a NOT. The NOT resets the last counter cell in the series, and because StarMade circuits last for a half-second, ends up reactivating the zero digit so your system is never in null state.
The counter cells consist of a 1 second delayed AND, a SvenCell™, and a NOT. The 1-sec AND is your input and the wiring is simply DELAY->DELAY->AND. The AND of the SvenCell™ is your output. That's why if you look at the inline version of the cell, you see I set things up that way even though it does mean the signal is moving one way in the 1-sec AND and the opposite direction in the rest of the cell. But if you're so OCD as to care about having all your current flow in one direction, you need professional help anyway and/or are one of my ex-gf's, so really, not going to lose much sleep over upsetting you.
The wiring within the cell you can see in the 1-cell which I broke up into its pieces. The AND in the 1-sec AND goes into the OR of the SvenCell™ which is the input of that memory cell. The AND of the SvenCell™ goes into the NOT, the first DELAY of the next cell, and into whatever else you want to hook it into (for example an OR that turns on lights displaying a "1"). The NOT goes to the SvenCell™ AND of the previous cell. The NOT turns the previous cell off when this cell turns on. The AND being wired into the 1 second delay will eventually (obviously after 1 second) allow the next cell to be turned on.
Whatever you're using as an input has to go to all the AND's of each counter's 1-sec AND, and absolutely must be a half-second pulse. Otherwise the system turns into a very unreliable stopwatch. Even if you want a stopwatch, you're better off using an NOT-DELAY clock (just wire them to each other) then wire one of those blocks into an AND and hook an activator into that same AND and using that as a stopwatch. This gives you precise pulses every second that you can start and stop just by turning on or off the activator. So what you'll see happening is that a memory cell of one counter will be active, its NOT will be the only one turned off which is how the previous cell got turned off, and the 2 DELAYs of the next cell will be active thereby preparing the input AND of the next cell to be activated.
There are a ton of ways to reset the system to zero from any stage. You can brute force it by wiring a NOT into every single AND of every single SvenCell™ to send them all a low pulse. You can build your base circuit, then wire in a NOT that turns off that row's cells so that you're only wiring together the NOT's at the end. You can also do some cool AND based stuff so that when your counter hits a specific point it resets, and even go to ridiculous by allowing the user to 'program' what that point is. There are lots of possibilities here, and they depend on how big your counter gets, whether it's even allowed to count in loops, what base its counting in, etc which is why I didn't just build it as part of the general counter.
The best part of this is that you can count in any base you want. Want to count in base 8? Set up to go from 0-7. Hex? 0-15. And then you can expand quickly to add another digit simply by adding another row of counter cells and wire the last cell in each row to both the reset and all the non-zero digits of the next row. So, if you were counting from 9 to 10, when the system updates, it'll reset the first row to zero and set the second row to 1. Then when it goes from 19 to 20, the 9 digit will update the second row to 2 and the reset will set the bottom row to 0. And so on. Have fun.
I did find this monster.
http://starmadedock.net/content/logic-counter.2143/updates
It's really cool that it's essentially a binary computer. It's not really cool in that it's freakin' massive for what it does. So without further ado, my solution to a Starmade counter. Most digits are 6 blocks with the zero digit (left) and the reset circuit (right) being different.
Just fyi: that array can count from 0-9 and is currently at 0.
The zero digit consists of a SvenCell™ (AND/OR) memory cell, a NOR, and an AND. The NOR/AND combination allows the system to recover from null state (no memory cells active) as well as automatically set to zero when the digits reset. The counter should never actually be in the null state, but it'll recover if something freaky happens and all your memory circuits get shut off. The zero digit, like everything in my counter, takes it's input from the non-memory AND. The other input into the AND is from the NOT of the NOR. The OR of the NOR receives input from the output of every single cell in your first set of digit cells, including the zero cell and outputs into the NOT.
In other words, the zero cell is blocked from receiving direct input if any other memory cell in the first digit, but will update when the digits all reset. Like I said, it shouldn't go null, but if it does, it'll recover the next time the zero cell gets an input.
At the other end, the reset cell is simply a 1 second delayed AND linked into a NOT. The NOT resets the last counter cell in the series, and because StarMade circuits last for a half-second, ends up reactivating the zero digit so your system is never in null state.
The counter cells consist of a 1 second delayed AND, a SvenCell™, and a NOT. The 1-sec AND is your input and the wiring is simply DELAY->DELAY->AND. The AND of the SvenCell™ is your output. That's why if you look at the inline version of the cell, you see I set things up that way even though it does mean the signal is moving one way in the 1-sec AND and the opposite direction in the rest of the cell. But if you're so OCD as to care about having all your current flow in one direction, you need professional help anyway and/or are one of my ex-gf's, so really, not going to lose much sleep over upsetting you.
The wiring within the cell you can see in the 1-cell which I broke up into its pieces. The AND in the 1-sec AND goes into the OR of the SvenCell™ which is the input of that memory cell. The AND of the SvenCell™ goes into the NOT, the first DELAY of the next cell, and into whatever else you want to hook it into (for example an OR that turns on lights displaying a "1"). The NOT goes to the SvenCell™ AND of the previous cell. The NOT turns the previous cell off when this cell turns on. The AND being wired into the 1 second delay will eventually (obviously after 1 second) allow the next cell to be turned on.
Whatever you're using as an input has to go to all the AND's of each counter's 1-sec AND, and absolutely must be a half-second pulse. Otherwise the system turns into a very unreliable stopwatch. Even if you want a stopwatch, you're better off using an NOT-DELAY clock (just wire them to each other) then wire one of those blocks into an AND and hook an activator into that same AND and using that as a stopwatch. This gives you precise pulses every second that you can start and stop just by turning on or off the activator. So what you'll see happening is that a memory cell of one counter will be active, its NOT will be the only one turned off which is how the previous cell got turned off, and the 2 DELAYs of the next cell will be active thereby preparing the input AND of the next cell to be activated.
There are a ton of ways to reset the system to zero from any stage. You can brute force it by wiring a NOT into every single AND of every single SvenCell™ to send them all a low pulse. You can build your base circuit, then wire in a NOT that turns off that row's cells so that you're only wiring together the NOT's at the end. You can also do some cool AND based stuff so that when your counter hits a specific point it resets, and even go to ridiculous by allowing the user to 'program' what that point is. There are lots of possibilities here, and they depend on how big your counter gets, whether it's even allowed to count in loops, what base its counting in, etc which is why I didn't just build it as part of the general counter.
The best part of this is that you can count in any base you want. Want to count in base 8? Set up to go from 0-7. Hex? 0-15. And then you can expand quickly to add another digit simply by adding another row of counter cells and wire the last cell in each row to both the reset and all the non-zero digits of the next row. So, if you were counting from 9 to 10, when the system updates, it'll reset the first row to zero and set the second row to 1. Then when it goes from 19 to 20, the 9 digit will update the second row to 2 and the reset will set the bottom row to 0. And so on. Have fun.