New condition type - Problem and Possible solution

0 favourites
  • 9 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hi! My name is Jeff.

    I have a problem and a possible solution.

    For make the move of the Sprite i used the platform, i turned off default control because i want to configure the controls using the Gamepad.

    So far so good, i use the directional gamepad "xbox Controller" and make the Jump press "A" button.

    But, i have 2 gamepads,and i need to make a multiplayer game. to make the control 2 control Sprite 2, I have to copy and paste all command made by gamepad1 and replace Sprite1 to Sprite2?

    This is my solution:

    Made in Photoshop for help.

    I put a platform behavior in the family, because all sprites will receive the platform comportment.

    Sprite1 is UID 0

    Sprite2 is UID 6

    I tested separately and it worked.

    It recognizes that I am focusing the action on a single object.

    Well. This would save me from getting copying and pasting all Gamepad1 commands

    And yet I could do the commands to 4 players with only one line of code.

    But is not possible

    This is my idea of creating a new condition type.

    Someone finds it useful?

    Someone knows how to solve the problem of the gamepad?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't need to create for every new player - new sprite and there is no need in family. That's i can say for sure.

    About gamepads. Well, i have none of that could support the plugin. So, sadly cannot test anything to help you

  • Thank you friend!

    I do not know the logic to create an event that will serve for each player.

    Any link which teaches me to create it?

  • This is perhaps will be a stupid question.

    But how did you make only one "or" in conditions?

  • This condition is not possible. I did it in Photoshop to illustrate the resolution of my problem.

    If it were possible to create a "or" anywhere condition would solve my problem.

  • My last message here - https://www.scirra.com/forum/viewtopic.php?f=147&t=147611&p=938715#p938715

    This example (or almost finished for someone game) probably will help to your project too.

  • You could do something like this to deal with multiple gamepads. Here, GamepadID is an instance variable (or could be a family instance variable in your case) used to identify which Sprite will be moved by each gamepad.

  • XpMonster

    Thank you friend, that your code has opened my mind ...

    In my code I still use the family with Platform Behavior.

    Magistross

    Your code works perfectly.

    The gamepad (0) Controls Player1, the gamepad (1) Controls Player2, is perfect.

    Now I will study what you did.

    Thank you very much!!

  • Just want to thank you. I am working on a multiplayer mode and this helped me a lot. So thank again i 've just drop event number by 8 to 10%.

    You could do something like this to deal with multiple gamepads. Here, GamepadID is an instance variable (or could be a family instance variable in your case) used to identify which Sprite will be moved by each gamepad.

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