Closed ZNixian closed 6 years ago
Amazing work, I love it :) Have to test it though...
No problem - thanks for reviewing it.
Hmm, looks good so far, as it does not crash :) One Problem I occur is
10:08:36 AM Lua: [Error] Mod image at path does not exist! mods/base/blt.png
although it does exist..
ls -l .steam/steam/steamapps/common/PAYDAY\ 2/mods/base/blt.png
-rw-r--r-- 1 marcel marcel 22831 3. Jan 09:37 '.steam/steam/steamapps/common/PAYDAY 2/mods/base/blt.png'
I guess there is something wrong with (my)) working directory?
No, that's casued by Application:nice_path
, which is looking for mods/base/blt.png/
- the code calling this is in BLTMod.lua:284 in the base mod.
When I change that line (which is 279 ) to if SystemFS:exists( self:GetModImagePath() ) then
(I don't know LUA very well, so please forgive my stupidity) payday crashes with this:
Pure virtual function called!
I don't know if I should attach a debugger, but I don't know which side to blame (blt4l or payday)
First, check crash.txt
(in mods/logs
) and see if that was crashing it, or one of the functions inside the if
. Attaching a debugger and grabbing the stacktrace (one of the things I never got around to putting in crash.txt
) would be useful, too.
I cannot replicate it, however.
The problem is the old one :| Lua runtime error: mods/base/req/BLTMod.lua:286: attempt to call method 'create_entry' (a nil value)
, sad...
279c279
< if SystemFS:exists( Application:nice_path( self:GetModImagePath(), true ) ) then
---
> if SystemFS:exists( self:GetModImagePath() ) then
Here's the steps I took:
git clone https://github.com/ZNixian/blt4l.git
cd blt4l
git submodule init; git submodule update
mkdir build; cd build; cmake ..; make
cp libblt_loader.so ~/.steam/steam/steamapps/common/PAYDAY\ 2/
cp -r mods/ ~/.steam/steam/steamapps/common/PAYDAY\ 2/
patch ~/.steam/steam/steamapps/common/PAYDAY\ 2/mods/base/req/BLTMod.lua patchfromabove.diff
LD_PRELOAD="$LD_PRELOAD /home/marcel/.steam/steam/steamapps/common/PAYDAY2/libblt_loader.so" %command% -skip_intro
One thing is, that there is a symlink from PAYDAY2 to PAYDAY\ 2, because I couldn't figure out how to put a space into the steam launch options (\
didn't work, neither ' '
).
Am I just to stupid this morning? I hope not :|
cmake ..
Ah, that's your problem. For interopability with PD2 beyond basic Lua stuff, we have to use the same standard library. PD2 uses libc++/libcxx, while you're probably compiling with glibc.
You have to install LibCXX, LLVM/Clang, and pass -DUSE_LIBCXX=1
to cmake.
Progress! Now it does not show the text "No Image" anymore and it does not crash, but... see yourself
So I guess it works, but not showing up the picture is another problem?
Btw, I would recommend then updating the README.md
Yeah, this is where I ended up. I suspect it's due to reload_textures
not working with my asset implementation.
Alright. I would suggest updating the Readme and then I don't see anything that would block this PR
@ZNixian to verify, we are waiting for a reload_textures
hack in order to actually use loaded textures? I've been testing this PR and that would line up. BeardLib is able to load assets but they aren't useable.
Yes, that's the case. For whatever (@Fanged-Hex) reason, VoidUI is able to load and use textures without reload_textures
, however BLT doesn't seem to.
I suspect this has something to do with timing, and when the texture caching stuff is loaded.
Tested, and works fine, on Void UI. It doesn't seem to work with loading the mod icons in the mod manager, however that is most likely a timing issue that will be rarely encountered (though should still be fixed).