arvindm1991's Recent Forum Activity

  • My game is inside of a website with a login. Login generates a auth token that gets stored in localstorage (webstorage). Since webstorage is deprecated, how do I pass the token into the game? Since tokens can be long, passing it in url params might not be the best idea.

  • I have a website that stores login info of a user in a localstorage key on login. A few clicks later, user opens the game which is hosted within the same server. How do I get access to the example.com localstorage entries?

  • Ah realized my error! I was beautifying the inner json but not setting the actual put json string correctly. Both Ashley and dop2000 were right. In case someone stumbles upon this, this is what I did to get it to work - beautify the "nesting" json and then add it to the json I was going to use in the ajax call. Then beautified the json and used it in the ajax call. This works now for me without scripting. Thanks for the help.

  • Hey Ashley,

    Thanks for the explanation. Since the dictionary itself has the actual data inside of the data key, basically a JSON inside a json, I'm having to stringify twice.

    Beautified String gives me this:

    which when directly passed as the data in the api fails.

    On stringifying again, I get this which seems to work:

    .

    Instead of using localvars, I'm now using globalvars which seems to work even in the export. Would you recommend instead that I just pass the data value to the API and reconstruct the dictionary after retrieving it in a get call?

  • Not sure what I'm doing wrong here?

    I have a dictionary Score_D where I store a bunch of score data and on end of a level, call this block to put the score through an ajax call. I couldn't get Json.Stringify and so I figured, I'd get a local variable that has the json converted to a string, stringify it again with the json.stringify to escape the quotes. This works fine when I preview and in debug mode. When I export to a html5 this stops working. Oddly the console.log does not show as a scriptsinevents.js message, it shows as a c3runtime.js.

    I simply need to escape the quotes before making the ajax call! I've been going around in circles with this. Any help is appreciated.

  • Since the construct hmtl5 output itself doesn't seem to replicate this issue and happens only on integrating with app, not sure how to provide more info. Is there an event we should check to see if is getting triggered? How does the stop music on suspended action work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, You are right. We have an angular app which we will be making into a pwa. The game is integrated into the angular app and when the browser back button is hit on the app, that does not stop the music.

  • Ashley - FYI

  • Ashley - Did a bit more testing - The game itself is being integrated within a PWA. When I hit back button on just a locally hosted version of the game from the html5 export, it pauses audio as expected. When I hit back after the game has been integrated, hitting back button does not seem to stop audio. I want to give you this info before creating a bug and wasting your resources. Thoughts?

  • Thanks Ashley. Will do.

  • For clarity, if I press back button on the browser, the music continues to play. That is the bug.

  • In my game I have a looping sound playing in the background called "back".

    In my eventsheet, I have the sound getting stopped on suspended. This seems to work in desktop but not on an android phone with chrome browser. How do I make this work? I've seen years old posts on pagevisibilityapi but chrome browser supports all of that.

arvindm1991's avatar

arvindm1991

Member since 30 Mar, 2021

None one is following arvindm1991 yet!

Trophy Case

  • 3-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

5/44
How to earn trophies