unlocking a character working with tables

digitalzerodigitalzero 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!

Comments

  • ChakkuChakku Member Posts: 1,513
    edited February 2013
    @digitalzero

    Yeah, use the Change Attribute behavior to change self.colors, and Change Table Value to change the false character to 'true'.

    Hope this helps.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's not possible to use a tableCellValue on the left side of an expression, so you'll need to do this:

    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

  • ChakkuChakku Member Posts: 1,513
    edited February 2013
    It's not possible to use a tableCellValue on the left side of an expression
    @tatiang

    Then shouldn't he use 'Change Table Value'?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @Chakku if he needs to change the value of a table cell, yes. But I was under the impression that he wanted to compare a table cell value to an expression such as:

    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

  • ChakkuChakku Member Posts: 1,513
    edited February 2013
    @Chakku if he needs to change the value of a table cell, yes. But I was under the impression that he wanted to compare a table cell value to an expression such as:

    When tableCellValue(tableName, row, column) is false

    And that's simply not possible without the step I mentioned above.
    @tatiang
    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.
  • digitalzerodigitalzero Member, BASIC Posts: 639
    thanks @tatiang and @chakku really appreciate it... im slowly but surely getting this whole table thing... i just need to learn more tricks like this and then ill be good :)
  • ChakkuChakku Member Posts: 1,513
    @digitalzero

    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
  • digitalzerodigitalzero Member, BASIC Posts: 639
    @chakku... yeah one thing that i have liked about the tables thus far is the fact that you can save the table instead of saving all the attributes... it saves me A LOT of time (eventhough im not quite sure how to use it yet lol) but just the possibility of it makes me really really happy! i always wanted to make a side scroller rpg game like illusia or even a rpg game like pokemon and i feel like i am able to do this now... granted i dont know !@#$% bout it quite yet but i am going to dedicate my time into learning how to put things together and figure it out! because i would love to become a great programmer with gamesalad and i can say i have no formal training in code but youtube has got me to learn plenty of things!!! so thank God for youtube!
  • ChakkuChakku Member Posts: 1,513
    @digitalzero

    Yeah, tables was a much-awaited feature, and so was writeable tables.

    Once upon a time , around 8 months ago :p, 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
  • digitalzerodigitalzero Member, BASIC Posts: 639
    I TOTALLY AGREE!!!!!!!!!! i will keep on looking at tutorials on how to make tables work in my favor!... my game "The Adventures of Tigg" took me a long time only because of the saving process and loading process... GOSH THAT WAS HORRIBLE LOL but i wish i understood tables a little better and whatnot so that i could use it all the time... and that will definitely come in due time :P
Sign In or Register to comment.