Please or Register to create posts and topics.

How do you increment through a logic case?

I was trying to increment through a logic case by using a math counter so that whenever an input is received, the counter "add"s '1' and whenever 'ongetvalue' it gives the output 'invalue' to the logic case. I also have it so when it hits max, it resets to '0'. Does anyone know why this doesn't work, or if there is a better way to do this?

Name each case you want to be valid in your logic_case an incrementing number from 1 to your highest number. Then then outputs on your math counter should say:

outvalue case_01 invalue
Onhitmax mathcounter_01 setvalue 0

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!

Yea, Thats what I already have. So this should be working then?

That won't work still. Use the OutValue output instead of OnGetValue. OnGetValue is fired when the math_counter recieves a GetValue input. OutValue is fired whenever the input changes. You'd want to use SetValueNoFire instead of SetValue to reset it to 0, so it doesn't re-trigger the logic_case.

Alternatively, you could just add a GetValue input 0.01 seconds after the output(s) that add 1 to the counter.

My stuff:
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]

Alright, This is working now. Thank you so much. I didn't notice that camben said outvalue instead of getvalue. I wasn't thinking of them as different outputs. it works with setvalue instead of setvaluenofire because there is no case with the name 0, and all each case is doing is enabling and disabling logic relays. Again, thank you both.