blt4linux / blt4l

PAYDAY 2 SteamOS/Linux LUA loader.
Other
57 stars 14 forks source link

Add DB:create_entry support #100

Closed ZNixian closed 6 years ago

ZNixian commented 6 years ago

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).

hellow554 commented 6 years ago

Amazing work, I love it :) Have to test it though...

ZNixian commented 6 years ago

No problem - thanks for reviewing it.

hellow554 commented 6 years ago

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?

ZNixian commented 6 years ago

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.

hellow554 commented 6 years ago

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)

ZNixian commented 6 years ago

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.

hellow554 commented 6 years ago

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:

  1. git clone https://github.com/ZNixian/blt4l.git
  2. cd blt4l
  3. git submodule init; git submodule update
  4. mkdir build; cd build; cmake ..; make
  5. cp libblt_loader.so ~/.steam/steam/steamapps/common/PAYDAY\ 2/
  6. cp -r mods/ ~/.steam/steam/steamapps/common/PAYDAY\ 2/
  7. patch ~/.steam/steam/steamapps/common/PAYDAY\ 2/mods/base/req/BLTMod.lua patchfromabove.diff
  8. Steam Launch options: LD_PRELOAD="$LD_PRELOAD /home/marcel/.steam/steam/steamapps/common/PAYDAY2/libblt_loader.so" %command% -skip_intro
  9. Start Steam and click go into options -> blt options

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 :|

ZNixian commented 6 years ago

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.

hellow554 commented 6 years ago

Progress! Now it does not show the text "No Image" anymore and it does not crash, but... see yourself

image

So I guess it works, but not showing up the picture is another problem?

Btw, I would recommend then updating the README.md

ZNixian commented 6 years ago

Yeah, this is where I ended up. I suspect it's due to reload_textures not working with my asset implementation.

hellow554 commented 6 years ago

Alright. I would suggest updating the Readme and then I don't see anything that would block this PR

RomanHargrave commented 6 years ago

@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.

ZNixian commented 6 years ago

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.