Tables and using scene.name as a parameter
HI folks - having some trouble here:
I'm trying to use the scene.name as part of a expression to read from a table value.
so say my scene is called "Banana Shoe", level names are in rows in the table (I'd like to use non-number names so it will be easy to reorder them as I generate levels without getting seriously confused) - I have values attributed to that level in columns like - bestScore, bestTime, levelComplete.
So I'd assume to get the bestScore value from Banana Shoe level from an unlocked actor in the scene- I'd do this:
tableCellValue( game.Table ,"scene.Name","bestScore")
I've found this doesn't work and refuses to return a value at all - If I use scene.Name without the quotes It'll just read in the first row (I assume a default read due to the scene.name being a string)
As a workaround I've used the row number straight - this works fine but will be a paaain when I have to reorder the levels.
anyone else tried this with success?
I'm trying to use the scene.name as part of a expression to read from a table value.
so say my scene is called "Banana Shoe", level names are in rows in the table (I'd like to use non-number names so it will be easy to reorder them as I generate levels without getting seriously confused) - I have values attributed to that level in columns like - bestScore, bestTime, levelComplete.
So I'd assume to get the bestScore value from Banana Shoe level from an unlocked actor in the scene- I'd do this:
tableCellValue( game.Table ,"scene.Name","bestScore")
I've found this doesn't work and refuses to return a value at all - If I use scene.Name without the quotes It'll just read in the first row (I assume a default read due to the scene.name being a string)
As a workaround I've used the row number straight - this works fine but will be a paaain when I have to reorder the levels.
anyone else tried this with success?
Comments
as the name is an attribute … it should be selected
create a gameAttribute: text type … sceneName
create a controlActor … unlock an instance in each scene …
-changeAttribute: game.sceneName To: select Current Scene Name
then changeAttribute behaviors' expression is tableCellValue( game.Table ,game.sceneName,"bestScore")
no quotes for selected attributes
I've been trying to avoid generating game attributes- and trying to see how much I can get into the tables - But I get your logic there, I'll give it a hoon!
B-)