DiegoM's Recent Forum Activity

  • There is a sticky topic explaining what is going on.

    construct.net/en/forum/construct-3/general-discussion-7/issues-admob-r276-2-166635

  • Background

    During the last beta cycle an issue with Admob started affecting some Android users. There seems to be a problem with the underlaying Ads SDK by Google because a similar problem has also been happening in other platforms, such a Unity for instance.

    To make things short, Construct needs to wait for the Ads SDK to finish initialization, and for some Android App Ids the SDK never finishes initialization and the app just freezes.

    This issue was reported in our tracker, you can find it here github.com/Scirra/Construct-3-bugs/issues/5211

    The initialization process is very quick, so to get around this issue, we implemented a timeout of 2 seconds in r273. What it does is very simple.

    If the SDK finishes initialization before the timeout is complete, then everything is ok.

    If the timeout finishes before initialization is complete then we are not sure what is going on, but to keep the app from freezing we assume ads failed to load. In this case the application does not freeze, but ads won't work.

    This is what Construct is doing in r276.2.

    Workarounds

    If you are seeing that ads are not working for you in r276.2, there is a possibility that you have an Android App Id which is causing problems and Construct is not initializing ads.

    We understand that for a lot of people, not freezing and ads not working is not enough, unfortunately there isn't much more that we can do because we simply don't have control over the cause of the problem. So if you are encountering that ads don't work in r276.2 you can try a couple of things.

    Create a new Android App Id and ad units

    Since the problem seems to be tied to certain Android App Ids, in my opinion, the easiest is to just create a new id. Head over to your Admob account and create a new app with corresponding new ad units. Once you have all your new ids, replace them in your C3 project and chances are high they will work.

    Manual patch

    If for any reason, you are not able to create a new Android App Id, you can try applying a manual patch to an Android Studio project export and then generate your APK or App Bundle using Android Studio.

    Follow these steps to apply the patch:

    1. Generate an Android Studio project export

    2. Open the project in Android Studio

    3. Find the file app/java/admob.plus/cordova/AdMob.java

    4. Find the following block of code at line 62

    case Actions.START:
    	MobileAds.initialize(cordova.getActivity(), status -> {
    		helper.configForTestLab();
    		callbackContext.success(new JSONObject(new HashMap<String, Object>() {{
    		 put("version", MobileAds.getVersionString());
    		}}));
     });
     break;
    

    5. Change it so it looks like this

    case Actions.START:
     MobileAds.initialize(cordova.getActivity());
    
     helper.configForTestLab();
     callbackContext.success(new JSONObject(new HashMap<String, Object>() {{
     put("version", MobileAds.getVersionString());
     }}));
     break;
    

    6. Try it in the simulator

    7. Generate APK or App bundle with the patch applied

    Hopefully in the future this issue will be fixed from Google's side and none of this will be needed anymore.

  • I just realised that both of the features in this thread were added in beta version r277.

  • tarek2

    I think the problem is the name of the files. What C3 does to attempt a numerical sort is very simple, after you set the sort type to "numerical" it just tries to convert the names of the imported files, which are strings of characters, into numbers, using a built in Javascript method. Then when it has all the names converted to numbers, it does the sort.

    For example it will convert the string "12" into the number 12. But if you feed it the string "Foo12" it just fails to do the conversion to a number, because it doesn't know what to do with the characters which are not numbers.

    The easiest thing you can do is just name all the frames in your animation with numbers. Ej. 1.png, 2.png, 3.png, etc.

  • A couple new options were added in r277 relating to this feature.

    The Animations editor can now export animations that include collision polygon data and image point data.

    A couple of new boolean properties in the configuration file can be used to tell the importer to replace existing animations or folders instead of always creating new elements.

    There are short explanations for the new properties in the first post.

  • Does that image point exist? If it's an animation maybe it doesn't exist on all the frames. Or it might just be the wrong name, wrong casing maybe?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well... NaN stands for Not a Number. So it's not a number.

    You usually get this value when performing operations that result in an indefinite result, like for instance, dividing by 0. There are many more possibilities though.

    Have you checked the value of ang in the profiler? Have you checked the value of the image points?

  • Redsun

    Just tried the other project with the web3.js CDN and it works. The library is loaded and then a Web3 object becomes available in the global scope.

    Past that I can't really help you anymore because I don't know anything about ethereum or smart contracts.

    Your best bet would be the documentation for Web3.js

  • This looks cool. Maybe try the Scan Lines effect to recreate that C64 feeling :P

  • According to their github repository your can use the file in a browser by loading it using their CDN.

    In this thread I posted a project showing how to load a library from a CDN.

    construct.net/en/forum/construct-3/scripting-51/install-sdks-cdn-npm-yarn-162441

    You can take a look and see if that works for you, I haven't tried it myself.

    In any case, if the library is loaded successfully, you are on your own and will need to write more Javascript to make use of it.

  • I had been working a little bit to improve the audio features of timelines. You can try the changes out in the latest beta.

    In the process of working on the new features I found out that you can already navigate to specific keyframes at runtime. I completely forgot about that feature.

    When using the Set Time action you can specify a numerical value, but also a string value. If the string matches the tags of a keyframe in the timeline, the time will be set to that of the matching keyframe.

DiegoM's avatar

DiegoM

Member since 24 Apr, 2015

Twitter
DiegoM has 1,401,287 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