GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Actors not always recognizing Collide rule

RodericRoderic Posts: 145Member
edited November -1 in Working with GS (Mac)
I have an actor that moves from point A to point B to point C upon an event. I use the "move to" to go from A to B, then upon collide tell it to move to C. That works fine. But when it reaches C, I have a rule to change some attributes upon colliding with C. The actor physically collides with C, but the attributes don't change.

Any suggestion on what might be causing this? Can you suggest a workaround?
I'm on .94 pro version.

Thanks.

Comments

  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    If it is bouncing off the actor it could be that the collide is happening so fast GS has not gotten to all of your rules and change attributes before the collide rule become inactive. Try rearranging the rules in your actors so those are near the top and see if that helps.

    It's not my fault I never learned to take responsibility for anything. ;)

  • DrGlickertDrGlickert Posts: 1,135Member
    Instead of collide, you could use a
    RULE; when actor's self.position.X = ? AND self.position.Y = ?
    Move to: x,y,z...
  • DrGlickertDrGlickert Posts: 1,135Member
    Also, I've noticed that collide doesn't work every time unless "moveable" is checked on at least one object.
  • RodericRoderic Posts: 145Member
    How long before the collide rule becomes inactive?

    If I replace the collide rule with the timer rule, giving it say 2 seconds, then change the other attributes it appears to work. But this shouldn't be the solution. It doesn't make sense to have to use a timer in place of a collide rule.

    Any other thoughts?
  • RodericRoderic Posts: 145Member
    Dr Glickert, I tried your suggestion, and logic says it should also work, but it doesn't. I do have moveable checked on that actor.

    It's really strange since the collide rule works on the first collide, just not on the second.
  • DrGlickertDrGlickert Posts: 1,135Member
    Are your collides set up correctly? Are they set to "tags" or to actual actors?

    I think you're right, you don't need to use timers.

    What are you trying to do exactly? Take an object from point a, then to b, then to c, then what happens at C?

    When you mean attributes change, do you mean game attributes? self.attributes (like size, width, height, etc.)?

    A good way that I test game.attributes is to create an actor that has only a display text on it. I put it on my scene and have it "display" whatever game.attribute I'm testing. If it's game.attributes that you're looking to see what happens to them during the scene give that a try and see if any attributes are working or if individual ones are not firing correctly.
  • RodericRoderic Posts: 145Member
    The collides are set up correctly, and they are set to actual actors.

    I'm taking an object from A to B to C and then setting game.attributes to designate where they are, change their self.image, and what state they are in. These are just basic attributes, one is an integer, the second is an image, and one is a boolean.

    I already use your suggestion for testing attributes, that's how I like to debug things. I have a screen full of them, ha. So, it is there that I can see that things are not working. I watch those attributes change as the actor moves from A to B to C, and they change fine upon colliding with B, but then they don't change when colliding with C. The actor stops on C, it just doesn't change the attributes upon making that stop (or collide).

    Should I re-post this in the tech support forum?
  • DrGlickertDrGlickert Posts: 1,135Member
    I would try this;

    Use a self.attribute for the actor, make it an integer, Call it self.pointC or whatever...

    When actor collides/overlaps with point C object change self.attribute to 1

    Rule on the actor;
    When self.attribute = 1, do those things you want done.

    Give that a shot and let me know what happens...
  • RodericRoderic Posts: 145Member
    Dr Glickert,

    I tried your suggestion, but it didn't change the outcome. It seems that all the collide rules I had, used to work in this project, but now the more I test it the more the collide rules become broken. It's like every change I try is like digging a deeper hole and it only gets worse... Frustrating.

    Thanks for trying to help me.
  • JakeMorJakeMor Posts: 136Member, PRO
    set up a timer - make it so that the rules happen .1 seconds after the collision.
  • sebababisebababi Posts: 51Member
    Hi, I had the same problem,

    I had a rule with 3 collisions, so if actor OVERLAP OR COLLIDES with any of the 3 actors and actor tags to something.

    After many annoying tests, I managed to make it work by separating each rule. So it worked, no timer needed.

    It's a pity such a simple thing is not working in GameSalad.

    I hope this can help someone ;o)
This discussion has been closed.