All Projects → jashking → Bluelua

jashking / Bluelua

A lightweight ue4 lua framework

Programming Languages

c
50402 projects - #5 most used programming language
lua
6591 projects

Projects that are alternatives of or similar to Bluelua

CoopShooterUdemy
C++ Coop Horde Third-person Shooter for Unreal Engine 4 (Udemy Project)
Stars: ✭ 328 (+375.36%)
Mutual labels:  blueprint, ue4
Steambridge
A UE4 implementation of the Steamworks API.
Stars: ✭ 48 (-30.43%)
Mutual labels:  ue4, blueprint
RyansUE4Helpers
Extremely helpful helper functions for developing Blueprint and C++ projects in Unreal Engine.
Stars: ✭ 55 (-20.29%)
Mutual labels:  blueprint, ue4
CrashlyticsKit
The most powerful, yet lightest weight crash reporting solution for Unreal Engine 4
Stars: ✭ 25 (-63.77%)
Mutual labels:  blueprint, ue4
Varest
REST API plugin for Unreal Engine 4 - we love restfull backend and JSON communications!
Stars: ✭ 707 (+924.64%)
Mutual labels:  ue4, blueprint
tsu
TypeScript plugin for Unreal Engine 4
Stars: ✭ 62 (-10.14%)
Mutual labels:  blueprint, ue4
LocalSimulation
This plugin allows you to essentially create PxScene or Physic Scenes by placing an Actor, and adding other Static Mesh Components and soon Skeletal Mesh components within this space. Adding Constraints, and Forces will work as expected, but now with the additional layer of abstraction so that simulation can be anchored to a transform.
Stars: ✭ 42 (-39.13%)
Mutual labels:  blueprint, ue4
Ue4 Style Guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,656 (+3749.28%)
Mutual labels:  ue4, blueprint
global-event-system-ue4
Loosely coupled internal event system plugin for the Unreal Engine.
Stars: ✭ 122 (+76.81%)
Mutual labels:  blueprint, ue4
DlgSystem
Dialogue Plugin System for Unreal Engine | 🪞 Mirror of https://bit.ly/DlgSource
Stars: ✭ 136 (+97.1%)
Mutual labels:  blueprint, ue4
stomt-unreal-plugin
Collect feedback in-game/in-app with STOMT for Unreal Engine.
Stars: ✭ 23 (-66.67%)
Mutual labels:  blueprint, ue4
ue5-style-guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,892 (+4091.3%)
Mutual labels:  blueprint, ue4
Arteries
A procedural modeling toolkit base on UE4 blueprint
Stars: ✭ 92 (+33.33%)
Mutual labels:  blueprint, ue4
Coophordeshooter
C++ Coop Horde Third-person Shooter for Unreal Engine 4 (Udemy Project)
Stars: ✭ 257 (+272.46%)
Mutual labels:  ue4, blueprint
Dungeontemplatelibrary
🌏: Dungeon free resources (terrain & roguelike generation)
Stars: ✭ 595 (+762.32%)
Mutual labels:  ue4
Runtimemeshcomponent
Unreal Engine 4 plugin component for rendering runtime generated content.
Stars: ✭ 903 (+1208.7%)
Mutual labels:  ue4
Pbcharactermovement
HL2-style, classic FPS movement for Unreal Engine 4 implemented in C++
Stars: ✭ 582 (+743.48%)
Mutual labels:  ue4
Flask Empty
An empty project skeleton / boilerplate for flask projects. Powered by CookieCutter.
Stars: ✭ 569 (+724.64%)
Mutual labels:  blueprint
React Todo
ReactJS + CSS Modules + Sass + Blueprint
Stars: ✭ 49 (-28.99%)
Mutual labels:  blueprint
Blueprintsound
A plugin for Unreal Engine 4 that surfaces sound-related functionality to Blueprint.
Stars: ✭ 6 (-91.3%)
Mutual labels:  ue4

Bluelua for UE4

Replace the blueprint with Lua, keep it in a consistent way with the blueprint, and switch seamlessly. Accessing UObject's properties and methods with reflection and without the need to generate glue code, more simple and easy to expand.

