rdeioris / LuaMachine

Unreal Engine Plugin for Lua APIs implementation
MIT License
581 stars 120 forks source link

Character's functions from state #2

Closed Nogitsu closed 5 years ago

Nogitsu commented 5 years ago

Hi, I am trying to call functions of a Character from a Widget run, I'm getting my Character from my Lua State but when I try to call Characters function, nothing happens, and nothing in my console..

In game: image

Commands + when pressing run: image

GetPlayer() image

Player's Lua Component's Content image

rdeioris commented 5 years ago

Hi @Nogitsu , thanks for the great report. Your issue is related to a non-updated docs paragraph about LuaComponent usage (just fixed it). In the latest releases i have removed any form of 'automagic' from the plugin, so when you return an Actor (even if it has a LuaComponent attached), the actor itself will be received by Lua (as userdata):

https://github.com/rdeioris/LuaMachine/blob/master/Docs/LuaComponent.md#luacomponent-interactions

This allows a more versatile approach for advanced extensions (like the reflection described here: https://github.com/rdeioris/LuaMachine/blob/master/Tutorials/ReflectionShell.md)

I have just released a new update including various shortcuts for retrieving the LuaComponent from an Actor as a LuaValue.

If you want to fix your blueprint without updating, just call GetComponentByClass after the GetPlayerPawn, and encapsulate the result in a lua value.

Let me know if it works for you

Nogitsu commented 5 years ago

So, first, I've done like this image but it didn't worked (but no error in the console) And then I've done this to see if the problem where from getting on pawn or by class image But still doesn't work..

And I'd like to update, but excluding the binaries, nothing works ^^' I think that you should make a discord for LuaMachine ! It should be nice to talk there and share everybody's creations using it 😄

rdeioris commented 5 years ago

Hi again, the plugin has been approved for the Marketplace, so i need to check if i can make a binary release here. (older binary releases are pretty outdated)

Nogitsu commented 5 years ago

Approved but not published ? image

rdeioris commented 5 years ago

Yep, i am finalizing the last tutorial before publishing. By the way i have added a new binary release:

https://github.com/rdeioris/LuaMachine/releases/tag/20190131

as well as a discord channel: https://discord.gg/eTXDfEU

Nogitsu commented 5 years ago

The binary release now works, thanks 😃