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
980 stars 147 forks source link

[Question] PalWorld: The function HookedLoadMap Crashed #584

Open AnnznnA opened 3 days ago

AnnznnA commented 3 days ago

[Game and UE version] palworld v0.3.2 -UE5.1.1

[Description] I tried to develop a lua mod based on ue4ss-lua-doc,and it works without crash,but when I re-enter the world ,it will crash and this is report

:UE4SS!RC::Unreal::HookedLoadMap() [D:\a\RE-UE4SS\RE-UE4SS\deps\first\Unreal\src\Hooks.cpp:433]

I developed with the zDEV-ue4ss v3.0.1 version

so I am tring to make HookedLoadMap:0 in the ue4ss-setting.ini and it still Appear Is there the same problem as me?:D

AnnznnA commented 3 days ago

At first I turned off the 'RegisterLoadMapPostHook' Seems to solve the problem but it still seems to be there

Buckminsterfullerene02 commented 15 hours ago

What happens if you try the latest experimental version?

AnnznnA commented 13 hours ago

What happens if you try the latest experimental version?

The setting of 'HookedLoadMap' have taken effect,this solves my problem,but in fact, we need this HookedLoadMap。

And I think this bug was originally caused by the game PalWorld, he reconstructed a lot of objects and caused a reference error when he re-entered the world,you need re-enter the game to solve, I didn't find any problems in the source of ue4ss, according to the dmp file, the input parameters of HookedLoadMap are caused by invalid values of the crash, and I don't have the source code of palword, I can only locate it through testing at the moment.

Using Lua mod to call the Blueprint function of some Palworld's built-in Blueprint objects can cause these problems, which can be avoided by packaging a new Blueprint function into the pakfile and load by BPModLoader yourself.

I can give some examples of test results

--- will not crash when re-enter the world,I am not using the BP object and it is safe
RegisterKeyBind(Key.NINE, {ModifierKey.SHIFT }, function()
    ExecuteInGameThread(function()
        FindFirstOf("APalCharacter"):RequestJump()
    end)
end)

--- will crash when re-enter the world,I am not using the BP object and it is safe
RegisterKeyBind(Key.NINE, {ModifierKey.SHIFT }, function()
    ExecuteInGameThread(function()
        FindFirstOf("BP_OtomoPalHolderComponent_C"):InactivateAllOtomo()
    end)
end)

this is just an example, and it is actually developed to target a specific palcharacter object,I don't know if it's because Lua calls Blueprint objects, but that's how I've tested it so far. I could have avoided him by packaging my own Blueprint scripts with ue-pak, but hopefully Lua will work because he's just awesome, fast and hot-reloadable Perhaps as a non-game developer with no experience, there are some things to keep in mind about whether or not to take Blueprint objects