Is it possible to make an actor alphabetize the order of words in a table?
Comments
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 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.
Would it stay that way next time you open the game?
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 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.
Comments
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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/
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
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..
Yeah just copy it back with the copy table behavior
Excelent. Then i will give it a go.
Would it stay that way next time you open the game?
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