Table name problem in tableCellValue
So I'm working on building a 3D dungeon system, using tables to store the layout of each dungeon level.
each level table is called:
TableDungeon1
TableDungeon2
TableDungeon3 ...etc
I have a game attribute (index) called DungeonLevel that I'm using to keep track of which level is currently in play.
I want to get positional information for a number of actors from a table cell value by using the following:
constrain (actor attribute) to tableCellValue(("TableDungeon"..(game.DungeonLevel)),row,col)
The bit ("TableDungeon"..(game.DungeonLevel)) where Im trying to create the table name just doesn't seem to want to work. It works fine if I specifically set the table individually from the drop down Expression Editor, but not when I'm trying to build it based on the DungeonLevel attribute. Am I simply not getting my syntax correct?
I need to do it this way so I can set up 88 actors once... to pull information from different tables... rather than having to reset them up every time a new level (table) is used...
...any thoughts or input that can put me on the right track would be appreciated.
cheers...
Comments
Would be great if it worked that way @Chunkypixels , but the Table needs to be inserted from the lookup, it can not be build as a string.
Could you have it all in one table? Rows 1 to 100 for Dungeon 1, rows 101 to 200 for the next, etc. You could then change the row attribute (adding 100 depending on the dungeon).
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
As far as I know, you can't just type in a table name because GameSalad doesn't recognize it as a table. I see what you're trying to do, and t would save you a lot of time, but I don't think you can do that.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Oh, beaten by @Hopscotch by one minute!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@Braydon_SFX , I have the advantage of being in an earlier timezone.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@Hopscotch @Braydon_SFX ...Bugger.... seemed like the most logical and efficient way of doing it.
I guess if its not just me using incorrect syntax, and just won't work in GameSalad, then its time for me to have a rethink on how to do it...
cheers guys
Can't argue with that.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I've used @Hopscotch's method and it works great.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ive come up with another way.... I can reference all my actors to one Base table, then just copy in data from other level tables to the Base table when I need to change levels. Thus keeping my initial setup to a minimum.
Having all the levels in one single table might work, but I think it might get a bit tricky to keep track of, if there ends up being loads of levels... I'd prefer to keep each level map separate, so its easier to work with and keep control of.