Attributes reset when two types of actor touch???

I have a strange bug...

I have two types of actor;
-The player actor which moves towards the mouse when the button is held down.
-The enemy actors which spawn into a random position on the screen with random colour, size and movement speed. They then move to random positions (then to another when reached, then repeat, etc).

When the two types of actors touch the enemy actors size and colour gets set to red and the smallest size BUT I haven't set up any collision logic yet... so how is this possible???

Kind regards,
Guardian

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    **"Why the actor go to the left?"**

    Hey there @Guardian - We need a wee bit more information. Can you post up screenshots of your rules in both actors? Actually, just the actor that gets changed for no reason, but both set of rules would help, if we could see them.
  • GuardianGuardian Member Posts: 54
    Yes, I will try but it maybe better to upload my project to an FTP. If that is ok?
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
  • GuardianGuardian Member Posts: 54
    edited February 2013
    Here you go.

    ***LINK REMOVED***

    The actors in question are Player and Bug. You can test the issue in the 'Game' scene.
  • GuardianGuardian Member Posts: 54
    edited February 2013
    Oh and bugs are spawed in from the SetUp actor. You may also see another issue with bugs randomly dissappearing (that could be the position resetting too???) It's also work in progress..
  • GuardianGuardian Member Posts: 54
    edited February 2013
    So I narrowed it down.

    In bug I check to see the distance between the bugs and player position is below a value. I then reuse the Random attribute which i set to 0 or 1. If I turn that change attribute off then the problem goes away... but how does that make sense???

    I know I'm reusing that attribute in the setup section, but that rule is off at this stage.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    I'm looking at your project, and you're right, there are no collide rules, but the bugs default to the red one when the main player comes in contact with them.

    I'll have to look at it more in depth to see why they do that especially with no collide rules. Right now I'm thinking it has something to do with your random color and size change. But they all seem to default to red when colliding with the main character, regardless.

    This could be a bug with how your rules are set up (no pun intended)

    What do you want the little bugs to do when you run over them?

    If you want them to destroy, that works, because I put a collide/destroy rule in the little bug, and it destroys when colliding with the main character.
  • GuardianGuardian Member Posts: 54
    I will want to destroy them when they collide with the head of the player. However, this needs to be carefully controlled. Basically I'm making a game with a difficulty that scales through natural selection. The remaining bugs will breed which produce offspring with their parents attributes. So I need to make sure my t's are crossed and my i's are dotted before moving onto the next step.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    I went through the rules and started turning things off 1 by 1, and when I turn off the "Red-self random =1" in the "Change Color" rule, it stops it from turning into the red bug, but the sizes still change. And when I turn off the "Change Size" they do as you are wanting them to I suppose, but they all are at the same full size.

    You're probably thinking "No duh, Einstein...Of course it doesn't turn red or change sizes when you turn off the red rule, and change size rules." But what that tells me, is it's somewhere in those 2 sets of rules, and any other attributes that reference those sets of rules could be involved.

    And the reason I think it may be a bug is because there are absolutely no collide rules whatsoever in your project so far, which makes no sense, because these changes are happening when they collide with each other.

    One more thing. I don't see another rule, or otherwise statement for When-Attribute self.setup is "true"...Just the conditions for false. If turn that to true, all the bugs are big and red, and don't move. Come to think of it, that may be part of the issue with change color and change size as well.
  • GuardianGuardian Member Posts: 54
    self.setup is set to true after the first rule is run. This stops that rule from ever running again. Then the main rule timer rule then checks if things have been setup.

    So sounds like you came to the same conclusion as me. It looks like when those actors collide all the attributes get set to 0.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited February 2013
    What you can do is make a display test actor and put several on the screen, and have them display the different attributes, so you can see for sure if they are changing. I'm about to leave, or I'd try that myself.

    And it's not fixing the original problem, but when you use a collide rule with a destroy for the bugs, which is eventually going to be your final objective, it works fine because it's not getting a chance to run through the program bug/unwanted script. But like I said, it's not fixing the original problem, and if the problem is a program bug and not just unwanted scripting, that could leave the door open for a crash or freeze, possibly.
  • GuardianGuardian Member Posts: 54
    edited February 2013
    Thanks for your help. I'm pretty sure its a bug in GameSalad so I'll send a bug report in. I have a magical ability to find bugs..
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    So I narrowed it down.

    In bug I check to see the distance between the bugs and player position is below a value. I then reuse the Random attribute which i set to 0 or 1. If I turn that change attribute off then the problem goes away... but how does that make sense???

    I know I'm reusing that attribute in the setup section, but that rule is off at this stage.
    Boy do I feel stupid...I don't know how I missed this post. But that's the issue. It's something with the magnitude and attribute changes. I didn't see that in the actor originally.

    There doesn't need to be a collide rule if you use magnitude to change attributes at a certain distance. There's no program bug as far as this is concerned. I apologize.

    I could have saved us both a lot of time if I was paying more attention :P
Sign In or Register to comment.