Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG - Release] All BluePrint Mod do not work #679

Open
longsizhuo opened this issue Oct 4, 2024 · 6 comments
Open

[BUG - Release] All BluePrint Mod do not work #679

longsizhuo opened this issue Oct 4, 2024 · 6 comments
Labels
blueprint mod Related to Blueprint modding

Comments

@longsizhuo
Copy link

Branch or Release
The Tag for the Release you are using, or the commit you used if you built from source yourself.

Game and Engine Version
Game where the bug occurred, and the UE engine version of the game.
[0.3.9] Palworld [3.0.1] UE4SS

Describe the bug
Any BP mods didn't run, so I add many debug prints in the BPModLoaderMod/Scripts/main.lua. I find pairs(LogicModsDir) is empty and it did not run in the for loop of

    for ModDirectoryName,ModDirectory in pairs(LogicModsDir) do
        Log(string.format("Mod: %s\n", ModDirectoryName))
        Log(string.format("222222222222"))
        for _,ModFile in pairs(ModDirectory.__files) do
            Log(string.format("    ModFile: %s\n", ModFile.__name))
            if ModFile.__name == "config.lua" then
                dofile(ModFile.__absolute_path)
                if type(Mods[ModDirectoryName]) ~= "table" then break end
                if not Mods[ModDirectoryName].AssetName then break end
                Mods[ModDirectoryName].AssetNameAsFName = UEHelpers.FindOrAddFName(Mods[ModDirectoryName].AssetName)
                break
            end
        end
    end

Mods directory
A zip of your Mods folder if you've installed any mods that don't come with UE4SS by default
image

the zip file of Mods have 1.2 GB, I cannot upload it.

To Reproduce
Steps to reproduce the behavior:

  1. Launch game
  2. Attempt UHT Dump
  3. See error in log

Expected behavior
It should print all the .paks and run the Mods.

Screenshots, UE4SS Log, and .dmp file
image

[04:54:43] m_shared_functions: 0x7ffbc8403b60
[04:54:43] Enabling custom events
[04:54:43] Starting mods (from mods.txt load order)...
[04:54:43] Mod 'ActorDumperMod' disabled in mods.txt.
[04:54:43] Starting Lua mod 'ConsoleCommandsMod'
[04:54:43] Starting Lua mod 'ConsoleEnablerMod'
[04:54:43] [Lua] ConsoleClass, GameViewport, or ViewportConsole is invalid
[04:54:43] Mod 'SplitScreenMod' disabled in mods.txt.
[04:54:43] Mod 'LineTraceMod' disabled in mods.txt.
[04:54:43] Starting Lua mod 'BPModLoaderMod'
[04:54:43] [Lua] Absolute Path of LogicModsDir: F:\Steam\steamapps\common\PalServer\Pal\Content\Paks\LogicMods
[04:54:43] [Lua] 1111111111111111111
[04:54:43] [Lua] LogicModsDir type: table
[04:54:43] [Lua] LogicModsDir is empty.
[04:54:43] [Lua] Mod File: MHGameSetting_P.json, Absolute Path: F:\Steam\steamapps\common\PalServer\Pal\Content\Paks\LogicMods\MHGameSetting_P.json
[04:54:43] [Lua] Mod File: MHGameSetting_P.pak, Absolute Path: F:\Steam\steamapps\common\PalServer\Pal\Content\Paks\LogicMods\MHGameSetting_P.pak
[04:54:43] [Lua] Mod File: StorageIntergration.pak, Absolute Path: F:\Steam\steamapps\common\PalServer\Pal\Content\Paks\LogicMods\StorageIntergration.pak
[04:54:43] [Lua] Mods/BPModLoaderMod/load_order.txt not present or no matching mods, loading all BP mods in random order.
[04:54:43] [Lua] StorageIntergration == table: 000001F79AB1AB30
[04:54:43] [Lua]     Name == StorageIntergration
[04:54:43] [Lua]     AssetName == ModActor_C
[04:54:43] [Lua]     AssetPath == /Game/Mods/StorageIntergration/ModActor
[04:54:43] [Lua]     AssetNameAsFName == FNameUserdata: 000001F79AA4F6B8
[04:54:43] [Lua] MHGameSetting_P == table: 000001F79AB1A930
[04:54:43] [Lua]     Name == MHGameSetting_P
[04:54:43] [Lua]     AssetName == ModActor_C
[04:54:43] [Lua]     AssetPath == /Game/Mods/MHGameSetting_P/ModActor
[04:54:43] [Lua]     AssetNameAsFName == FNameUserdata: 000001F79AA4F6B8
[04:54:43] Starting Lua mod 'BPML_GenericFunctions'
[04:54:43] Mod 'jsbLuaProfilerMod' disabled in mods.txt.
[04:54:43] Starting Lua mod 'Keybinds'
[04:54:43] Starting mods (from enabled.txt, no defined load order)...
[04:54:43] Mod 'TehExtraBaseAreaMod' has enabled.txt, starting mod.
[04:54:43] Event loop start

