Storring actors possitioning

Hey, I'm trying to build a game with tables, but having lots of levels and things to store is making it quite messy.

I was wondering if it's possible to store multiple values in a single cell. I know I could use %10, %100, etc if I combine the values into a single string, but was wondering if there were any other options - staring at lots of long numbers is a daunting prospect. Anyone been able to use a text cell and comma separated values? And if so, how well does that extend beyond just two values? Can you store a string that is 172,3,31 and be able to get the middle number, regardless of the size of the values? (i.e. in that example, the first value is 3 characters long, but would it still work if sometimes that number was only 2 characters long?).

Does any of that make any sense?

Comments

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

    It makes sense. But if you are using variable length values then you need a separator character such as #172#3#31 (or commas but I like to use a separator at the start) and then would need to use the text functions to find that separator using a Loop behavior to cycle through the whole attribute value.

    Edit: I'm wondering why tables aren't working for you. They usually make things MORE organized, not LESS.

    Edit #2: Another option is to padInt() each value before concatenating it into a single text attribute so that each value entry is the same length (e.g. #172#003#031). Then you can use a simple math formula to get the 2nd or 31st or whatever value you need from the string.

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

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

    Here's a demo. It doesn't work if the value to find is the last in the string (e.g. 31) so that would need to be coded still.

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

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

    And here's a version that works for the last value as well.

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

Sign In or Register to comment.