A B C D E F alphabetize

smurftedsmurfted Member, PRO Posts: 586

Is it possible to make an actor alphabetize the order of words in a table?

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    What do you mean? Like can you tell if Apple comes before Bread?

    If so, yes you can assuming the table info is set before the game begins and it was already alphabetized. You can use the tableSearchFunction to find both words in the table, then compare the values. If Apple = 16 and Bread = 25, then 16<25 which means that Apple comes before Bread. Make sense?

    You could use some sorting method to alphabetize the words if they are not alphabetized when the game begins. While this is possible, the code will be cumbersome and it could take a lot of time to finish depending on how many words you have.

  • ArmellineArmelline Member, PRO Posts: 5,368

    I made a template to alphabetise tables. It's not hugely fast though. Could probably improve it with a bit of effort.

    http://gshelper.com/shop/gamesalad-templates/armellines-templates/alphabetise/

  • smurftedsmurfted Member, PRO Posts: 586

    Braydon: My table is huge & getting longer, but isn't alphabetised..

    Armelline: Is it possible to put the alphabetised table back into the table? Or is that not possible..

  • zweg25zweg25 Member Posts: 738

    @smurfted said:
    Armelline: Is it possible to put the alphabetised table back into the table? Or is that not possible..

    Yeah just copy it back with the copy table behavior

  • smurftedsmurfted Member, PRO Posts: 586

    Excelent. Then i will give it a go.

    Would it stay that way next time you open the game?

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

    If you use a Save Table behavior, then the table data will load exactly as it was when the Save Table behavior was run. If you don't, then the table data will reset to the initial content.

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

Sign In or Register to comment.