mfexplorer's Forum Posts

  • 14 posts
  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • Even when I include the word export in front of the function it still doesn't work/

    Event sheet 1, event 1, action 1: ReferenceError: loadVerses is not defined is the error I get

    In main I put:

    import { loadVerses } from "./selectedVerses.js";

    In the file selectedVerses.js I have:

    export function loadVerses() {

    globalThis.sVerses = [ ... I am missing something else. I hope to get over these hurdles so i can just tell the thing what I want it to do.

  • Is there a handy part in the tutorials or manuals to explain this? I have imported functions from files into my project. They define various Javascript functions. I include an import statement in main.js for each of them. There is is a function called loadVerses(); But when I run my tiny project it says:

    Unhandled error: loadVerses is not defined.

    My function in the script file starts off like

    function loadVerses() {

    globalThis.sVerses = [ { At my event sheet I have System->On Start of Layout -> loadVerses() What am I missing>

  • 14 posts