Appending Table to end

Have not had the need to do this, but working on a project where it might be needed. Anyone found a decent way to do this?

I plan on using the Loop behavior and iterate through one table and copy line by line to the end of the target table. I assume this is how folks are doing this?

I get it to work just fine, but it takes a few seconds.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    That's probably the best method. Depending on what you're doing with the table data, you might be able to leave the data in the original table and just reference it in your table functions. I assume you want to append it because you want to then be able to loop through a single table? Would it work to loop through both tables separately? I'm not referring to copying... just to altering data for whatever you need to do.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • crestwoodgamescrestwoodgames Member Posts: 191

    I will mess around with altering loops. this might to the trick.

    Thanks for the idea!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Here's a method that spawns an actor for each table row. Not sure how efficient it is compared to loops but it might be worth consideration. Note that the destination table (table 1) has to have empty rows (zeroes) for the values that will be appended. I also hard-coded the non-empty (non-zero) rows as the value 15 since I couldn't figure out how to determine that by calculation.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • crestwoodgamescrestwoodgames Member Posts: 191

    This is very similar to what I am doing. Except I use the loop behavior vs spawning a character.

    It gets the job done. Hopefully one day we will be able to reference objects/tables as a variable.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @crestwoodgames said:
    It gets the job done. Hopefully one day we will be able to reference objects/tables as a variable.

    I agree that would be useful. The workaround is usually to put all data in a single table and use offset values (e.g. focus on rows 1-30, or 31-60, or 61-90, etc.). That doesn't always work if you have to use column counts or other table functions that depend on same-column-length tables.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.