Lookup a table row by comparing a text attribute?
BrackAttack
Member Posts: 22
Say I want to change an actor attribute's value, and the value I want is in a table. Instead of using the look-up row#, can I rather have it determine which row to use by finding a matching value within in column 1?
For example:
If my actor has an text attribute value, say self.code=3XW; I want to find 3XW in my table, then reference that row.
using: tableCellValue(table,row,col)
I don't want to say row=3, I want to say row=3XW (whatever row that happens to be)
So somthing like, 'Change attribute self.CodeReport to tableCellValue(table.codebook,self.code,2)
Comments
So you want to search a table for a certain row number or column number based off a pre existing key? If that's the case, you can use the new tableSearch function in the new release candidate. I put up a community tutorial on how to search a table in this thread: http://forums.gamesalad.com/discussion/63093/community-tutorials-by-braydon-sfx#latest
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Interesting! So I'm on a Mac, I'm not seeing those options yet...sound like I'll have to wait.
But yes, basically, I want to use an attribute to look-up a row(or column) in a table.
Go to gamesalad.com and click on Download Other Releases to download the Release Candidate. There is also a thread explaining this at the top of the list of new threads: http://forums.gamesalad.com/discussion/65354/release-candidate-0-11-0-1-is-available/p1
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks yous