Android, iOS, Mac, Windows, Linux are supported now.

Used Open Source Libraries

  • lua : Lua is a powerful, efficient, lightweight, embeddable scripting language
  • luasocket : Network support for the Lua language
  • Tencent LuaPanda : Pandora Lua Debugger for VS Code

Features

  • Call UFunction directly in lua
  • Access UProperty member of UClass/UStruct
  • Override BlueprintNativeEvent/BlueprintImplementable in lua
  • Override blueprint's function/event in lua
  • Override native net replicated event(Server/Client/NetMulticast) in lua
  • Override blueprint's net replicated event in lua

How to use

Clone Bluelua to your project's Plugins folder, regenerate project solution and build.

How to inherit C++ with lua

  • ILuaImplementableInterface

    All C++ classes that can be used with LUA subclasses need to be inherited from this interface and the corresponding methods are called in the corresponding virtual functions, the main types of overrideing are as follows:

    All C++ classes (or blueprint classes) need to override two important BlueprintNativeEvent: ShouldEnableLuaBinding: should use lua subclass on this C++/Blueprint class. OnInitBindingLuaPath: return corresponding lua file path

    It's optional to override OnInitLuaState: return custom FLuaState wrapper, default use of global lua state

    • Class AActor, see LuaImplementableActor.h

      • Call OnInitLuaBinding in BeginPlay
      • Call OnReleaseLuaBinding in EndPlay
      • Call LuaProcessEvent in ProcessEvent
    • Class UUserWidget, see LuaImplementableWidget.h

      • Call OnInitLuaBinding in NativeConstruct
      • Call OnReleaseLuaBinding in NativeDestruct
      • Call LuaProcessEvent in ProcessEvent

      The UUserWidget class also has a special place where the LatentAction owned by the class is not affected by the pause, so you also need to override NativeTick and call LatentActionManager in the virtual function to handle all LatentAction objects. See TickActions in LuaImplementableWidget.h

    • Class UObject, see RPGAnimNotifyState.h in Demo LuaActionRPG

      • Call OnReleaseLuaBinding in BeginDestroy
      • Call LuaProcessEvent in ProcessEvent
      • Because the Uobject class does not have an initialized virtual function that can be overrided, so it can call OnInitLuaBinding the first time the ProcessEvent is called, as shown in the demo
    • Class UGameInstance, see RPGGameInstanceBase.h in Demo LuaActionRPG

      • Call OnInitLuaBinding in Init
      • Call OnReleaseLuaBinding in Shutdown
      • Call LuaProcessEvent in ProcessEvent
  • keyword Super

    When you use Lua to subclass c++ classes or blueprints, there is a temporary global object called Super represent the parent UObject that you can access it's properties and methods. It's only avaliable when lua file is loaded(luaL_loadbuffer), so you need to cache it's reference in your lua file like local MyParent = Super and use MyParent in your lua

  • CastToLua

    When you have a UObject in lua and want to know if the object has a lua subclass, you can call CastToLua on that object like local LuaObject = OtherObject:CastToLua(), it returns a lua table represent the lua object if OtherObject has a lua subclass. CastToLua works like cast in blueprint:

  • Modular lua subcalss

    All lua subclass should implement in modular table and methods should declare with : not ., see see GameInstance.lua in Demo LuaActionRPG

    local m = {}
    
    function m:func()
    end
    
    return m
    
  • inheritance in lua

    You can use lua metatable to implement inheritance like you do in C++ or blueprint, see PlayerCharacter.lua and Character.lua in Demo LuaActionRPG

  • When a UFUNCTION expose to blueprint, it can has a alias, like BeginPlay in blueprint, it actually called ReceiveBeginPlay. so when you override this function in lua you should use ReceiveBeginPlay not BeginPlay.

Samples

  • LuaActionRPG: Epic's ActionRPG demo in lua implementation, still work in progress
  • BlueluaDemo: benchmark and test

TODO

  • expose lua file reader to project, do not assume lua files under ProjectContent folder
  • hot reload lua
  • optimize OnProcessLuaOverrideEvent when find lua function

中文版使用介绍

使用介绍

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].