Star System Works with Display Text, But not with Images

DaGreatnessDaGreatness Member Posts: 82
edited November 2013 in Working with GS (Mac)
I am busting my head over here, because i just setup a star system rating with a table, just like the one that GSHelper has, but if i say display text and click thru the levels, it seems to calculate perfectly fine. But i do not want to display the text, i want to display an image for the amount of stars collected. So the thing that is happening is, let me break it down

I have a table setup with 2 integers as Score and Stars

Right now, the way it works is, that i am displaying the text of the value which is in that cell on the actors on the level select screen for the stars. Which Works

But I want to have it so that if the value of the stars is 1, in the table cell value, i want it to change to an image that has 1 stars, and when the value of the cell is 2 i want it to change to an image with 2 stars and when the value is 3 i want it to change to an image with 3 stars.

How is this possible? Because i say the video on how to constrain an image to a column and use a trigger to move it to the next row. But that is something different than what i am trying to accomplish. I want it so when the level completes and goes on to the next level i want the value that was collected, lets say 2 stars, i want the image that has the 2 stars to show up, but for some reason it will not do it. The level complete that was created in the star system over at gshelper seems to only work with displaying text and not images.

Is there something i am missing? If someone can let me know how to use that star system at gshelper.com by displaying the certain images for the value that is in the table cell once the stars are collected, that would be great, and i will really appreciate it!!! Thanks in Advance

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You can do change attribute self.Image to tableCellValue() where tableCell Value is an integer and your image files are named "1.png" "2.png" etc. I think it's not necessary to include the file extension but if you need to you would change self.Image to tableCellValue()..".png"

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

  • DaGreatnessDaGreatness Member Posts: 82
    @tatiang, you kinda of lost me, where do i put in the change attribute? on the image that i want to display for the value in the table for the stars?

    Honestly @tatiang for responding i extremely appreciate it, but i am not comprehending what you just wrote, it could be that i just didnt understand what you responded with
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yes, on the actor that you want to show the stars.

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

  • DaGreatnessDaGreatness Member Posts: 82
    @tatiang, ok i am trying this out, when you say self.Image to tableCellValue()..".png"

    What do we input into the TableCellValue() do we keep it like that and do the "png" i think maybe that part is confusing me. If you can give me an example by plugging in the some values at random so i can get a better understanding on what you mean by that.

    Thanks
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Hopefully this demo will answer your questions.

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

  • DaGreatnessDaGreatness Member Posts: 82
    edited November 2013
    @tatiang THANK YOU FOR THE DEMO, i have been butting my head all day with your demo today, i was doing alot of tests of inputting and changing to see what is going on. I still was not able to get it to work, I have attached my .rar file for you to check it out, maybe you see something that i am not seeing?

    I need to collect the stars, and once i hit complete level i want it to populate on the level select screen for that particular level, Right now They are not doing what they are suppose to, they images do change but there in correct

    http://speedy.sh/6TjBn/Mygame.rar and just click on the text that says download mygame.rar at the top

    I hope me giving you this file, can help you determine what i am trying to do. If you can debug it, honestly i will be so grateful to you
  • DaGreatnessDaGreatness Member Posts: 82
    edited November 2013
    @sadida172 Thanks for responding ok so from what you are saying, input the png file into the table where i have the stars score etc setup in that table

    My value for the stars are in integers, so when i even try to do 1star it removes the star part because it only needs a numeric value. Or should i create like a 4th column labeled like starImage and have it on text and then type in the values of 1star, 2 star, 3 star?

    When i go into the star display actor, this is the one that has 0 stars on it as of right now, and when i constrain it self.image to tablecellValue(myTable, (Self.what level) or (Game.what level), and the column should be the 4th one because thats where it is referencing to or will it be like the column where the stars integer values are?

    also when you wrote: tableCellValue(X,Y,Z [these are only spaceholders]).png;

    Do I have to add the .png at the end for it to work? I am sorry if i am being such a pain, but i am trying my best to comprehend it, i do get the logic but for some reason i am not being able to completely finish it
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    @DaGreatness The problem is that you have used the game.What Level Is It attribute in your tableCellValue expression in the Stars Rating on Level actor when you should have used self.What Level is this. That should fix the Level Select Screen scene. Also, you don't need instances. Go ahead and make that fix in the prototype actor and then revert all of the Stars Rating on Level actors on the scene to prototypes.

    One more thing! Your images will work fine when named (as they are) 1.png, 2.png, 3.png, etc., but you named the image with no stars 1.png and the image with one star 2.png... they are all off by one. Change their names so that they match the number of stars you see (e.g. 3.png should be the image of all three stars filled in).

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

  • DaGreatnessDaGreatness Member Posts: 82
    @tatiang OMG TATIANG!!! I OWE U MY FRIEND!!! I DONT THINK U REALIZE HOW MUCH I APPRECIATE YOUR HELP!!! I FINALLY GOT IT TO WORK THE WAY I NEED IT TO!!! THANKS @sadida172 AS WELL. YOU GUYS ARE GREAT!!!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You're very welcome!

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

Sign In or Register to comment.