dop2000's Forum Posts

  • Why are you picking Family1, and not Spawner sprite directly?

    You can also use "System Pick All Family1" condition in a sub-event.

    Bullet on collision with Family1
    
    	Pick All Family1
    	Family pick with UID Bullet.SpawnerUID
    
    
  • When you use & operator with integer values, it works as boolean "AND" operator. You need to tell Construct that you are concatenating string values.

    You can try this:

    Set result to ""&val1&val2&val3 etc.

    Or convert them to strings:

    Set result to str(val1)&str(val2)&str(val3)

  • Another option is to remove all references to this plugin, it's possible that ads will work without it.

    So you can try changing the script like this:

    function onDeviceReady() {
    
     console.log('Initializing API');
     document.getElementById('deviceready').classList.add('ready');
    
     const rivendell = window.rivendell
     console.log('banner align: ' + rivendell.BANNER_ALIGN.BANNER_HORIZONTAL_CENTER)
    
     rivendell.setBannerCallback(callback => {
     console.log("setBannerCallback event: " + JSON.stringify(callback.event))
     console.log("setBannerCallback error: " + JSON.stringify(callback.error))
     })
    
     rivendell.setInterstitialAdCallback(callback => {
     console.log("setInterstitialAdCallback event: " + JSON.stringify(callback.event))
     console.log("setInterstitialAdCallback error: " + JSON.stringify(callback.error))
     })
    
     rivendell.setRewardedAdCallback(callback => {
     console.log("setRewardedAdCallback event: " + JSON.stringify(callback.event))
     console.log("setRewardedAdCallback error: " + JSON.stringify(callback.error))
     })
    
     let appKey= "PUT ANDROID APP ID HERE";
     
     console.log("appKey: " + appKey)
     if(appKey == null)
     return
    
     rivendell.init(appKey, callback => {
     console.log("rivendell init: " + JSON.stringify(callback))
     switch (callback.event) {
     case rivendell.Event.ON_INIT_SUCCESS:
     console.log("init SUCCESS")
     break
     case rivendell.Event.ON_INIT_FAILED:
     console.log("init FAIL")
     break
     }
     })
    }
    
    function isBannerLoaded() {
     window.rivendell.isBannerAdLoaded(callback => {
     alert("Banner loaded: " + JSON.stringify(callback))
     })
    }
    
    function showBanner() {
     window.rivendell.showBannerAd()
    }
    
    function isInterstitialAdLoaded() {
     window.rivendell.isInterstitialAdLoaded(callback => {
     alert("Interstitial loaded: " + JSON.stringify(callback))
     })
    }
    
    function showInterstitialAd() {
     window.rivendell.showInterstitialAd()
    }
    
    function isRewardedAdLoaded() {
     window.rivendell.isRewardedAdLoaded(callback => {
     alert("RewardedAd loaded: " + JSON.stringify(callback))
     })
    }
    
    function showRewardedAd() {
     window.rivendell.showRewardedAd()
    }
    
  • The error in the log indicates that the method is called, so it's fine.

    To build with C3 you need to export your project for Cordova, then unzip the exported game and edit two files - config.json and config.xml

    See how other cordova plugins are configured there and add "cordova-plugin-device" the same way, preserving the correct formatting!

    After that add all files back to ZIP, open Export Manager in C3, load your updated zip there and click "Build application" icon.

    This will only work if cordova-plugin-device plugin is whitelisted in C3, I am not sure if it is.

  • You can just insert the content of this file into a text variable and then execute it with "Browser Execute JS"

    Or add this file to the project, request it with AJAX and then execute.

  • How can I do that Horizontally?

    Change drag&drop behavior to "Horizontal only". And then update all conditions and actions - for example change angle 90 to 0, angle -90 to 180, replace "Set Y" action with "Set X", height expression with width etc.

  • one more question, its possible to make it also in C2?

    Idk, you can try - run the dame script with "Browser Execute JS" action.

  • Change function calls in your events to onDeviceReady(); and showBanner();

    Make sure to set the "Import for events" purpose on the script.

    Try running the game in preview on computer, and check console log - you should see "Running cordova-...." message.

    I would probably add Wait a few seconds before triggering onDeviceReady();, just in case.

    You need to export the game as Cordova project and build with Cordova CLI. Either add this plugin to the config files or execute this command:

    cordova plugin add <plugin id>
    

    .

    Looks like this ad network doesn't have its own Cordova plugin, it only needs cordova-plugin-device to detect device state. So maybe the lib can work without it. Or maybe you can add this plugin to config files after exporting and then continue building the project with Construct Build Service.

  • You can use an invisible large sprite with Drag&Drop behavior as a parent object for the entire skeleton. In "On drag start" event check if touch is touching any part of the body, if not - use "Drop" action to cancel dragging.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you using Drag&Drop behavior? You can make the Body sprite larger by adding transparent space to it, and expand its collision polygon. (Don't add Drag&Drop to arms and legs)

  • You can't, unfortunately. The object with the lowest UID will be selected.

  • Not sure what happened, but loading PNG stopped working for me. When I click "Load" icon or choose "Import frames from files", then select PNG images - nothing happens. JPG images work fine.

    This seems to affect Chrome only.

    I see this error in the console log:

    projectResources.js:1775 TypeError: Cannot read property 'sg' of undefined
     at new e.SHc (projectResources.js:2027)
     at Function.d.l (main.js:291)
     at Function.h.Wb.vfb (projectResources.js:1874)
     at k.RHc.a4 (projectResources.js:1775)
    

    .

    SOLVED! "Enable experimental features" setting was causing this.

  • The best solution would be finding someone who could make an addon.

    If you want to do this with JS, you can try adding their script to the project, set its purpose to "Import for events". Then call its functions from the event sheet, for example showBanner()

    You may need to call onDeviceReady() function directly to initialize the API, I don't know if the event listener will work in C3 game.

    This will be difficult to test, because you'll have to build the app every time with this cordova plugin, it won't work in preview. If you are testing on Android, I suggest collecting logcat logs to check for console and error messages.