Desktop (please complete the following information):

  • OS: Win11

Additional context
What I changed in BPModLoaderMod/Scripts/main.lua

local function LoadModConfigs()
    -- Load configurations for mods.
    local Dirs = IterateGameDirectories();
    if not Dirs then
        error("[BPModLoader] UE4SS does not support loading mods for this game.")
    end
    local LogicModsDir = Dirs.Game.Content.Paks.LogicMods
    if not Dirs then error("[BPModLoader] IterateGameDirectories failed, cannot load BP mod configurations.") end
    if not LogicModsDir then
        CreateLogicModsDirectory();
        Dirs = IterateGameDirectories();
        Log(string.format("Dirs: %s\n", Dirs))
        LogicModsDir = Dirs.Game.Content.Paks.LogicMods
        if not LogicModsDir then error("[BPModLoader] Unable to find or create Content/Paks/LogicMods directory. Try creating manually.") end
    end
    Dirs = IterateGameDirectories();
    Log(string.format("Absolute Path of LogicModsDir: %s", LogicModsDir.__absolute_path or "Path not available"))

    Log(string.format("1111111111111111111"))
    Log(string.format("LogicModsDir type: %s", type(LogicModsDir)))
    if next(LogicModsDir) == nil then
        Log("LogicModsDir is empty.")
    else
        Log("LogicModsDir contains elements.")
    end
    if LogicModsDir.__files then
        for _, ModFile in pairs(LogicModsDir.__files) do
            Log(string.format("Mod File: %s, Absolute Path: %s", ModFile.__name, ModFile.__absolute_path))
        end
    else
        Log("No files found in LogicModsDir.")
    end



    for ModDirectoryName,ModDirectory in pairs(LogicModsDir) do
        Log(string.format("Mod: %s\n", ModDirectoryName))
        Log(string.format("222222222222"))
        for _,ModFile in pairs(ModDirectory.__files) do
            Log(string.format("    ModFile: %s\n", ModFile.__name))
            if ModFile.__name == "config.lua" then
                dofile(ModFile.__absolute_path)
                if type(Mods[ModDirectoryName]) ~= "table" then break end
                if not Mods[ModDirectoryName].AssetName then break end
                Mods[ModDirectoryName].AssetNameAsFName = UEHelpers.FindOrAddFName(Mods[ModDirectoryName].AssetName)
                break
            end
        end
    end

    -- Load a default configuration for mods that didn't have their own configuration.
    for _, ModFile in pairs(LogicModsDir.__files) do
        local ModName = ModFile.__name
        local ModNameNoExtension = ModName:match("(.+)%..+$")
        local FileExtension = ModName:match("^.+(%..+)$");
        if FileExtension == ".pak" and not Mods[ModNameNoExtension] then
            --Log("--------------\n")
            --Log(string.format("ModFile: '%s'\n", ModFile.__name))
            --Log(string.format("ModNameNoExtension: '%s'\n", ModNameNoExtension))
            --Log(string.format("FileExtension: %s\n", FileExtension))
            Mods[ModNameNoExtension] = {}
            Mods[ModNameNoExtension].AssetName = DefaultModConfig.AssetName
            Mods[ModNameNoExtension].AssetNameAsFName = DefaultModConfig.AssetNameAsFName
            Mods[ModNameNoExtension].AssetPath = string.format("/Game/Mods/%s/ModActor", ModNameNoExtension)
        end
    end

    LoadModOrder()

    SetupModOrder()
end
@longsizhuo
Copy link
Author

longsizhuo commented Oct 4, 2024

Delete Pal-WindowsServer.pak and withdraw it, the UE4SS can load the mods but still with some errors like

[17:31:12] [Lua] ConsoleClass, GameViewport, or ViewportConsole is invalid

. Idk the reason

@longsizhuo
Copy link
Author

It maybe have some connections with #645

@longsizhuo longsizhuo changed the title [BUG - Release] pairs(LogicModsDir) is NULL [BUG - Release] All BluePrint Mod do not work Oct 4, 2024
@longsizhuo
Copy link
Author

RE-install all files include dedicated server, it can find mods now, but still not work

