Mikal's Recent Forum Activity

  • I just tried running the example project 'Kiwi Story' on Safari on MacOS and I hear audio from the jumps and the music when I run preview.

    Is there a different example project to try, so I can see if I have the same error as you do?

  • I am using C3 w/ Chrome and I save as Project Folder also. I am editing my JSON Project files in an external editor and using the 'Reload All From Folder' function to update them while the Project is open (right click on 'Files' in Project bar.) I just checked and the 'Script' folder also has the same type of option (but I have not tried it yet.)

    It's not automatic sync which would be nice, but at least you don't have to reload the project.

    This may be a beta feature, I can't remember if it's in 'stable' yet.

  • Glad you got it working.

  • Sorry, I can't access the project, it's not 'public'. Can you make it public, so I can access it?

    Ah, you are saying it's not visible in the editor I think.

    If you run the example project (funkyquadexample.c3p), do you see the three FQ brick objects in the editor?

  • Are you talking about this plugin I did?

    construct.net/en/make-games/addons/224/funkyquad

    Can you share your project?

    What do you mean when you say 'is not in the preview'?

  • mostafanastary

    With the current set up here is a suggested way to do that:

    Create a layout 'Prefab' with no event sheet.

    For each different character, create a Spine object.

    Place one instance of each character on 'Prefab' layout.

    For each instance on the 'Prefab' layout, assign the atlas, json, skeleton name, etc.

    Now, on your main game layout and event sheet, you should be able to create the above objects with the default Spine settings for each object. You could also create a 'family' for the Spine objects, so you can have some common events, behavior for them.

    This all being said, Tower Defense games usually have a lot of objects, I would also do some quick performance testing to make sure that your expected number of Spine objects will run at the FPS you want for your game.

    Good luck!

  • Ah! It's because of a typo I think, I just got this to work in a project. Check your capitalization (for 'Web3'.)

    Script.js:

    // Put any global functions etc. here
    
    runOnStartup(async runtime =>
    {
    	// Code to run on the loading screen.
    	// Note layouts, objects etc. are not yet available.
    	await runtime.assets.loadScripts("web3.min.js","a.js");
    
    	
    	runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
    });
    
    function OnBeforeProjectStart(runtime)
    {
    	// Code to run just before 'On start of layout' on
    	// the first layout. Loading has finished and initial
    	// instances are created and available to use here.
    	
    	runtime.addEventListener("tick", () => Tick(runtime));
    }
    
    function Tick(runtime)
    {
    	// Code to run every tick
    }
    

    Under project files, I have web3.min.js and a.js

    a.js:

    console.log("a script")
    var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"));
    console.log(web3)
    
  • Right now that's not possible. For now, create a different object for each Spine character and set the specific json and atlas for each object/character. Post a request on the plugin github for this feature and it may get implemented.

    In your code, it will just create a SpineCharacter with properties that are defined for the object (you may need to create a dummy layout sheet with an instance of the Spine object to set the default values - if you are not placing it on the game layout in the editor.)

  • Ashley made some good comments about using await.

    If you need another possibility you could put your code that calls web3 into another script and have it load after the web3.min.js.

    For example, if you create a script called web3Example.js with

    web3Example.js:

    web3 = new web3(new web3.providers.HttpProvider("http://localhost:7545"));
    

    Then your other script would look like:

    runOnStartup(async runtime =>
    
    {
    
    await runtime.assets.loadScripts("web3.min.js", "web3Example.js:");
    
    // This code runs on startup with
    
    // the 'runtime' variable available
    
    });
    
    
  • [It looks like the post I was replying to was deleted, so I hope you already solved the issue]

    I am not exactly sure why you are seeing that error, but I remember a discussion about the order of loading and execution of the script files may be a bit difficult to control.

    construct.net/en/make-games/manuals/construct-3/scripting/using-scripting/script-files

    One simple way around this is to put all your scripts in one big file, but I think one of your files is big and minified.

    So another way to do this is to load the script files in the order you want by putting the files in the Project Files folder and then in the Project Scripts folder use the default script and load them in the order you want:

    runOnStartup(async runtime =>

    {

    runtime.assets.loadScripts("script1.js", "script2.js", "script3.js")

    // This code runs on startup with

    // the 'runtime' variable available

    });

    See: construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/interfaces/iassetmanager

    Interesting project, I also thought about doing something similar with a custom token, I was going to do the token issuing on a Playfab server to have a little more control (e.g. player registration, limits on tokens created, a little authentication, etc.)

  • Likely due to 'worker' mode.

    Project->Properties->Advanced, uncheck 'Use Worker'.

    I am curious, how are you going to use ethereum in your C3 project?

    In the future, you can press F12 (on Windows) to see the console during the preview and there you would have seen that the error was that 'window' was defined, which is an indication that the JS is not compatible to run in a worker (window is not defined in the worker space.) The C3 manual and some of the C3 blogs have details on worker mode.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah! I remember this! Thanks for doing a new version - it's a great family tradition! Now to go ruin my eyes staring at the screen for way too long, I better turn on NightShift. Well done!

Mikal's avatar

Mikal

Early Adopter

Member since 22 Apr, 2016

Twitter
Mikal has 103 followers

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • 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
  • Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x10
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

19/44
How to earn trophies