ArcadEd's Recent Forum Activity

  • Not sure if the await keyword is exactly what you want. Could you perhaps illustrate a bit more how you intend to use said function ?

    I'm calling this function in a script

    // Example POST method implementation:
    async function postData(url = '', data = {}) {
     // Default options are marked with *
     const response = await fetch(url, {
     method: 'POST', // *GET, POST, PUT, DELETE, etc.
     mode: 'cors', // no-cors, *cors, same-origin
     cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
     credentials: 'same-origin', // include, *same-origin, omit
     headers: {
     'Content-Type': 'application/json'
     // 'Content-Type': 'application/x-www-form-urlencoded',
     },
     redirect: 'follow', // manual, *follow, error
     referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
     body: JSON.stringify(data) // body data type must match "Content-Type" header
     });
     return response.json(); // parses JSON response into native JavaScript objects
    }
    

    However, I have code I want to execute after I know that has completed.

    The same as using AJAX to POST and tagging it. Then using that tag to check if it completed with the Ajax on completed action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am calling a function that is in a script file using a script. That all works.

    The function is an async function.

    My question is this:

    Does anyone have example of how to make sure that function call is completed before executing particular code? I've always just used the built in AJAX on completed event, but obviously I can't do that here but looking for the same fucntionality.

    Thank you,

  • You do not have permission to view this post

  • Great idea, thanks.

  • I am wanting to mirror/not mirror my enemy depending on which way they are moving along a path. Is there a built in action to do this and I'm just not finding it?

    Or do I have to code in something checking their x position based on a previous X position or something?

    Thanks.

  • .

    This will only work in a desktop game. In a browser game you don't need any of that, just use Browser Invoke Download CanvasSnapshot

    Thanks, yes it has to be a browser. Doesn't the invoke download just make chrome download the image file? I need it actually saved on the server side. No interaction with the user, in fact they won't even know this is happening.

  • Quickly what I want to do is this.

    Take a snapshot of the canvas.

    Set AJAX Response to BinaryData

    Request CanvasSnapshot

    The above is all shown in the taking a screenshot example. What I want to do is:

    Create a new folder in the project under Files called screenshots.

    Save CanvasSnapshot to the above folder.

    Thanks.

  • You need to contact the library developer about this. They need to make sure the library supports JavaScript Modules.

    This? web3js.readthedocs.io/en/v1.2.11/web3.html

    Ed

  • Agree, especially right now with Crypto blowing up.

    Come on Ashley :)

  • I realize this post is rather old, but can you either of you walk through how you got this working?

    When I tried to follow this I get the same web3 error. I did double check the case.

    OK, I got it working pretty much. But I had to go into classic mode for script type. How do we get it working in module mode as classic will be removed at some point

  • excellent. Thanks Ashley.

  • New Info: If I switch the runtime to Construct 2, it minifies just fine.

ArcadEd's avatar

ArcadEd

Early Adopter

Member since 3 Jul, 2012

Twitter
ArcadEd has 7 followers

Connect with ArcadEd

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x10
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies