rhg1968's Recent Forum Activity

  • I believe I found the answer. The properties must be set as non-enumerable during the minification. If I use Object.getOwnPropertyNames() instead I can access all of the properties and everything works correctly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have everything pretty much working with advanced minification in my game except for one issue. My whole game is pretty much in javascript except for some touch events that then call into the code.

    I have implemented a pseudo entity control system in my game where I just assign components to my entities and I have an algorithm that can find any entity with any combination of components to act upon in the systems classes. One of my systems is a movement system and it handles moving anything that has a movement component attached to it.

    All of this works fine with no and simple minification, but not with advanced.

    The issue is I use es6 functions to iterate over, reduce, and flatten the final result of the component search. To do this I am iterating over the complete object collection as such Object.keys(this.runtime.objects). Under anything but advanced minification this returns an array of all properties on the objects object. In advanced minification it returns an empty array.

    Is there something happening during advanced minifcation that prevents the properties for the objects collection from being iterated over ?

  • There are a few examples in the IDE under the scripting examples. They show some basic things like you mentioned.

  • The new functions are global and don't need to be included explicitly. So just creating a function makes it available on any event sheet. That is why you can't have them named the same.

  • It's not supported yet, but you could use runtime.callFunction() to call a function in the event sheet to set the animation. You could pass the uid so you can select the object in the function.

  • Does this mean that if we add the js files to the imported files section that command/syntax checking will happen like in the scripts folder ?

  • Sorry I never added to this thread.

    The issue for me was taken care with R156 as shown in the release notes for that version.

    Possible runtime crash creating instances not placed anywhere in project (regression in r155).

    In R155 I fixed the issue by putting instances of all my objects on the layout and then destroying them on the start of the layout.

    Hope that helps.

  • I really like the approach of LoadScripts. I will change things over to use that instead of relying on folder order.

  • What I have found so far is that it groups everything alphabetically when adding scripts. So if I add a base class after I add the super class, it fails because the base didn't load. If I then create a sub folder called "A" and move the base class into that folder, it's not read before the super class and everything loads.

    Not sure if they'll give us more flexibility with this later on, but you can make it work.

    I have almost reworked my entire game into mostly JavaScript and that's how I worked around it.

  • ok, thanks.

    I will try to create a small project to see if I can duplicate it and file a bug. I know someone else has run into this issue also. I'll see what I can come up with.

  • I posted this comment on the release comments so not sure if I should leave it here. Let me know if I should delete it.

  • I went back to an old version of my game without any JavaScript scripting and I get the same error.

rhg1968's avatar

rhg1968

Early Adopter

Member since 6 Jun, 2014

Twitter
rhg1968 has 9 followers

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • 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
  • Email Verified

Progress

18/44
How to earn trophies

Blogs