UE4SS-RE / RE-UE4SS

Injectable LUA scripting system, SDK generator, live property editor and other dumping utilities for UE4/5 games
http://docs.ue4ss.com/
MIT License
1.38k stars 188 forks source link

[Question] How do I independently link to the Unreal module ? #519

Open UE4SS opened 6 months ago

UE4SS commented 6 months ago

I'm working on a project and the project doesn't have a use for UE4SS, but it does have a use for the Unreal module used by UE4SS. The original reason why the Unreal module is a different repo was to allow this sort of thing. Since the change to xmake, I no longer have any idea how I would go about using Unreal in a non-UE4SS project.

I've currently hacked it together by copying the entire xmake set up from UE4SS, but I'm wondering if there's maybe a better way that isn't so pervasive ?

bitonality commented 6 months ago

Correct me if I'm wrong, but

    add_deps(
        "File", "DynamicOutput", "SinglePassSigScanner", 
        "Constructs", "Helpers", "Function", 
        "ASMHelper"
    )

these dependencies would need to be made available to UEPseudo and UE4SS?

@UE4SS Is the scope of your request to be able to build the Unreal.lib and link to it?

UE4SS commented 6 months ago

Correct me if I'm wrong, but

    add_deps(
        "File", "DynamicOutput", "SinglePassSigScanner", 
        "Constructs", "Helpers", "Function", 
        "ASMHelper"
    )

Yes that would be how you link things but they all use custom Lua stuff all over the place and will complain a lot if you just add them as a dependency. They expect our root xmake, our UE4SS xmake, our tool xmake scripts to be executed first.

@UE4SS Is the scope of your request to be able to build the Unreal.lib and link to it?

Yes, that is what I want to do.

bitonality commented 6 months ago

Correct me if I'm wrong, but

    add_deps(
        "File", "DynamicOutput", "SinglePassSigScanner", 
        "Constructs", "Helpers", "Function", 
        "ASMHelper"
    )

Yes that would be how you link things but they all use custom Lua stuff all over the place and will complain a lot if you just add them as a dependency. They expect our root xmake, our UE4SS xmake, our tool xmake scripts to be executed first.

@UE4SS Is the scope of your request to be able to build the Unreal.lib and link to it?

Yes, that is what I want to do.

Is the goal to just clone the UEPseudo repo and be pretty much good to go from there? (Doable but not supported yet)

Or is the goal to be able to easily grab the UEPseudo.lib/build context from a cloned UE4SS? (Faster but hacky)

(I personally like the idea of supporting the first goal)

UE4SS commented 6 months ago

Is the goal to just clone the UEPseudo repo and be pretty much good to go from there? (Doable but not supported yet)

Or is the goal to be able to easily grab the UEPseudo.lib/build context from a cloned UE4SS? (Faster but hacky)

(I personally like the idea of supporting the first goal)

Definitely the first goal.

Also, I realize that the actual code side of the Unreal module isn't set up in a way where you can safely use every feature that it provides, but it does provide enough to be very useful. All you really need to do is tell it what version of UE you're using and then tell it to initialize the versioned containers, you don't even need to call the regular initialize function, but you wouldn't want to call that function without being attached to a game anyway. After that, just provide something that is a structurally accurate object and the getter/setter functions will work fine, and that's mostly what I'm after. I can manually set up the prerequisites for TypeChecker if I want extended functionality as well.