GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Use one table to choose other tables

JH4musicJH4music Posts: 23Member, PRO

I want to use one table as a list of other available tables, and use it to choose which table I want to read data from. Is this possible? I'm asking because I have noticed an issue in the expression editor: typing in the name of a table or attribute as "game.table1"... "game.attribute"...etc. has never worked for me. I always have to dig through the menus and physically select the attribute or table I want to work with.

Here's what I want to do:
Table0 has a text column, each row is the name of a specific table, such as game.table10 (when I am done there will be 20 or more tables, and I want to be able to add more tables to future versions as in-app purchases)
I want to use an integer to determine which row of table0 to choose, and then work with whichever table I have typed in for that row.

The main reason for doing this as separate tables is each of the tables I select from have a different number of rows, and represent a cycle of events that ends once each row has been processed. So one table might have 10 rows, and the next one might haver 50. I use tablerowcount to determine how many events will happen. I suppose I could make one huge table, and have a cell that defines the number of rows for each set of rows, but that is going to be a lot more annoying to manage.

Comments

  • imjustmikeimjustmike Posts: 450Member

    I don't believe you can reference tables or attributes like that in the expression editor but I could well be wrong.

    As a slightly related note, I always append something to the beginning of my table names to make them easier to spot in the attributes list. TB_tablename or TABLE_name works well.

  • JH4musicJH4music Posts: 23Member, PRO

    That's what I have seen too. I was hoping there was a way around that but it doesn't seem like there is.

    Does anyone know if there is any difference in CPU usage between using multiple tables as opposed to one big table? Just trying to figure out if I should use the system I have in place or change it into one big table. I'm worried that having a row with 20-30x more columns will slow down the game, even though I'm only reading data from 4 columns.

Sign In or Register to comment.