ralf5543's Recent Forum Activity

  • Thank you, I'll try to be more precise :

    • It's a local multiplayer game,
    • up to 4 players.
    • Each player can chose from several characters.
    • All characters have got globally the same behaviors. They all run, jump, attack, lose life, collect coins... (of course, they all have got special skills)
    • Because they are all quite the same, but individual characters, they need to use their own buttons, their own life bar, etc.

    In my mind, I wanted to declare the events only once for all heroes, in a family (?), something like Keyboard / Key code heroes.btn_left is down / do something".

    And then, set the variables like "player2.btn_left = 81"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Greetings,

    I'm trying to create a game with several characters, all of them sharing the same controls (one by player). I don't want to repeat all my code for each character, so I tried to gather all the heroes objets on a "heroes" family, and write in my scripts sheets only events like "heroes / set animation to "walk" (all the characters animations share the same name for the animations).

    Then, I add many variables and behaviors to that family, but some of those variables need to be personalized. For exemple, I declare in my events sheet

    Keyboard / Key code heroes.btn_left is down / Simulate Platform pressing Left[/code:2300vcv7] where btn_left is the variable I need to set for each character. I tryed to set them in the properties of the characters, but they then override the family (heroes) variables. I tryed to set them at the start of the layout (character / set btn_left to 81), but it still doesn't work.
    
    How should I use the Families properly to use the same events for all my characters, and personalize their variables ? Or if it's not appropriate for what I'm looking for, what should be the best solution ?
    
    Thanks for your help.
ralf5543's avatar

ralf5543

Member since 21 Aug, 2016

None one is following ralf5543 yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies