Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
i=0
if [push button] then i=i+1 end
if i==2 then i=-1 end
Then just output the number.
You can change the initial value of i to be -1 or 1, depending what you want to start on. This script will increase i by 1 (-1 -> 0 -> +1) each time the button is pressed. When i=1 and the button is pressed, i will become 2, and the last line then cycles i back to -1.
If you are uncomfortable using LUA, hopefully this still gives you some ideas how you might go about doing it with logic modules.
Simply clamp it between minimum value of -1 and max of 1, with increment of 1. Make sure you have toggle to push on the inputs, to ensure it only changes by 1 increment regardless of how long you hold down the button.
'Push to Toggle' not "Toggle to Push." Just so it is clear for OP. <-- THESE ARE LIES.
EDIT: It is actually called 'Pulse.' In particular, the Off -> On setting.
Also, I too thought about the Up/Down Counter, but OP implied he wants it to cycle. As in, one push button cycles -1 -> 0 -> +1 -> -1 -> 0 -> etc.
I am sure you can do this with a counter, and, without having the game open, I do not know if the counter has a reset button he could use to reset it back to -1 when necessary. Even so, certainly possible to do with a counter, just might require more steps to get a nice cycle.
Ah, you can still use the suggested methods. Except, instead of outputing -1, 0, or 1 directly, use an equals check:
If number is -1, then output -0.09; if number is 0, then output 0, if number is +1, then output 0.3.
EDIT: Do the above using switchboxes and equals modules.
The first button goes -0.09 -> 0 -> 0.3
The second button goes 0.3 -> 0 -> -0.09
Just some clarification for you guys
Two separate buttons for two separate functions
Nope, toggle to push extremely specifically. It sanitizes any input to a single tick input, and is necessary for sequential, controlled use of an up/down counter.
In the case of separate values, you can still do what i did, and sanitize the -1 to -0.09, and +1 to 0.3 by detecting the number and putting them through an f(x) chip. Although this makes cycling only one way by default (by using reset), and very difficult to handle.
There's also the chance of doing this with tiered numerical switchboxes, but i'm spent as far as Stormworks goes today
Oh yes, I am stupid. It is called 'Pulse.' As punishment, my reply fits in only one line.
I've been trying to bruteforce this using the logic blocks visual programming language and find myself having trouble connecting the first part (two push buttons cycling from -1 to 0 to 1 to -1 and vice versa) and the second part (if x < 0 output -0.09 else if x > 0 output 0.3 else output 0).
I have a bug because for now I'm adding the results of the counters from each button, and of course it sometimes equals 2 or -2, me dummy.
Almost there. (Is it normal I feel like I'm playing a Zachtronics game?)
As someone who held a few (tied) world records in Spacechem, Shenzen I/O and Exapunks on both efficiency, and speed, guess why i'm sensually attracted to the microcontrollers.
And yeah, pretty much agree that it's much easier to do in LUA.
But that is off-topic, my apologies.
(Oooh, I haven't put a modulo in yet... Okay, now my bugs are getting stranger, time for a break.)
It sounds like you are using a throttle or seat. Just make the min be -0.09 and the max 0.3. The throttle (the throttle is two buttons) makes this easy in its settings. The seat will need to be clamped.
The reason is that the throttle is variable but I want to be able to go exactly -0.09, 0 and 0.3 without the other numbers in between
I have used a throttle lever for testing to find the numbers I need but I'm not intending on keeping it. I do know how to change the max and min on throttle levers already
https://steamcommunity.com/sharedfiles/filedetails/?id=2052910508
It allows you to switch between -0.09, 0 (default) and 0.3 with 2 push-buttons.
The counter-output is just for debug. :)
But I learned something from the way you used the switchboxes.