luismat's Forum Posts

  • 12 posts
  • Thanks Ashley... the project does continue to run (I am the one closing the other peer window for testing purposes)

    I am always nervous about "uncaught" errors or exceptions hence my question to the forum but good to know this is not important and a normal behavior.

    Regards

  • Hi,

    I've started working with the Multiplayer object and have created a simple project.

    I am able to connect to the signaling server, enter a room , become a hoste etc.. all is fine.

    I then run another client and connect to the same room as a peer.

    The issue is when the peer disconnects I get several unhandled errors on the console:

    This happens despite the "Peer disconnect" event being triggered and I catch-it.

    I also have an event "On Signalling error" but this one never gets triggered.

    Thanks for your help

  • ahh ok, that is what I thought.. that I was getting a Construct 3 object, not a native js Array.

    thanks for your reply.. I'll consider what is best, to use JSON or the GetAt workaround

    when you get an instance of the array object using runtime.objects.arrMainDeck.getFirstInstance();

    you are not getting a native js array, you are getting a construct object

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/array

    I think construct arrays are always stored as 3d arrays, regardless of what dimensions you set, I don't think there is an exposed method to extract that 3d array data, you could do like you suggest and use GetAt to reconstruct the array.

    I usually tend to avoid array objects in construct, if I only need 1 dimensions (list)

    you could use a JSON object instead it has similar functionality to support arrays.

    but the advantage with json you can get the raw json value in js

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/json

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/json

  • Hi everyone, first of all thanks to the Construct 3 team. It's an amazing product.

    And thanks to the entire community for your valuable help !

    Let me explain my challenge:

    I have a Construct 3 array, initialized, named arrMainDeck

    I have a file in my project "main.js" which I import for events.

    Inside this js file I have a function parseHand that expects one parameter (array)

    	function parseHand(handArr) {
    

    In my Event Sheet, I add a script to call the function like this:

    	const JS_arrDeck= runtime.objects.arrMainDeck.getFirstInstance();
    	runtime.globalVars.tempResult= parseHand(JS_arrDeck);
    

    but for the life of me I can't manipulate the JS_arrDeck inside the js function. It doesn't seem to be a js native array , but a Construct 3 object instead..

    Am I missing something , or do I need a plugin to manipulate and convert objects to js.

    I have a workaround:

    	//const jsArray = [];
    	// loop the construct 3 array and push values with getAT
    	//jsArray.push(c3Array.getAt(x, y));
    

    but this feels highly inneficient.

    your help is appreciated.

    thanks

  • In case this is helpful for others.

    I was about to file a bug but then decided to try one last thing, which was helped by what dop2000 wrote in his message.

    This works and I get the right response from firebase.

    Why sending a json doesn't and this does I don't understand...

    regards

  • Many thanks dop2000 !

    that is really weird. Why do you think this happens in Construct ?

    must be a bug right ?

    bummer

    Do I need to encode the "at" symbol in some way inside a string ??

  • Many thanks dop2000 !

    that is really weird. Why do you think this happens in Construct ?

    must be a bug right ?

    bummer

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Forgot to add what I get back as a I response if I use construct3

    where you can see the message, missing email. But the email is there and if I copy and paste the same data to postman I get a valid response.

    thanks in advance

  • Hi guys, first of all I wanted to say I love construct 3.

    I've only started to work on it but I think it's a great product.

    I need to build a mobile game that uses firebase.

    If I use postman or go to any REST API testing site and POST the exact same string to firebase it responds correctly.

    Using construct 3 I get "Email Missing".

    I've added the preview.construct.net domain to firebase so that is not the issue.

    I would really appreciate some help here. It only takes 2 minutes to reproduce this.

    This is the event sheet. very simple just add an AJAX object, Json and text.

    If you use postman or go to reqbin.com you will get:

    Here is the text of what I'm sending using AJAX, in case you want to copy&past into Construct 3:

    URL "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyBPAFvzKk9vZjHcm_uYb3JBw8_70_rOLYk"

    Data "{""email"":""test@test.com"",""password"":""test123""}"

    Thanks in advance

  • Many thanks for the quick response.

    very helpful.

  • Hi guys, first of all thanks for a fantastic product ! love it although have only been working on it for a few days.

    I am creating a tile based game and I place several enemies on the "board" at the start.

    After the player moves I call a function to move the enemies (it's a turn-based game)

    This is the block I'm using.

    The problem is , after I destroy all the enemy sprites (after they get killed) the block doesn't trigger, i.e. the player sprite doesn't move

    what happens to the MoveTo.is Moving condition after all the sprites get destroyed ? I assumed nothing is moving because no sprites exist !

    Thanks in advance

  • 12 posts