ncsoft / Unreal.js

Unreal.js: Javascript runtime built for UnrealEngine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unreal 5.3 support

tvortsa opened this issue · comments

Hello!
Is it planned to support version 5.3 ?

What would it take to get 5.2/5.3 upgrades moving ? If someone on the team could go over the process upgrading I would be glad to help.

+1 - is this a situation where maintaining a community fork would be reasonable if the team isn't able to maintain support for upgrades?

I generally casually maintain my opinionated UnrealJs fork (https://github.com/getnamo/UnrealJs), you can find a working 5.3 win64 release here: https://github.com/getnamo/UnrealJs/releases/tag/v0.9.1. Not all upstream changes are guaranteed, but it generally has very similar API apart from fork specific features (instances & async js).

Can probably look at diffs to apply similar changes to mainline to update it to 5.3. Hope it helps.

i have modified sources using diffs from getnamo and it works for me in unreal engine 5.3 on linux. you can check it out here https://github.com/dariusznaurecki/Unrealjs
unrealjs

You wouldn't need unreal.js for this, just a texture2d copy to buffer (c++ code) (optionally convert to png if bandwidth is problem), then e.g. emit buffer using socket.io plugin and handle incoming buffer.

Edit:
Something like: https://github.com/getnamo/SocketIOClient-Unreal/blob/master/Source/CoreUtility/Public/CUBlueprintLibrary.h#L131 would work. Which is blueprint exposed in the socket.io plugin. Get the texture from render target (example code is found here: https://github.com/getnamo/TensorFlow-Unreal/blob/master/Source/TensorFlow/Private/TensorFlowBlueprintLibrary.cpp#L141).

I will take a look at your links. Thanks for your effort.

Does anyone know how to establish a connection between UMG and JS? #342 I hope the design of the UMG interface is completed in the blueprint, but the corresponding logic is written in the JS layer. I refer to https://github.com/ncsoft/Unreal.js/wiki/Override-Blueprint-Function, The function in the blueprint cannot be override in the JavaScript layer through the following code

class MyTestWidget extends WidgetBlueprint.Load('/Game/Test/MyWidget').GeneratedClass{
    // MyWidget is a UMG inherited from JavascriptWidget, Create in editor
    // Override, but no effect
    Test() {
        console.log("Press Button From Javascript")
    }
}

function main()
{
    let widget = GWorld.CreateWidget(JavascriptWidget, PC)
    widget.JavascriptContext = Context
    widget.bSupportsKeyboardFocus = true
    widget.bIsFocusable = true

    let Test = new MyTestWidget()
    widget.SetRootWidget(Test)
    widget.AddToViewport()
}

The following method is even more incorrect, and UMG will not display properly:

class MyTestWidget extends WidgetBlueprint.Load('/Game/Test/MyWidget').GeneratedClass{

    // Override an event which was declared in Blueprint
    Test() {
        console.log("Press Button From Javascript")
    }

}

function main()
{
    let PC = GetPC()

    let TestWidget_C = require('uclass')()(global, MyTestWidget)
    let widget = GWorld.CreateWidget(TestWidget_C, PC)
    console.log(JSON.stringify(widget))
    widget.AddToViewport()
}

In the hierarchy it's usually c++ > blueprint -> Javascript so blueprints can inherit and override c++ classes and JavaScript can inherit blueprints and c++ classes, but it doesn't go the other way.

If you want to call a function implemented in JavaScript from blueprint use inheritance to make a base function that the js layer implements in it's subclass. You can't inherit from Js defined class in blueprints but you can build common API via interfaces or inheritance that you can call.

JavaScript overrides do work, just make sure WidgetBlueprint.Load('/Game/Test/MyWidget').GeneratedClass resolves to a valid class.