How can I use a table name as a variable

BigDaveBigDave Member Posts: 2,239
edited March 2016 in Working with GS (Mac)

Maybe someone of you knows how to do this.

I got multiple levels/scenes.
Each is loading data from the related table. Example Level 1 -> Data from TB-Level1

Problem:
I got thousands of rules loading from that one Table and this would require me to go through each rule and change the table to the current level.

What am I looking for:
I want to have one attribute which I give the important table reference too.
And in all other rules it uses this attribute.

Example:

change attribute self.currentleveltable to TB-Level1

tableCellValue( self.currentleveltable,1,1)

But this does not work for text,int or index variable types
Any idea?

Comments

  • BigDaveBigDave Member Posts: 2,239

    Here my test setup

  • ApprowApprow Member Posts: 703

    Im not sure if I understand you correctly, but do you want to transfer all the table data to one single attribute?

  • BigDaveBigDave Member Posts: 2,239
    edited March 2016

    @Approw
    Only the reference - the name of the table
    so i can use it in all conditions

  • ApprowApprow Member Posts: 703

    I think I understand what you want. I don't have GS anymore but I think this should work.

    Just create the tables which contain the level preferences/properties or whatever is in there. These are the Level[..]Master tables.

    Then create one table with maxed out cells and columns, lets call this one "LevelLoader".

    Then, if the level is 1. Copy the Level[1]Master table to the LevelLoader table.
    Now you can change all the attributes to the LevelLoader table, which I think should solve your bottleneck:D

  • BigDaveBigDave Member Posts: 2,239
    edited March 2016

    @Approw
    Exactttllyy what I want!!
    Thanks man!

    PS:
    Tested works!
    Current level table maxed out with rows/Cells
    loads the relevant level table over it
    Bam!

  • ApprowApprow Member Posts: 703

    @BigDave Awesome, glad I could help:)!

Sign In or Register to comment.