Function parameter in text message

There's probably a simple solution to this, and I've tried all the permutations I can think of.
I have a message, but I want a different message to be displayed depending on the Boolean value of the parameter being passed to it. The parameter name is 'pre'. I'm using the text processor {…}
So I've tried.

{if pre = true:crosses}{if pre = false:crossing}
{if pre = "true":crosses}{if pre = "false":crossing}
{if pre:crosses}{if not pre:crossing}
{if pre:crosses|crossing}

But it doesn't seem to like any of them.
Any help as always is much appreciated.


The text processor only takes attributes, not variables. Try this:

game.pre = pre
msg ("{either game.pre:crosses|crossing}")

game.text_processor_variables = QuickParams ("pre", pre)
msg ("{either pre:crosses:crossing}")

The only variables the text processor can access are the ones in the text_processor_variables dictionary.
The third option is correct, but if you're checking both true and false it's quicker to use either.


Thanks for the help guys. That works great. Much appreciated.


Log in to post a reply.

Support

Forums