mfexplorer's Recent Forum Activity

  • So I read the manual and it is very obscure because it doesn't tell you what to actually do.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/button

    What do you put in "id" and what do you put in "class" to actually make the button bigger?

    Examples would really help.

  • Yes I ran into the same problem just now. I want to make the text on my buttons

    a readble size. Can't do it easily - doubt if it can be done with CSS as I think this

    is on the canvas.

  • This little add two numbers project has been enormously helpful. Now I've been able to get my functionality accessible to the events and I have a better idea how to access data.

    Hopefully as I spend time navigating I will find the things I need. But for now, I think I can get my data out of JSON like object files and access it.

  • When I set the purpose of script.js to "Import for Events" and run the code I still get errors:

    5bootPreview.js:55 Unexpected message type 'undefined'

    OnBootMessage bootPreview.js:55

    bootPreview.js:92 Registered service worker on preview.construct.net

    4bootPreview.js:55 Unexpected message type 'undefined'

    OnBootMessage bootPreview.js:55

    previewWindow.js:28 [C3 preview] Browser opened wrong size popup: wanted 854 x 480, got 854 x 415; resizing to compensate

    main.js:4 Uncaught SyntaxError: The requested module './script.js' does not provide an export named 'default'

    I have no idea why I need an export named 'default'. Is this in the manual somewhere?

    Can you please supply an example of a project which uses an external script file with a function to add 2 numbers which can be called by an event? As well as a variable that can be accessed globally?

    Sometimes the simplest things are hard to know how to achieve to the novice who isn't familiar with all the rules around how things actually run and are executed.

  • This is a clue towards solving the puzzle. Understanding what to do is still not clear because there is no example.

    "Instead you can import things in to a script file with the purpose Imports for events, normally named importsForEvents.js. For example if you add the following line in the Imports for events script:

    // importsForEvents.js

    import * as Utils from "./utilities.js";

    ...then all your code in script actions and script blocks can use the exports in Utils, e.g. Utils.myExport(). This provides a useful way to write a library of functions that can be used by code anywhere else in the project, and is another good way to closely integrate event sheets with your JavaScript code."

    How do you "import things into a script file with the purpose Imports for events"?

    Is there a c3p file with an example of how this should all be done. In the parts of the manual I read, you put your import statements in main.js. But now there is this new file importsForEvents.js which is loaded when? And how? And then can its functions and variables be used anywhere?

    All I want is to write functions and have essentially global variable objects I can use anywhere in events.

  • Since I can't find any way to share the project, I am uploading the 3 small images which define all I did in this tiny project.

  • Normally there is a file attach button in forum software. Not sure how I should share my project file. Now I need to go to sleep as I live in Australia.

    After the tutorial went so well and the documentation seemed so clear I expected to have a smoother run but a lot of basic things don't seem to be working. If someone like me can fail to do the basics maybe a few more explanations would be helpful.

    For example, is there one project somewhere which actually uses an import/export script scenario? Modules and all?

  • I can't see how to upload a file here.

  • This never ends but I don't know why it started.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Another problem I am having with Construct 3 is the software says it has run out of local storage. It fails to clean up - but why should it even try? These is 393MB of free storage on the C: drive?

  • Even when I have import { myTestVar } from "./testScript.js";

    and testScript.js is:

    export let myTestVar = '2';

    the event code STILL doesn't know what myTestVar is when I try to console.log it.

  • I also tried import * as myModule from "./selectedVerses.js"

    I tried a statement at the end export { loadVerses }. Doesn't work and can't see how to make these large files of code with an object integrate with my proposed game.

    I hope someone can help.

mfexplorer's avatar

mfexplorer

Member since 20 Oct, 2022

None one is following mfexplorer yet!

Trophy Case

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

Progress

4/44
How to earn trophies