Having issues displaying attributes with "Log Debugging Statement"

moloney55moloney55 Member Posts: 2
edited September 2012 in Working with GS (PC)
//Sorry for double post, put this in general discussion before realizing it probably belongs here in questions

Hi there,

I'm only two days into using Gamesalad so I hope this isn't a dumb user error on my part.
When I use the "Log Debugging Statement" action it works fine with ONLY plain text. But, if I try to display the value of an Attribute pulling it through the expression evaluator it display's nothing but the Actor type as the source ex.: "mouseListener: " even any plain text I include in the statement with the attribute gets wiped out too.

These Log statements are in Rules within Prototypes if that makes any difference, they need to be as the Actors are being spawned mid game. I've tried referencing Actor and Game level attributes to the same effect.
I'm still very early stage with experimenting with some game ideas but the lack of being able to see values is concerning.

Looking over forum posts it seems to be functioning fine for other users, so I'm not sure where the issue lies.

Kevin

Answers

  • moloney55moloney55 Member Posts: 2
    Ok I seem to have sorted some of this out my self. Apparently you can't combine an attribute with text, this causes the blank statement. Also if the value of an attribute is 0 it prints nothing rather than the character '0', this seems pretty silly. Well at least I can get some output now...
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    You should be able to put an attribute and test like this

    "Text within quotes"..game.attribute
  • moloney55moloney55 Member Posts: 2
    I'm a little confused by your use of periods between the quoted string and the attribute. If i want to display something like:

    "My coords are: " self.position.x "," self.position.y

    What do i put between them to concatenate and print something like:
    "My coords are: 312,21
  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    You would put "My coords are"..game.attribute
    You would replace game.attribute with the attribute(s) of your choice.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    It would be helpful if GS did a write up on operators used in expressions. I write JavaScript and most seem common to coding but the .. And others seem relevant only to GS. @straightsaladshooter could someone do an index of operators and their use in the GS expression editor? One of the engineers could write this up in like 20minutes.
Sign In or Register to comment.