Calling JS function from Lua code (SOLVED)

Hi!

We are considering switching to Defold for all our new projects, and researching if it fits our needs.

Primary blockers for us, so far:

  1. Can’t call JS functions from Lua code, so unable to use payment systems on Kongregate, Facebook, VK, OK and other desktop web game platforms.
  2. Can’t use native libraries on mobile platforms. So it is impossible to use all those libraries that are an essential part of modern mobile projects. For example ads, analytics, crash reports libraries etc.
11 Likes

I have not tested but Defold already support facebook payments http://www.defold.com/manuals/iap/

But I agree with Arthur. JS function calling is very important thing. It’s much better than rewrite all sdk to lua and then keep it up to date.

3 Likes

Hi Arthur!

  1. I agree. I have added an issue for this DEF-1782, this feels like a must have feature for devs aiming to publish on other HTML-platforms than Facebook. It might be something that could fit into the IAC-module, which currently has support on mobile at the moment. (Or the perhaps the webview-module that also is only supported on mobile currently.)

  2. There is a plan in place to add native extendability to the engine, but I don’t have any timeline for when this will be available. Some of the examples you bring up we do already have some support for, for example;

    • Ads - Checkout this thread.
    • Analytics - We have support for analytics out of the box, it’s an opt-in thing for each project. Check out your project dashboard where there should be more info.
    • Crash reporting - The engine exposes some functionality to setup this yourself, see the crash-module. The actual “reporting” step needs to be taken care of by the game devs though, but the data is there! :slight_smile:
    • Facebook IAP - As Alexey points out, there is support for IAP on Facebook canvas. It uses the same iap-module as the other mobile iap solutions.
13 Likes

Look forward to DEF-1782.
I alredy made 6(almost 7) games for FB instant games using phaser+typescript, but I want to use my favorite engine Defold! =)

7 Likes

Is there any news on this issue? I’m planing to release early access game on vk.ru at first as the user acquisition there is cheaper than on Facebook.

My guess is that this will be the next thing we’ll be working on once Live Update and Native Extensions have been released.

6 Likes

as i’m trying to launch my game in vk.com this feature is critical for me. And also want to include gameanalytics.com which already have js API.
Waiting for updates =) hope it will be soon.

2 Likes

Yup, it will be soon. We’re about to launch Java extensions soon (to be able to support SDKs on Android) and next up would be Javascript. My guess is that it should happen within two or three releases. We know this is a priority to you and many other devs so this is a priority for us.

5 Likes