Random set images with tables problem.

33miles33miles Member, BASIC Posts: 71

Hi all! :) Can someone please take a look at this demo for me and help figure out what I'm doing wrong? I have 9 on screen actors and I want them to get a unique image based off a random table row value that is called upon from within another actor on screen. The problem is that I'm getting repeats which is baffling because in my rules I'm removing the row thats getting used before the next one is called. This seems strange, so please anyone take a look if you can. :( Thanks so much for your time and I look forward to your replies! o:) https://www.dropbox.com/s/am01km7ksb3zesa/Random set image 0.1.zip?dl=0

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803

    You are changing the image to the index that is randomly selected instead of the value at that index. The actor that selects the random number, put that in an actor attribute instead of a game attribute and store the cell value at that index in the game attribute.

    You can also cut down logic by setting the self.Image value to that passed in number instead of all those rules since the number is the same as the image name.

  • 33miles33miles Member, BASIC Posts: 71

    Hi @CodeMonkey :) Thanks for responding! I'm afraid I'm not quite comprehending what I need to do... :'( I have always had trouble with tables when I tried to use them. Could you please give me a quick example in fairly simple terms? Thanks so much!

    P.S. The number will not always be the same as the image name. That was just for the demo. Thanks! :)

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

    Try this.

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

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

    And here's a version that uses a single actor and also uses text strings for the table values (which could be any image names you like).

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

  • 33miles33miles Member, BASIC Posts: 71

    @CodeMonkey @tatiang Thanks for the help guys. :) And @tatiang those demos you posted were awesome! I learned a bunch from them. Thanks a sooo much for taking the time to get me out of a really hard spot! :D Oh and by the way my mom loves Bingo games so she purchased your Driving Bingo on the apple app store! o:) We both think it's really cool especially for say our next long trip somewhere hehe. Thanks again. :)

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

    @33miles You're welcome! And I'm glad you enjoyed Driving Bingo. :)

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

Sign In or Register to comment.