Please or Register to create posts and topics.

Converting math_counter's OutValue parameter to a string?

I've been messing around with model animation, and I created a "counter" model consisting of a box with a window showing a spinning disc not unlike a mechanical odometer. The actual appearance of the model is irrelevant, but what is relevant is that I defined a $sequence for each digit (0-9) and named each one just that digit. The purpose of doing this was so I could presumably connect a math_counter's OutValue output directly to the prop_dynamic's SetAnimation input. However, when I tried that, each time the output was called, the following error was outputted to the console:

Code: Select all
!! ERROR: bad input/output link:
!! prop_dynamic(counter_prop,SetAnimation) doesn't match type from math_counter(auto_counter)

I assume this is because the math_counter is returning a numeric value, whereas SetAnimation is expecting a string value. How can I tell the engine to treat the number as a string?

Use a logic_case.

Blaizer wrote:
Use a logic_case.

I was hoping for a solution that didn't require me to manually specify the string for each value, but is that the only way? Or is there a feature of logic_case that isn't obvious? Still, thanks for the tip; I didn't know about that entity, and previously I thought the best way to accomplish the kind of task it was designed for was to use multiple logic_compares.

EDIT: Off-topic, but I just noticed: before this post, we had the same number of posts!

Okay, I created an instance with that model and a logic_case, but take a wild guess what happened when I tried to call the instance's proxy input? Yep:

Code: Select all
!! ERROR: bad input/output link:
!! func_instance_io_proxy(counter_1-counter_relay,OnProxyRelay1) doesn't match type from math_counter(math_counter_1)

God damn it; WHY do entity IO parameters need to be strictly-typed? :notwant:
I just decided to use a prefab instead. Thanks!