dop2000's Forum Posts

  • OhhBaby , Thanks, I'll try, but as I understand, this will only log standard events, I also need custom events...

    EDIT: managed to send custom events using Browser Exec Javascript "facebookConnectPlugin.logEvent('event_name');"

    Thank you for this tip!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried all latest versions. 1.41 and 1.42 show black screen and 5.0.X versions just crash..

    Thank you for explaining the issue, let's hope you find a solution one day.

    By the way, I think it's possible to use C3 build service. You need to export to Cordova, then edit config.json like this:

    "plugins": [
    {
    	"id": "cordova-plugin-facebook4",
    	"version": null,
    	"variables": [["APP_ID", "1231232132"], ["APP_NAME", "My App"], ["FACEBOOK_ANDROID_SDK_VERSION", "4.40.0"]]
    },
    
    

    Then use C3 Export Manager to build an apk. The result is pretty much identical to what you get with Cordova CLI.

  • Yeah, I've seen your bug report yesterday. Are you saying that SDK version 4.40.4 should still work? The problem is that I can't build with this particular version. I tried many others though - 4.35.0, 4.36.0, 4.38.0, 4.40.0, 4.41.0

  • Thanks, —

    I was really hoping there was a solution.. Do you know if there is any other way to implement FB analytics in runtime3 game for Android?

    Enhance doesn't support runtime3 and I couldn't find any other addons. It's a shame really, most mobile publishers require analytics, Scirra should really address this issue asap!

  • OhhBaby I tried many different versions from 4.26.0 to 4.40.0, all resulting in black screen. Tested version 4.41.0 just now - same problem.

  • Hi —, Could you help me please, I'm having an issue with your Mobile Facebook plugin. I tried building apk many times with different settings and every time I run it on my phones it shows a black screen...

    The project is in runtime3 and has just one action "Mobile Facebook Log Event".

    I export the project to Cordova from C3. Then add 3 lines to config.xml:

    <plugin name="cordova-plugin-facebook4" >
    	<variable name="APP_ID" value="123456789" />
    	<variable name="APP_NAME" value="MyApp" />
    	<variable name="FACEBOOK_ANDROID_SDK_VERSION" value="4.40.4" />
    </plugin>
    

    Note - your manual says "param name", but "param" is not recognized by cordova, so I changed to variable. Also, I tried many different SDK versions.

    Then execute:

    cordova prepare
    cordova requirements
    cordova build android
    

    Install the debug apk on my phone and get black screen... If I build the app without Mobile Facebook plugin, it works.

    I tried every solution from from stackoverflow and google - nothing helps.

    Here is my project file, and exported file for cordova

    .

    EDIT: Digging deeper, I found your bug report on github, seems like you got it working with version 4.40.4, but for me cordova build fails with this version:

    Could you tell me how I can fix it?

  • Try this:

    Note, that saving to local storage should be outside the loop!

  • You do not have permission to view this post

  • Two ways -

    1. On start of layout destroy auto-collector sprite which is outside of the map.

    2. Or a better way - create an empty layout, name it "Assets" for example, and move the auto-collector sprite there. You can use this layout to keep all objects which you don't need immediately on your main game layout.

  • Change the template like this:

  • Firstly, the origin image point in your sprite is off, so you don't even see the first created instance. Also, instead of creating sprites, I suggest using Browser-Log action, it will allow you to understand better in which order events and actions are running.

    When you call a function, the next action will run after the function ends. However, if there are any "waits" in the function, construct will create separate threads for them and move to the next event. Basically, the whole function is executed in one tick, but some actions from it are scheduled to run later.

    If you change your code like this, then all 5 circles will be created with 2 seconds delay between them:

    Note, that event #3 is a sub-event under #2.

  • So let's say "Spearman" and "Archer" are sprites, combined into a family "Unit". On this family you have an instance variable "team". You need to also create a copy of the family, let's call it "UnitAttacker".

    Then you can do something like this:

    variable currentTeam=1
    
    Every 1 second
    Unit team=currentTeam
    For each Unit
    	-> Function call "FindTarget" (Unit.UID)
    
    
    On Function "FindTarget"
     UnitAttacker pick by unique ID Function.param(0)
    	Unit team not equal currentTeam
    	UnitAttacker has Line of Sight to Unit
    	Unit pick nearest to UnitAttacker.x, UnitAttacker.y
    	 -> Function call "Attack" (parameters: UnitAttacker.UID, Unit.UID)
    
    

    In the "Attack" function you can pick both the attacker and the opponent instances by their UIDs.

    .

    So you can use two families to pick two separate units in the same event. However, only one family can have "team" instance variable, that's why I'm using "FindTarget" function here - to pick a member of UnitAttacker by UID.

  • I have nothing to add to this :)