Announcement

Collapse
No announcement yet.

Call blueprint function from Javascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Call blueprint function from Javascript

    I successfully deployed my game in browsers (chrome and firefox) now I would like to call a Javascript function in the browser (or in a js file that gets executed on the html page) and see things happening inside my game. For example, when I enter jump(); in browser's console, I want to see the player jumps. I have seen Coherent GT and I don't know if that's a solution or not. I'm using blueprints (not very familiar with c++) by the way. Am I missing a straight-forward way to do this?

    #2
    I found https://answers.unrealengine.com/que...avascript.html which mentions that there's a resize callback in the Game.html.template, so you could probably look at that to see how they did it and do the same. It's probably a little harder for blueprints than C++, but it could lead you to the answer.

    Other than that, I didn't see much at all about this, so you're probably just trying to do something that's too new, IMO. Nobody's done it yet.

    Having said that, it seems interesting, and I wish I had time to look into it now.

    Comment


      #3
      Thanks for the answer. I wanted to try ccall and cwrap before, the thing was I didn't know how to find/put a blueprint function inside the c++ code to call it from javascript and as someone who hasn't looked into c++ structure of games made by this engine before, it was overwhelming. are there any simple tutorials for that?

      in html development, I think it's one of the essentials. Maybe I could find a suggestion form somewhere...

      Comment


        #4
        Thanks for the hints. I'm getting into this now.

        I want to know two things.

        1) How do you invoke an HTML5 function from Blueprints?

        2) How do you invoke Blueprints from an HTML5 function?


        http://kripken.github.io/emscripten-...ting-with-code
        Last edited by tgraupmann; 02-05-2017, 05:03 PM.

        Comment


          #5
          Here's my question on answerhub, the solution works, so good luck.

          https://answers.unrealengine.com/que...avascript.html
          Void Digital - Game And Digital Products Development Studio

          Comment


            #6
            Originally posted by Holybreath View Post
            Here's my question on answerhub, the solution works, so good luck.

            https://answers.unrealengine.com/que...avascript.html
            Thanks. That really helped. I have all the pieces now.

            http://tagenigma.com/blog/2017/02/05...peech-plugins/

            Comment

            Working...
            X