DiegoM's Recent Forum Activity

  • I didn't try it out myself and didn't notice the main file in the repo is Typescript and that the type definitions are no where to be seen. You need those so TypeScript can work.

    Anyway, it looks like you can't just copy and paste from the repo, because the code you end up using needs to be generated using a build script that is also in there.

    Instead of doing that, you should download it from from NPM. That way you get the built library in both JavaScript and TypeScript. To get this working I think it's easier to just look for the Javascript file and import that in C3.

    To load the library I did the following:

    1. Install NPM
    2. Create an empty folder somewhere, the desktop is an easy place.
    3. Open that folder
    4. Open a command line window in that folder (In Windows if you press SHIFT while right-clicking, you should see an "Open Powershell" option)
    5. In the command line type npm i -S simplex-noise
    6. That will create a node_modules folder with all the files you are looking for
    7. I took the .js file in ..\node_modules\simplex-noise\dist\esm
    8. Import that file into C3

    After all of that, I imported in the main script with:

    import { createNoise2D } from "./simplex-noise.js";
    

    I don't know if the library will be useful to you, but you can load it like this and try it out.

    I assumed you know about NPM and how to install it. If you need help with that let me know!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That last snippet that you are not sure what it is, is what classes used to look in Javascript and they are used just like classes defined with the newer syntax.

    	let grad = new Grad(1, 2, 3, 4);
    	grad.dot2(0, 1);
    

    Maybe you can try this module github.com/jwagner/simplex-noise.js , it looks promising.

  • Looking back on this... I can't remember what was the reason to skip implementing it. It should work just as Create Object with the minor difference that the newly created instance would have the angle of the picked instance instead of the angle of the template, everything else should work the same.

  • That's because what the import keyword is doing is creating a variable, and the variable can only be seen in the scope it is created in. Just like a regular variable can not be seen outside of the function it is created in.

    There is a caveat though. If the module you are trying to use is an older one, the way they export things is by attaching properties to the global scope. So in that case, it doesn't matter were the import statement is, because the module will just add things globally.

    For example, if you take the library you are trying to use and add this to the very end:

    globalThis.FastNoiseLite = FastNoiseLite;
    

    A FastNoiseLite property will be created in the global scope, then it doesn't matter in which file you import the module, globalThis.FastNoiseLite will be available.

  • A couple of things to get this working.

    1) Use the import in the file you need it.

    import * as FastNoiseLite from "./fastNoiseLite.js";
    

    That creates the variable FastNoiseLite in the script where it is written. So instead of putting it in your main.js you put it at the top of importForEvents.js

    2) This part is tricky.

    The module you are using is exporting a class using the default keyword

    export default FastNoiseLite {
    	...
    }
    

    When you do

    	import * as FastNoiseLite from "./fastNoiseLite.js";
    

    What is happening is that all the things the module is exporting become part of the new FastNoiseLite variable.

    Because what you are looking for was set as the default thing to export, what you need to write to access the object you are looking for is this:

    	// Use FastNoiseLite.default to access the default export from the module
    	
    	const noise = new FastNoiseLite.default();
    	noise.SetNoiseType(FastNoiseLite.default.NoiseType.Perlin);
    

    In this particular case where the module you want to use has a default export, it is much better to use this to import:

    	import FastNoiseLite from "./fastNoiseLite.js";
    

    Doing that just places the default export of the module into the FastNoiseLite variable, and is used like you expect it should be used.

  • The Animations editor already supports bulk importing.

    construct.net/en/make-games/manuals/construct-3/interface/animations-editor

    The basic use case is just being able to drop a folder or a zip file onto the animations pane and have an animation created. The animation is named after the folder or zip file.

    For more complex use cases, the importer supports placing a configuration file next to the files. The configuration file is a JSON file which can include several settings to be applied on the created animations.

    I haven't tried it myself, but it should be relatively easy to have Aseprite (or any other program that supports some kind of scripting) to package all the files together in a way C3 will understand.

  • You can open and close all the bars from the main menu.

    Menu -> View -> Bars -> Tilemap bar

  • This happens when you open the latest beta and then go back to using the stable version. The latest betas are adding a little bit of extra information to the Animations editor save state. Older versions don't understand that, and crash when they try to load it.

    Clearing the browser cache works because it allows C3 to start from scratch again.

    Since most of the user base only uses stable versions, most people aren't seeing this problem.

  • This issue has been mentioned before, but we haven't been able to figure out what the problem is. On top of that it doesn't seem to affect a lot of people so it's harder to find out what the problem might be.

    I mentioned Firefox as a workaround, because we are not really sure how to fix this one, mainly because we haven't been able to reproduce it ourselves.

  • Have you tried using a different browser? Firefox would be a good try, as it is completely different from Chrome. Other browsers, like Edge or Opera might run into the same problem as they use the Chromium engine under the hood, which makes them pretty much identical to Chrome.

  • Do you have any browser extensions installed? If so, you can try disabling them all to see if the problem stops happening.

    If that works, you can try disabling them one at a time to figure out which one is causing problems.

  • Yeah sure, you can send it to diegohqc@scirra.com

DiegoM's avatar

DiegoM

Member since 24 Apr, 2015

Twitter
DiegoM has 1,379,825 followers

Trophy Case

  • 9-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies

Blogs