unlocking a character working with tables
digitalzero
Member, BASIC Posts: 639
i am VERY VERY VERY new to tables... i dreaded the moment where i was going to have to learn them... but im trying now because my game is going to have a decent amount of unlockable characters... i just need to know how to make this happen.... let me tell you what i have thus far.... i created a table labeled TB character unlocked and i have a column that is called character unlocked with a boolean attribute... on the rows i have all the characters that are able to become unlocked and they are false... NOW here is the part that im not getting... in my game i need a rule that says if "such and such" character is not unlocked (false boolean) then change attribute self.color red to .5, self color green to .5, and self color blue to .5
i know this may seem simple... i have no idea about tables and right now im trying to go through all the tutorials to find out how to implement them into my game...
can someone please help me out!
i know this may seem simple... i have no idea about tables and right now im trying to go through all the tutorials to find out how to implement them into my game...
can someone please help me out!
Comments
Yeah, use the Change Attribute behavior to change self.colors, and Change Table Value to change the false character to 'true'.
Hope this helps.
Change Attribute self.unlocked to tableCellValue(tableName, row, column)
When attribute self.unlocked is false
..... [change color]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Then shouldn't he use 'Change Table Value'?
When tableCellValue(tableName, row, column) is false
And that's simply not possible without the step I mentioned above.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Oh yes. I see that I misread his question.
Sorry about that.
In that case, yes, he would have to constrain the Table Cell Value to an Attribute, then use that.
Here's a tip-
What I like about Tables is that you can use it to automatically collect data, and then utilize that data, automatically, for other functions.
This can do some pretty cool stuff with this!
For example, in my upcoming game, I will have a 'Time Trial Mode'. I've set it up so that 'Every 0 seconds' to save the characters x and y position, then the next time they replay that level, they can see their ghosts (and it picks the fastest ghost by selecting the table with the smallest RowCount- there is an expression for that!)
This is just an example of an advanced feature that you can do with tables.
(if you're interested in doing something like that, download this demo- (I learnt from this demo, and then incorporated the mechanics from it in my game. Then I added some of my own code to get it working the exact way I described above. http://gshelper.com/gs/Follow draw path demo.zip )
Learning tables isn't too hard; once you do, it has great possibilities within your app. A lot of things you may have once considered impossible will become possible
Hope this helps,
Chakku
Yeah, tables was a much-awaited feature, and so was writeable tables.
Once upon a time , around 8 months ago , we got writeable tables, and before then, tables were read-only, meaning you couldn't do anything to them during runtime.
Tables have come a long way, and do indeed make things a lot easier!
Something I have noticed from newbies is thatr they get confused over saving and loading attributes. It is so much easier to just put the attributes into a Table and 'Save Table'!
Hope this helps
Chakku