using a math_counter's current value

  • If you're asking a question make sure to set the thread type to be a question!

KlashFire

L1: Registered
Sep 2, 2015
17
1
yes, I know ongetvalue and getvalue are a thing, but I am new to this and very confused.

is there a way to get the current value of a math_counter and use it in a logic_case

i.e. if the mathcounter is currently set to 5, make the button press in
 

henke37

aa
Sep 23, 2011
2,075
515
The OnGetValue will forward the current value to the reciving entity. So forward it to the logic_case entity.
 

KlashFire

L1: Registered
Sep 2, 2015
17
1
The OnGetValue will forward the current value to the reciving entity. So forward it to the logic_case entity.
thanks, but can you show me how this would be done in an output. still a bit confused.
I want to make it so that if the math_counter has a value of, lets say, 5 - a button will press in.

also, weren't you one of the "hackers" on the ace attorney translation project?
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
logic_case can be told to fire a specific set of Case outputs when you send it an InValue input.

Name your case values like this. The names correspond to the math_counter values you want stuff to happen with:

vcAeyVG.png


This is what the logic_case's Outputs tab would look like:

5WGxWGV.png


Then set up your math_counter:

pEXzrFd.png


OutValue fires each time the math_counter's value is changed. So if you plan for something to happen on every math_counter value (say you have five buttons) then that's what you probably want to use.

If you only want something to happen when the math_counter hits 5, then you set its Maximum Legal Value to 5 and you use the OnHitMax output instead. That fires when the math_counter hits its maximum value. The maximum value is clamped, so it will never go higher than that.

y5Gcd6l.png


OnGetValue only fires when you send the math_counter the GetValue input. It's a good way of keeping track of a number, and then outputting it on demand. Not sure what you need all this for, but that's just so you know.

See the inputs and outputs information for this entity at the wiki.