Delete random row problems...

I have got a project where I have 6 individual squares. They all have their own number, 1 to 6.
I have also got a table, doesn't matter what it is called, with 6 rows, integer, each with a number 1 to 6 from top to bottom.
I also have got another actor, which deletes a random row. He has got an attribute "random", which, every 2 seconds, becomes a random number in one of my rows of my table.

Everybody following?

Now, a lot of problems occur. Sometimes he choses a number twice or waits like 6 second, triple the amount he should (!), before he choses another number. Also, he deletes the wrong row sometimes and he gets stuck with this on his way.

Anyone has got the same problem and knows how to fix this?
I really need this to work.

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer

    One thing to keep in mind is how GameSalad rules work. Rules only "fire" when their condition changes from false to true. So if you have a rule that says when attribute = 3 and you choose a random number from 1 to 3, that rule will fire when it equals 3 (the condition is true) but not if it chooses 3 again (the condition is still true). For that rule to fire again, the attribute would have to be something other than 3 first.

    Here's a Mac Creator file that shows how to avoid that problem: http://forums.gamesalad.com/discussion/comment/513319/#Comment_513319.

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

Answers

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

    Following just fine. :)

    I know how to fix it but only if I can see your rules. You could upload screenshots to a file-sharing service and then embed them here or post a link or you can upload your project file to a file-sharing service and then post the link here.

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

  • nickname5862nickname5862 Member Posts: 51

    Another person advised me to do the same, but you know, I am not a person who makes accounts fast, if you know what I mean.
    I am not a social-media freak.
    I am wondering if I should do it......

    If yes, what do you recommend?
    What "file-sharing service"?

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

    I use Dropbox. Other people here use MediaFire (not sure if it requires an account) and other services. Google Drive is another option if you already have a Gmail account.
    None of those are social media sites. They are tools. As an app developer you're going to need several tools and you're going to be required to sign up for an Apple Developer account at a minimum and probably other accounts for testing apps, marketing apps, etc. so it's something to think about.

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

  • nickname5862nickname5862 Member Posts: 51

    Like this?

    https://www.dropbox.com/sh/1lvyl5byhqh4hdh/AADSgCrpyIBkANh3CW3k55WDa?dl=0

    Or doesn't that work?
    I wouldn't know, I am bad at this Dropbox system, it is slow and I can't find anything.
    Just say if it works....

    And if it does, the picture with the two timers os the one of the actor that deletes the rest.
    The other two are of the actors with will be deleted.
    And deleted is in my eyes: The color red to 0.

  • nickname5862nickname5862 Member Posts: 51

    Please say that this doesn't give you acces to my account.....!!
    I just figured that might be the case......

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

    @nickname5862 said:
    Please say that this doesn't give you acces to my account.....!!
    I just figured that might be the case......

    You shared three images. No, I can't access your account.

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

  • nickname5862nickname5862 Member Posts: 51

    Already thanks a lot, now I know what is wrong with the delays!!

    However, you only answered my problems partially.
    The second and last problem was that it sometimes choses a number twice.

    For example, it choses 3, and 3 lightens up.
    Then, it choses 2, and 2 lightens up, and then it choses 3 again and nothing lightens up.

    It does not happen very often, but sometimes it does.
    It shouldn't be possible, cause he already deleted that number.
    The only possible explanation, for me, could be that it deleted the wrong row the first time, but that glitch wouldn't be able to fix then....

    And by the way, I didn't understand even one single thing from your Log Debugging Statement file.... No offense, but I have not yet worked with @, Log Debugging Statement, dots and RoundTo

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

    I assumed that you would need to fix the issue with repeated random number before addressing the other problem you're having. It's also hard to troubleshoot something when I can only see a few screenshots and not the whole project file, but I'll see if I can help.

    I explain Log Debugging Statements in the video below. The two dots "concatenate" or join expressions. You can look up RoundTo in the GameSalad Cookbook or just try out different values and see what happens.

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

  • nickname5862nickname5862 Member Posts: 51

    Thanks Bro, I have put the whole game file into the dropbox, so you can check that out.
    If you try enough times, you will notice two things.
    1. I haven't changed the delay thing, that is because I am lazy, I am sorry.
    2. The second problem...

    You can check that out, and thanks for the log debugging statement!

    PS: Don't mind my bad English, I am from the Netherlands....

Sign In or Register to comment.