[19:48:41] m_shared_functions: 0x7ff80f6c3b60
[19:48:41] Enabling custom events
[19:48:41] Starting mods (from mods.txt load order)...
[19:48:41] Starting Lua mod 'CheatManagerEnablerMod'
[19:48:41] [RegisterHook] Registered native hook (1, 2) for Function /Script/Engine.PlayerController:ClientRestart
[19:48:41] Mod 'ActorDumperMod' disabled in mods.txt.
[19:48:41] Starting Lua mod 'ConsoleCommandsMod'
[19:48:41] Starting Lua mod 'ConsoleEnablerMod'
[19:48:41] [Lua] ConsoleClass, GameViewport, or ViewportConsole is invalid
[19:48:41] Mod 'SplitScreenMod' disabled in mods.txt.
[19:48:41] Starting Lua mod 'LineTraceMod'
[19:48:41] [Lua] KismetSystemLibrary: KismetSystemLibrary /Script/Engine.Default__KismetSystemLibrary
[19:48:41] [Lua] KismetMathLibrary: KismetMathLibrary /Script/Engine.Default__KismetMathLibrary
[19:48:41] Starting Lua mod 'BPModLoaderMod'
[19:48:41] [Lua] Mods/BPModLoaderMod/load_order.txt not present or no matching mods, loading all BP mods in random order.
[19:48:41] [Lua] StorageIntergration == table: 000001E385B6B330
[19:48:41] [Lua]     AssetName == ModActor_C
[19:48:41] [Lua]     AssetNameAsFName == FNameUserdata: 000001E385A86938
[19:48:41] [Lua]     Name == StorageIntergration
[19:48:41] [Lua]     AssetPath == /Game/Mods/StorageIntergration/ModActor
[19:48:41] [Lua] MHGameSetting_P == table: 000001E385B6B130
[19:48:41] [Lua]     AssetName == ModActor_C
[19:48:41] [Lua]     AssetNameAsFName == FNameUserdata: 000001E385A86938
[19:48:41] [Lua]     Name == MHGameSetting_P
[19:48:41] [Lua]     AssetPath == /Game/Mods/MHGameSetting_P/ModActor
[19:48:41] Starting Lua mod 'BPML_GenericFunctions'
[19:48:41] Mod 'jsbLuaProfilerMod' disabled in mods.txt.
[19:48:41] Starting Lua mod 'Keybinds'
[19:48:41] Starting mods (from enabled.txt, no defined load order)...
[19:48:41] Mod 'TehExtraBaseAreaMod' has enabled.txt, starting mod.
[19:48:41] Event loop start
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147329016
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328985
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328906
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328883
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328832
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328755
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328658
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328635
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:45] [Lua] [TEBA] Found Base: PalBaseCampModel /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_PalGameStateInGame_C_2147482015.PalBaseCampReplicator_2147482012.PalBaseCampModel_2147328526
[19:48:45] [Lua] [TEBA] Waiting 15 seconds to allow the model to finish initialization
[19:48:47] [Lua] Loading mod: StorageIntergration
[19:48:47] [Lua] Loading mod: MHGameSetting_P
[19:48:47] [Lua] Executing 'PostBeginPlay' for mod 'ModActor_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.ModActor_C_2147208567'
[19:48:47] [Lua] Executing 'PostBeginPlay' for mod 'ModActor_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.ModActor_C_2147208567'
[19:48:47] [Lua] Actor: ModActor_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.ModActor_C_2147208567
[19:48:47] [Lua] Executing 'PostBeginPlay' for mod 'ModActor_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.ModActor_C_2147208566'
[19:48:47] [Lua] Executing 'PostBeginPlay' for mod 'ModActor_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.ModActor_C_2147208566'
[19:48:47] [Lua] Actor: ModActor_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.ModActor_C_2147208566
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:48:48] [Lua] [TEBA] Moved deadly blue line...
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:00] [Lua] [TEBA] Default AreaRange: 5000.0
[19:49:00] [Lua] [TEBA] New base Area: 5000.0
[19:49:52] [Lua] ConsoleClass, GameViewport, or ViewportConsole is invalid
[19:50:33] [Lua] Doing line trace
[19:50:33] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154583
[19:50:33] [Lua] Doing line trace
[19:50:33] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154583
[19:50:33] [Lua] Doing line trace
[19:50:33] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154583
[19:50:33] [Lua] Doing line trace
[19:50:33] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154583
[19:50:34] [Lua] Doing line trace
[19:50:34] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154583
[19:50:50] [Lua] Doing line trace
[19:50:50] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154583
[19:50:51] [Lua] Doing line trace
[19:50:51] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154583
[19:50:52] [Lua] Doing line trace
[19:50:52] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154565
[19:50:52] [Lua] Doing line trace
[19:50:52] [Lua] HitActor: BP_BuildObject_Glass_Stair_C /Game/Pal/Maps/MainWorld_5/PL_MainWorld5.PL_MainWorld5:PersistentLevel.BP_BuildObject_Glass_Stair_C_2147154565
[19:51:59] Mod button Debug Info hit.
[19:51:59] [Lua] [StorageIntergration] StorageIntergration debugging: show intergrated container array length

@SnarkyGhost
Copy link

是悟空吗?

@longsizhuo
Copy link
Author

是悟空吗?

Nope, it's palworld

@Buckminsterfullerene02
Copy link
Member

Try latest experimental version of UE4SS https://github.com/UE4SS-RE/RE-UE4SS/releases/tag/experimental

@UE4SS UE4SS added the blueprint mod Related to Blueprint modding label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blueprint mod Related to Blueprint modding
Projects
None yet
Development

No branches or pull requests

4 participants