Integration with Photon Cloud: Multiplayer

0 favourites
From the Asset Store
This is a simple login feature to access Metamask in construct 3. Requires a Chrome Browser and Metamask Extension.
  • Velojet can you change the runtime.js a bit for me?

    I don't need movements in-game.

    I need them to appear both in-game (not like in your demo which player 1 can move from the outside of the game to it insides borders, i need it to show him already in some fixed position which I'd like to define on construct).

    I don't need to set nicknames in-game (yet (registered members later).).

    All I need is to get both connected and some message appears when player 1 is connected Like > Player 1 Connected.

    For Player 2 is connected or awaiting for player 2 to establish connection.

    When both are connected is up to me to code and instructions.

    Can you aid me in this simple script?

    Scripting its not my best, since I'm trying to make a game where registered clients get connected after challenging each other they need to enter inside the "arena" with their own created nicknames.

    Its based on a game by turns.

    jQuery('#join').click(function () {

    if (_this.isConnectedToMaster()) {

    _this.createRoom(game.name);

    _this.joinRoom(game.name);

    // Ensure nick has 3 chars max

    //

    // C?DIGO PARA QUANDO ACEITA O DESAFIO E ENTRA NA ARENA! (em vez de ser nome ? click tnh de refazer)

    // if ((game.myPlayer.nick = jQuery('#nick').val()).length > 3) {

    // game.myPlayer.nick = game.myPlayer.nick.substring(0, 3);

    // }

    }

    });

    How to change this to not have a click event? How get already joined? When opened the link the first two for example.

  • DarkevilPT

    What action/event, condition or expression do you need to be added to my PhotonClient behavior?

    ... All I need is to get both connected and some message appears when player 1 is connected Like > Player 1 Connected.

    For Player 2 is connected or awaiting for player 2 to establish connection. When both are connected is up to me to code and instructions ...Can't you use the existing condition 'New web player has joined' for that?

    Give me an example of what additional action, condition or expression you want to put into your C2 game that you can't put at the moment.

    I'll be happy to add it for you :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Velojet right now.. I just wanna understand why when I put MyPlayer on the construct visual and export it, it doesn't appear at the start of the game and I need to click some keyboard move key to make it appear.

    I have it all set Visible. I think it is something in runtime.js.

    I guess they are already connected since they reach the server.. I haven't tested it yet. I'm still trying to adapt.

    darkevilpt.byethost7.com/tugafighterdev

    Update: Ha and why when moving top it stops after a while? (I don't need them moving but I see that happening...).

  • MrOtton

    I'm waiting for people to try it out and give me feedback before I develop it further ;)Sadly everything I can think of requires a lobby to make sure it plays right, but I'll see what I can do for an adjunct game eventually. Gotta get off my butt for that though :P

    Personally I think you should make a thread for the Photon plugin in the Plugins subforum, as people are more likely to see it there and know it exists. A lot of people want to do multiplayer and this plugin should make it accessible to them. Some people would be scared off with the first page talking about potential and having to read through 12-17 pages to find your work.

    I know I wouldn't have known about it if you didn't plug it in another thread, and I occasionally browse the plugin forum for anything neat

    ---

    Edit: Tried installing it from your link on page 13, but I get this error:

    <img src="http://i.imgur.com/jsWWFjE.png" border="0" />

    Using r129

  • >

    > MrOtton

    > I'm waiting for people to try it out and give me feedback before I develop it further ;)Sadly everything I can think of requires a lobby to make sure it plays right, but I'll see what I can do for an adjunct game eventually. Gotta get off my butt for that though :P

    Personally I think you should make a thread for the Photon plugin in the Plugins subforum, as people are more likely to see it there and know it exists. A lot of people want to do multiplayer and this plugin should make it accessible to them. Some people would be scared off with the first page talking about potential and having to read through 12-17 pages to find your work.

    I know I wouldn't have known about it if you didn't plug it in another thread, and I occasionally browse the plugin forum for anything neat

    ---

    Edit: Tried installing it from your link on page 13, but I get this error:

    <img src="http://i.imgur.com/jsWWFjE.png" border="0">

    Using r129

    Thndr Did you un-checked the minify script option before exporting? Or it happens on loadout? It works for me on r128.2

    http://i.imgur.com/9yhGIt1.png

  • Thndr Did you un-checked the minify script option before exporting? Or it happens on loadout? It works for me on r128.2

    http://i.imgur.com/9yhGIt1.png

    That's an error from starting up C2 after installing it.

  • Thndr Well that's wierd.. are you sure the files here are ok?

    C:\Stuff\Programas\Construct 2\exporters\html5\behaviors\photonclient

    Maybe it is not compatible with Windows 64 bits.

    Can't help you :X

  • Personally I think you should make a thread for the Photon plugin in the Plugins subforum, as people are more likely to see it there and know it exists. A lot of people want to do multiplayer and this plugin should make it accessible to them. Some people would be scared off with the first page talking about potential and having to read through 12-17 pages to find your work ...es, I am planning to make a separate thread. As I mentioned, I'm awaiting feedback from people who try it out, so I can first weed out any glitches. Particularly, I'd like reports from Taurian, who started this thread, and bertelmonster2k from Photon/ExitGames.

    ... Tried installing it from your link on page 13, but I get this error: ...Thndr

    PhotonClient is a behavior, so it needs to be installed in the behaviors folder.

    I just wanna understand why when I put MyPlayer on the construct visual and export it, it doesn't appear at the start of the game and I need to click some keyboard move key to make it appear. ...

    Update: Ha and why when moving top it stops after a while? (I don't need them moving but I see that happening...).DarkevilPT

    Check your server installation. It's giving 404 errors for:

    darkevilpt.byethost7.com/tugafighterdev/photon/Photon-Javascript_SDK.js

    darkevilpt.byethost7.com/tugafighterdev/css/photon_client-inputs.css

    darkevilpt.byethost7.com/tugafighterdev/cloud-app-info.js

    darkevilpt.byethost7.com/tugafighterdev/inputs_header.txt

  • > I just wanna understand why when I put MyPlayer on the construct visual and export it, it doesn't appear at the start of the game and I need to click some keyboard move key to make it appear. ...

    > Update: Ha and why when moving top it stops after a while? (I don't need them moving but I see that happening...).DarkevilPT

    Check your server installation. It's giving 404 errors for:

    darkevilpt.byethost7.com/tugafighterdev/photon/Photon-Javascript_SDK.js

    darkevilpt.byethost7.com/tugafighterdev/css/photon_client-inputs.css

    darkevilpt.byethost7.com/tugafighterdev/cloud-app-info.js

    darkevilpt.byethost7.com/tugafighterdev/inputs_header.txt

    Ok about that Velojet the construct 2 and your plugin don't create those files so I need to move them from your own demo to my exported game is that it?

    Edit: Yeah I uploaded those files but haven't edit them yet its 3am here... I'll be checking this tomorrow.

    Update: Velojet Check darkevilpt.byethost7.com/tugafighterdev

    Its exactly has your plugin demands it.. But I need your help somehow..

    I don't understand scripting and I wanted to know if you can change it to when I join that page it get connected to Player 1 without having to (Isset Join)

    Otherwise i'll need to make major changes to this.

    To keep it simple: When Joined Link Checked if Player 1 is Already Taken if not it joins, else checks if Player 2 (WebPlayer) is taken if not it joins otherwise the game party is full he can't join.

  • DarkevilPT

    It's best if you can tell me what actions(events), conditions and expressions are missing from my PhotonClient behavior that you need to use in editing your event sheet, in order to get your game to work the way you want.

  • Hmmm, are you going to add the ability to make your own "join" and "disconnect" buttons? I suppose that you're still waiting for the exitgames team to join the development? :)

  • MrOtton

    Good questions! I'm following the ExitGames Photon Cloud JS SDK examples, where the 'Join' and 'Leave' buttons are embedded in the index.html web page (my PhotonClient runtime modifies the C2 index.html to enable this). The effect is to remove from the C2 edittime the ability to modify those buttons.

    And you're right - I am still waiting for the ExitGames team to join in, so we can tackle such issues.

  • DarkevilPT

    It's best if you can tell me what actions(events), conditions and expressions are missing from my PhotonClient behavior that you need to use in editing your event sheet, in order to get your game to work the way you want.

    Velojet

    I would tell you.. but I guess I don't know how to explain in the way your want.

    For example lets call this the conditions:

    • Set a Multiplayer Players Limit on Construct 2.
    • Define the max chars for the nickname on Construct with special chars like "-?@?kev!?-".
    • Let us be the ones creating the "Join" - "Disconnect" Buttons on Construct 2 side.

    A chat for a MP example? Is it possible to players chat between them?

    While connected I want to send a message to the other player which appear for them both on screen?

    This would help to know if they are both well connected and answering besides their movements.

    Well this is all I can remember for the moment.. Idk if this helps..

    I'm changing the game a bit.

  • Velojet Thanks for answering my questions! :) This is an awesome Plugin and I'm looking forward to further development :)

    DarkevilPT I actually added a chat to Velojet's example file (including connect/disconnect messages) I can provide the capx if you want to :)

  • Velojet Thanks for answering my questions! :) This is an awesome Plugin and I'm looking forward to further development :)

    DarkevilPT I actually added a chat to Velojet's example file (including connect/disconnect messages) I can provide the capx if you want to :)

    MrOtton Yeah I'd Love it! Please! I'm Learning a lot with Scirra. I guess others would love this too plz share.

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