How do I exclude several animations from condition? {solved w/answer}

0 favourites
  • 10 posts
From the Asset Store
Several elements of the game interface hidden objects
  • Hey C3! Happy New Year's Eve eve!

    Trying to put a condition that will allow the actions to apply to a select set of sprites that have the relevant frames displayed. However I'm not having much luck.

    Ideally I want the mouse-over to work on the sprites that have a corresponding JSON entry that matches the frame. Otherwise, the mouse-over shouldn't do anything.

    This is my latest attempt. I've tried not equal to and also equal to. Wasn't sure if the & could be used. Any help would be very appreciated! Thanks all.

  • You need "OR" operator here, not "AND":

    Sprite.AnimationFrame=1 | Sprite.AnimationFrame=2 | Sprite.AnimationFrame=5

  • You need "OR" operator here, not "AND":

    Sprite.AnimationFrame=1 | Sprite.AnimationFrame=2 | Sprite.AnimationFrame=5

    Thank you for the help! Attached is the code however I must have done something wrong as it isn't working still.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There are two ways to do it -

    1. create an OR-block, but it needs to be a sub-event under "Mouse cursor is over object"

    2. use System Evaluate expression as on your first screenshot.

  • Actually, if the sprites may be overlapping, then don't use "Evaluate expression", use "Pick by evaluate" instead:

  • Actually, if the sprites may be overlapping, then don't use "Evaluate expression", use "Pick by evaluate" instead:

    The pipe method | was exactly what I was trying to figure out. I didn't know how to list multiple conditions like that and almost 2 hours of searching the site didn't provide that method. Thank you so much!! That will help me going forward.

  • Is there a way to do this with “not equal” as well? Only curious. Thanks

  • Yes, <> operator means "not equal". Here is the full list of operators:

    construct.net/en/make-games/manuals/construct-3/project-primitives/events/expressions

  • Yes, <> operator means "not equal". Here is the full list of operators:

    https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/events/expressions#internalH1Link2

    Thank you for the follow up, especially on New Year's Eve. If you have a spot I can drop some coins for a hot/cold drink, let me know. You've helped me out a lot.

  • It's not necessary, but if you want to buy me a coffee, the link is in my profile.

    Happy New Year!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)