Khodex's Recent Forum Activity

  • Thank you Kyatric I understand your answer, sorry I didn't explain my question very well.

    In fact, because I will have a lot of buttons with the same behavior but of different colors, I would like to avoid to repeat the event for each color. So yes, it works if I use :

    Family Buttons - Color = "blue"

    +

    Family Buttons - Color = "red"

    +

    Family Buttons - Color = "green"

    and so on...

    But what I would like to to is to create an event in which it is written :

    "Pick all buttons where instance variable color is equal to the color of the current instance"

    In other words, I would like to have this event :

    "- For each button

    - Pick all other buttons of the same color

    - If none of them is pressed

    Action = deactivate all the doors of this color".

  • Is there a way to pick my buttons like this ?

    "Pick all buttons where instance variable color is the same"

    In order to create this event :

    "If all buttons of the same color are not overlapping at offset a character = close the doors of this color".

  • I updated the file, now the buttons are all pressed at the same time if one of the two characters is standing on one of them. I think it is more logical and understandable for the player.

    Now, my only concern is about this trembling movement when one of the two characters is leaving a button which is already pressed. It's just a matter of polish.

  • OK, I tried and there is a little trembling movement but I think i can fix it. Thank you for helping. It was pretty useful !

  • I think that I am on the right track with what proposed but there is still a problem with the functions :

    If I put one of the characters on a blue button, it's OK the blue doors are moving. Then, If I put the second character on another blue button, nothing else happens and this is the expected behavior, so it's OK ! BUT, if I removed only one of the two characters from a blue button, the doors go back to their positions even if the other character is still on a blue button.

    If someone has any idea to fix that, it could be very cool because I'm lost ! Thank you !

  • I cannot open your link.

    What I try to achieve is :

    As long as at least one button of a color is pressed, all the doors of the same color are activated. The doors stay activated until no more of these buttons are pressed.

    Because there are two characters, two different colors can be activated at the same time.

    And I would like to use only families events to avoid to copy/paste the behaviors for all of the differents colors I'll have in my game.

  • I mean, if I put the two characters on buttons of the same color, it behave weirdly.

    I hope this time, the image will be displayed :

    But 'ill check if I can adapt it ! thanks !

  • Thnak you for your time on it but there is something which doesn't work in what you did : I cannot press two different buttons at the same time. But I see how you used "For each", thank you.

    My problem is still here. ^^"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To be honest, I really don't know how to use the "For each" event. :/

  • Thank you for your answer.

    I don't know if you checked the last version of the .c3p file but I think this is what I've done in my "GPE " event sheet.

    The event is :

    - If a button is playing "ON" animation (if it is pressed)

    - - Pick doors(family) where instance variable color is equal to buttons instance variable color

    And it works but only if no other buttons of another color is pressed. This is the problem.

  • In the current version (that you can download in the first message of this topic), characters can open doors which are of the same color of the activated button. It works with the blue buttons or the cyan ones.

    But the problem is that there are some... conflicts I think... when the two characters are at the same time on buttons of different colors. And I really don't know how to fix that. And I think when it will be fixed, my problem will be solved.

    Thank you if you have any idea to propose ! :)

  • Doors have a family instance variable (text) which is the color. A blue door has this variable setted on blue, a cyan door has the variable setted on cyan and so on...

    Buttons also have a family instance variable (text) which is empty until a characters activates it.

    When a character is on a blue button, the variable of the button becomes blue. If the button is of another color, the variable becomes of this color.

    So, I tried to open the doors with this condition :

    But as you can see in the .c3p file, it only opens some of the doors of the same color, not all of them as I would like.

Khodex's avatar

Khodex

Member since 6 Sep, 2019

Twitter
Khodex has 3 followers

Trophy Case

  • 5-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

9/44
How to earn trophies