Closed MoogieOuttaMyDepth closed 3 weeks ago
I found the problem. I didn't really know how to go about the syntax of the expression, so I neglected to surround the property and value with "" string quotations. Properly formatting the expression as
"mood" == "hunger"
Fixes the errors. Although, it should probably not complain about them being floats.
Well if you have an expression property named hunger
which is a float
then I think it's the right thing for the evaluation to say "errm you are comparing strings with floats here, this will never work". Otherwise your expression would be silently returning false
every time and you would have no clue what the problem is.
Don't know why this is happening all of a sudden, I did have things working a while ago, but then I realised I was still handling too much of my transitioning logic in code and remembered I could just use expression guards instead.
But then when I set the expression property like this: statechart.set_expression_property("mood", urgent_mood)
And check it with: "mood == hunger"
It throws an error like I'm trying to use a float. But "mood" is a String and "urgent_mood" is statically typed as a String, so I don't understand where this issue could be coming from.
I've followed the stack trace to my "decide_mood()" function and it only ever uses the "urgent_mood" variable, or the placeholder string "Fine". It never uses a float.
Feels buggy, don't know what else to check or try.
Full error: