Comparing attribute Text values with Spaces, to a tableCellValue (containing Spaces also)?

TheGabfatherTheGabfather Member Posts: 633
edited May 2013 in Working with GS (Mac)
Hi Team!
I've worked around Tables a lot before, but have never tried implementing something like this, even though it might seem like such a simple/regular concept -- to my surprise I can't seem to be able to compare a Text Attribute of an Actor to a Text value in a Table, if there's a Space involved?

Say initially Actor has Text Attribute Letters = blank
Then I populate it with a custom keyboard and I do,
Actor.Letters = Actor.Letters.."a"
Actor.Letters = Actor.Letters.." " (where the space was done with Command+spacekey)
Actor.Letters = Actor.Letters.."b"

Now I know it has a b (no quotes) as its current Text value, even the Debugger tells me so.

So I compare it with one tableCellValue in my Table which is a Text Value of a b (no quotes).

..Doesn't work :(

This already completed project was something I unearthed earlier today, made with Windows Creator 0.10.0 from a couple months ago, and exported to the Mac Creator 0.10.3 just now. It used to work in Windows if I remember correctly, but so far I can't duplicate that success with the Mac.

Any insights? Could it be a simple case of misuse of quotation marks or spaces?

edit: oh yeah, found this Thread. Not sure if the query there is related to mine. http://forums.gamesalad.com/discussion/55664

edit 2: also found this one from 2012, although I don't think Tables were involved here but anyways. http://forums.gamesalad.com/discussion/44361/my-text-doesnt-match-the-problem

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2013
    Hmm... there does seem to be a problem with comparing spaces (even non-option spaces) in text attributes and table cells. I just did a quick test where I typed a space in a self.space text attribute, typed a space in a table cell, and then did a rule When attribute self.space is tableCellValue(tableName,1,1) --> Log Debugging Statement "Matched"... and nothing happened in the log.

    Edit: see below.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • TheGabfatherTheGabfather Member Posts: 633
    @tatiang I thought so (and was afraid of this to be the case).

    Let me tag @CodeMonkey hopefully he'll have more information regarding this :-B
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Sorry, I had something set up wrong. Just tried it again and here's what I noticed:

    1. Adding a space to a table doesn't register if the space is by itself. So "X"..tableCellValue(tableName,1,1).."X" where the table cell contains a space returns XX. But with option+space, it returns X X.

    2. I was able to compare a table cell containing an option+space to a text attribute containing option+space and it worked.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • TheGabfatherTheGabfather Member Posts: 633
    @tatiang YES! Quickly tried it when I saw your post. That works! :D Thanks a ton.

    Now to edit my tables.. it's no problem, only a couple hundred rows of 5 columns each to edit.. @-)

    @CodeWizard will applying a solution to this be a low-hanging fruit for GS? Perhaps enforcing option-spaces in Tables.. but that would be a pain if you're creating say, dialogue values to read from with Display Text (eg for RPGs).
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I think the whole option+space requirement in Display Text behaviors has to go. Maybe that can be done on the back end (we type space, it gets converted to option+space). I don't really know the reason for option+space but it'd certainly be more user friendly since people tend to be confused by the need for it.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.