ralf5543's Forum Posts

  • 14 posts
  • Make sure you didn't accidentally set Player.PressedKeys to a number type variable

    I did :/

    Feel so stupid

  • You don't have to be sorry, you were already so helpfull.

    I'll try this tonight.

  • HI again,

    I'm stuck at this point :

    If I add quotes to remove the error, of course it doesn't work :/

  • While I am at it, what would be the best solution to select from alernative images (like portraits) in the menu page, and not directly the characters ? Share some variables between chars and portraits ? Give a new animation for chars (a static one with a portrait) ? Someting else ?

  • Wow, better and better...

    Now I need the entire week to understand all, and apply it to my project. Or should I start again from beginning ? I have succeeded in doing interesting things, like adding operational live bars for each active character, behaviors and animations not repeated, etc.

    Anyway, thanks again for all your work, I'm pretty sure it will be usefull not only for me but for anyone.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just a question : when you write

    Pick Player where Player.UID != Player2[/code:2cnjsnz6] (on mouse click), it prevents player1 to attribute his controls to a character already selected by player 2. But shouldn't it also prevent from attribute several times the same controls to differents characters ? To make it clear, make this event possible only if Player.UID hasn't been set yet.
    I tried Pick Player where Player.UID != Player2 [b]&[/b] Player1, but it doesn't work.
  • It works peeeerfectly !

    Now I can destroy my project and start again on solid bases. I already tested with platform behavior, and now all I have to do is add a real selection menu with nice portraits

    Thx x 1000.

  • Hi again,

    I tested on my project and it works perfectly, thx again.

    BUT, 2 things are annoying me : if I follow your exemple, I need to reproduce every animation (and behavior, and condition, and...) to each player, for every character. Let's say we have 8 characters and 4 players, that means I have to copy 32 times the same code. I'm sure we could find a better way to optimize it. Besides, for each animation, I need to import again and again every frames, check that the collison polygons, and the image points are the same for each player (I didn't find a way to copy/paste an animation from an object to another).

    I tryed to clone the object player1, but now it seems that the player2 (the clone) is ALSO a player1 object.

    In brief, isn't it possible to think in reverse order ? I mean, create each character, and then, give them the inputs of the right player ?

    (I apologize if it's going to be a little bit off topic, if I need to, I will reopen in a more appropriate part of the forum)

    Edit : Thank you RageByte, I will look at your file.

    Edit2 : wow, it looks very impressive and efficient. I need to take my time to understand every line BTW, thak you for the comments !

  • Exactly what I needed !

  • One last thing, I I may. In your exemple, the controls are based on the selected character (knight, wizard), not the player. I wish the player 1 could control any charatcer with left/right, and the player 2 with A/D. Is it possible ?

    Oh, and I suppose your health variable is actually common to all characters. So if knight and wizard are playing together, they die together ?

  • Thank you again.

    The event sheets were clear enough to let me understand. I can see that you repeat the controls for all characters, so I suppose there is no way to declare them only once, and change a simple variable. Too bad

  • Hmm, I get the idea, but can you show me a concrete exemple ?

    Let's say I only need 2 players (player1 and player2), 2 selectable characters (knight and wizard), and 2 events (go to left, and go to right).

    All characters' animations share the same names (walk_left and walk_right).

    What do I need to write in my events sheet to not repeat my code ?

    What is happening when player2, who previously selected knight, is moving to the right ?

    When I'll understand this, I think the most part of my project will be easy (well, I hope...).

  • 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"

  • 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.
  • 14 posts