GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Concatenating Booleans crashes the game

immor7alimmor7al Posts: 8Member
edited 4:16AM in Tech Support
I'm not a programmer by study, but I was under the impression that concatenating would work with anything. But, if I concatenate a boolean, my game crashes. Concatenating integer-type variables is fine.

Can someone enlighten me?

Comments

  • RattleheadRattlehead Posts: 485Member
    I think you need to provide a bit more detail...

    First off, why are you trying to concatenate two boolean variables?

    Are you trying to do this in a rule?
  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO
    If you are trying this in a Rule, I can't see why it would crash. Putting When All conditions are valid: Attribute A =false; Attribute B=true; Attribute C=false, etc., as an example, then run the behaviours, should work...

    If that's the sort of thing your doing, then that resulting in a bug has surely got to be a bug somewhere...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • immor7alimmor7al Posts: 8Member
    I make a new actor, give it a "Display Text" behavior. I open the expression editor in this behavior and type:

    "showboolean:"..game.boolean

    I hit the green check mark. I put the actor on the stage. When I preview it, the game doesn't run.

    However, if I type something in the "Display Text" behavior's expression editor like this:

    "showinteger:"..game.integer

    ...the game runs fine.

    Sorry for any confusion, like I said I'm not a programmer. And now I know concatenating has more meanings than one.
  • RattleheadRattlehead Posts: 485Member
    Ahhh... so you are trying to display whether a value is true or false. I haven't tried in the latest build that was uploaded last night but I have done it before without prefixing with the "showboolean:" text you have.

    Try taking that part out and see if it still displays the value of the variable. It should.
  • immor7alimmor7al Posts: 8Member
    Yeah, displaying booleans work fine with the "Display Text" behavior if I don't use that syntax. So it would just be: game.boolean

    But, if I wanted to concatenate an integer-type variable and a boolean-type variable in the same "Display Text" behavior, it won't work.

    So, I've also tried it like this:

    "showinteger:"..game.integer.."_game.boolean"'

    ...but, instead of displaying the variables value (which should be just true or false), it displays its ID. I think it displayed something like (var[game.boolean:id3519123]) ...something weird like that.
  • RattleheadRattlehead Posts: 485Member
    Yeah, that is odd. It sounds like there is no conversion to a string prior to displaying it with Display Text or something. Hopefully someone from GS can shed some light on this.
  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO
    Hi immor7al: think I know your problem: you can't concatanate boolean with integer; in other words, you can have any equation with these together. This is because a boolean is just two states, true or false (you can make this 0 or 1 if you want, but that is still not usesful when it comes to equations). Integers, being numbers, can be any number.

    Hope I've understood correctly and this helps.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

This discussion has been closed.