Is it possible to get a math_counters value and compare it against a logic_compare value? For example to make a money system and then make sure you have enough to purchase something. And as a bonus (this is not necessary but if you know how, I wouldn't mind getting some of that info) a way to track the value on a game_text and display it to the player. I've been trying to figure this out on my own for the past 3 days and I just can't seem to crack it. Please I'm loosing my damn mind here.
#Logic_compare problems
1 messages · Page 1 of 1 (latest)
logic_compare, set "compare value" to the price. the math_counter tracks player money, so OnGetValue, fire SetValueCompare to the logic_compare, leave parameter blank. in the logic_compare's outputs, have it do whatever you need it to do with OnLessThan, OnEqualTo etc.
for the game_text you can use addoutput to set the text but it needs strings, not the integers from math_counter
you may have to use one game_text for each digit and a logic_case to set the digit based on the counter's value
Wow I was way overcomplicating this, thank you
could you give me an example on how to do this with the logic_case?
unfortunately its really hard to do without scripting
if you can use lua then i would highly recommend you use that instead
that way you can directly pass the value of money to the game text or hudhint or whatever
with logic entities you would need a separate case for every single individual vakue of money
I was fearing this, but oh well, I could probably script the display in, but seems like a lot of work for something that's not really necessary
At least i got the shop system to work so that's good enough
logic case has properties
Case01 up to Case16
the value you set in those field will execute the corresponding output when the logic case receive InValue
so if you put
Case05 80
and your call the logic case like this:
onwhatever > logic case name > InValue > 80
then the logic case will fire OnCase05
so you can connect the math counter to the logic case (or multiple), so that it fire a output depending of the counter value
Case01 1
Case02 2
Case03 3
...
Case16 16
then you can add another logic case with the same name, and continue on
Case01 17
Case02 18
...
Case16 32
then your math counter has
OnGetValue > logic case name > InValue > > delay 0
the logic case name would appear bold as there are two (or more) logic case with that name
you can see the parameter is left empty, so it takes the value from the counter
so you will have to have all possible outputs in the logic case, to change the game text text
if gmod has SetText for game text use that, otherwise it's AddOutput > message xxxxxxxxxx
OnCase01 > text > AddOutput > message Value is 1 > delay=0
OnCase02 > text > AddOutput > message Value is 2 > delay=0
etc..
sadly this doesnt resolve the issue of being able to retrieve values from the math counter and pass then along to the gane text 😦
yeah still gotta plan for all values
I had seen the MapBase thing had added a logic_format entity , which is super cool but i think it actually doesnt even handle integer parameter so it's pointless
lmao