Upon collision, I can't make my actor change its size...

I have a rule, when actor falls off a cliff, change a Boolean attribute to true.

However, if I try a rule like this:
When Boolean = true
--> Interpolate width & height to "X"
Otherwise
--> Interpolate width & height to "Original size"

"X" = my specified size

This doesn't work, so I tried doing the same but with the change size behaviour within a timer container, so when attribute is true, grow, otherwise shrink.

This too failed to work. What happened on both occasions was that the actor would sort of flicker between the two sizes in a very rapid but irregular way. If I remove the change size rules and replace them with change alpha for example, it works perfectly...

I can have an actor display the Boolean attribute so I an clearly see that that is functioning correctly, which it is.

Any ideas?

Thanks!

Ps: I am working on a PC!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Okay, so you've verified that the boolean is changing value correctly and I'm going to assume that it stays true when the actor "falls off a cliff" (it doesn't revert back to false).

    So we need to look at the behaviors inside of your When Boolean = true rule:
    --> Interpolate width & height to "X" ["X" = my specified size]
    Otherwise
    --> Interpolate width & height to "Original size"

    So you're having the actor grow when the boolean attribute is true. Does that work? What happens if you turn off the behavior in the Otherwise section?

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

  • iCreationZiCreationZ Member Posts: 158
    If I switch off the otherwise section, the player grows. Really weird...
  • iCreationZiCreationZ Member Posts: 158
    edited March 2013
    And yes, as long as the actor is overlapping the "hole" actor, it retains the "true" Boolean status.
  • ashtmjashtmj Member, PRO Posts: 405
    Are the Interpolate rules set for the same amount of time? if they aren't that could be the problem.

    other wise you could make a second rule rather then using the other wise.

    2nd rule

    if the Boolean "touching wall" is false
    and
    players X width is = to increased size

    Interpolate back to the original size
  • iCreationZiCreationZ Member Posts: 158
    edited March 2013
    @ashtmj I've tried that too! Two rules works just as well (i.e. not at all!) as one multi-purpose rule...

    And yes, the time for interpolate is identical in all four instances, changing width & height on both occasions.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    If I switch off the otherwise section, the player grows. Really weird...
    Then the boolean isn't staying true. If you have a rule When boolean is true grow; Otherwise shrink, and it flickers instead of changing size and it grows when Otherwise is turned off, then that's proof that your boolean is changing value.

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

  • iCreationZiCreationZ Member Posts: 158
    Right... But to the best of my knowledge, there is nothing adverse effecting the attribute.

    If I swap out the "When attribute Boolean = true" for "when actor collides/overlaps with actor of type "Hole" to remove that variable, the same issue still occurs.. #-o
  • iCreationZiCreationZ Member Posts: 158
    I believe it to be a bug within the windows creator.

    If I get a chance, tomorrow I'll try it on a Mac...
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Okay, so that leads me to believe that the collision isn't staying true the entire time. If you'd like, you can send me a download link to your project file and I can take a look.

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

  • iCreationZiCreationZ Member Posts: 158
    @tatiang It's a big file, so I think it may be easier if I keep trying to find the issue myself, stripping back the code until I find a problem. It may well be a windows bug, so I'll have a look in a bit more depth.

    Thanks for the offer though!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You bet. And good luck with it!

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

Sign In or Register to comment.