Comparing attribute Text values with Spaces, to a tableCellValue (containing Spaces also)?
TheGabfather
Member Posts: 633
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
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
Edit: see below.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Let me tag @CodeMonkey hopefully he'll have more information regarding this :-B
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
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).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User