x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[HTML5] Call C++ UFUNCTION from Webpage via JavaScript

Hello,

Is there a plugin or a general way (not emscripten) to invoke a C++ UFUNCTION() in Unreal. I would like to send some events from the page (e.g button click) into unreal html5 build that is embeded into page. Has anyone tried this, can point me in the right direction?

Cheers.

Product Version: UE 4.14
Tags:
more ▼

asked Jan 29 '17 at 01:59 PM in C++ Programming

avatar image

Holybreath
383 10 7 19

avatar image jonathan.madden Jan 30 '17 at 01:53 PM

I was writing an answer until I re-read this and saw you wrote "not emscripten."

avatar image Holybreath Feb 01 '17 at 06:41 AM

@jonathan.madden Mate, at this point, i'll go with emscripten, since i had a small breakthrough with it (calling javascript is easy). Can you still post your answer? for future generations at least, thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The short version with a button click example is this: Webpage Button to UFUNCTION

And a totally unnecessary screenshot of the event in the blueprint graph. :p Anything that needs to know about that event just binds to our gamemode's dispatcher: Event Called from Webpage

The long version with more examples: https://answers.unrealengine.com/questions/530115/webgl-and-resolution-errors-in-html5.html

more ▼

answered Feb 01 '17 at 03:00 PM

avatar image

jonathan.madden
169 8 8 14

avatar image Holybreath Feb 01 '17 at 06:03 PM

is there a way to pass params?

avatar image jonathan.madden Feb 01 '17 at 10:15 PM
 Module.ccall('web_set_data', null, ['string', 'number'], ['Test', 2]);

and void EMSCRIPTEN_KEEPALIVE web_set_data(EM_UTF8* _string, int _number){}

This works, and the same way with .cwrap to assign a C function to JavaScript like in the big text file in my linked post.

avatar image jonathan.madden Feb 01 '17 at 10:17 PM
 void EMSCRIPTEN_KEEPALIVE web_set_data(EM_UTF8* _string, int _number){}
avatar image Holybreath Feb 02 '17 at 09:25 AM

Thank you! It's stange however, that i can see methods wrapped in Module (js side) , but when i call them, there's no response in UE4. (tried on screen messages in functions, no result, will continue trying )

avatar image ArosPrince 5 days ago

What do I need to include to be able to use those EMSCRIPTEN_ macros?

avatar image CrashAngel Feb 28 '19 at 11:43 PM

Hi, you have results in pass paraemters to engine from javascripts???

avatar image jonathan.madden Mar 01 '19 at 04:41 PM

This all worked in 4.13, but we've dropped development on our HTML5 build so I don't know if any of this changed since then.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question