Giter Club home page Giter Club logo

payday-2-blt's People

Contributors

bangl avatar iyu46 avatar jameswilko avatar kilandor avatar saltisgood avatar simon-wh avatar sirwaddles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

payday-2-blt's Issues

Error in Keybind menu

i have a problem when i go to options > mod keybinds says in every key bind ERROR: mykeybindname any idea why? but i can still click the ERROR: mykeybindname and put a key and the script can run there no errors in the log, also the keybind description isnt showing if i remove the description the error is still appearing.
Here a image of the error:
blterror
this is my keybind code:
"keybinds" : [
{
"keybind_id" : "keybind_testmod01",
"name" : "Custom Menu",
"description" : "Opens the Custom menu",
"script_path" : "Lua/Menu.lua",
"run_in_menu" : true,
"run_in_game" : true,
}

Can't get Payday 2 BLT working again.

I had BLT and a bunch of mods, like Pocohud. I tried installing Hox as well and it started crashing my game. So I removed it and my blt wasn't working. Now whenever I do the steps to install the BLT again it just flat out won't work. I'm not very good with computers and files and such, I was just following the internet's tutorials. What do I do now? I should probably also say that I validated the games files after I removed the mods folder and the IPHLPAPI. I still have the old mods folder. And whenever I try to go to the BLT website I cant get the download link from there. It just does the whole "about blank" thing or whatever. It's like EVERYTHING that could go wrong has

Binding of mouse buttons

Hi,
I tried to bind "PushToInteractCancelCurrentInteraction" on "mouse 4" but it had no effect.
I had to modify mod_keybinds to not only check the keyboard but the mouse too:

--- mod_keybinds.lua    Wed Mar 04 23:00:56 2015
+++ mod_keybinds.lua.new    Sat Apr 25 00:55:31 2015
@@ -67,8 +67,11 @@

 function LuaModManager:UpdateBindings( state )

-   if not self._input then
-       self._input = Input:keyboard()
+   if not self._input_kb then
+       self._input_kb = Input:keyboard()
+   end
+   if not self._input_ms then
+       self._input_ms = Input:mouse()
    end
    if managers and managers.hud and managers.hud:chat_focus() then
        return
@@ -79,8 +82,14 @@

            local keybind = LuaModManager:Keybinds()[ keybind_id ]
            if keybind then
+               local key_pressed = nil
+
+               if string.find(key, "mouse ") == 1 then
+                   key_pressed = self._input_ms:pressed( key:sub(7) )
+               else
+                   key_pressed = self._input_kb:pressed( Idstring(key) )
+               end

-               local key_pressed = self._input:pressed( Idstring(key) )
                if key_pressed and Application:time() - set_keybind_time >= keybind_set_delay then
                    self:AttemptRunKeybind( keybind, state )
                end

As of the latest update (u91), BLT won't allow Vehicle Controls to be rebound

As of the latest update, OVERKILL has added in the ability to have a separate set of keys for when you're in a vehicle, and by design, the "In Vehicle" keys are allowed to be the same as the "On Foot" ones, and indeed some of them overlap the "On Foot" keys by default. BLT won't let you rebind any of these actions to keys already being used. This is an issue if for example the user is left-handed and use the arrow keys on foot, they can't set their arrow keys for the "In Vehicle" movement because of BLT.

It also has this weird bug (which I think it's had for a while but has become much more obvious now) where when you click on an action to set a key to it, it reads your mouse click as the key you're trying to set to that action, so you are forced to navigate with your keyboard and press Enter to activate the key binding process.

Help me

Crash date: 7/24/2016 10:50:21 AM

PAYDAY 2 Crash log

Application has crashed: access violation
-------------------------------
Callstack:
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
-------------------------------
Current thread: Renderer
-------------------------------
System information:
    Application version : 1.54.4
    CPU : Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (2 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce GT 730 / nvd3dum.dll[10.18.13.6881]
    Language : @ID94cca2fdaccfc2cd@
    Memory :     416335    0MB
    OS : 6.2.9200 () 0x100-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer (Speakers (Razer Surround Audio Controller))

Lua information

Lua Hook: present

BLT Hook data: present

Lua BLT Log (+/- 1 minute)

10:50:15 AM Log: CURL INITD
10:50:19 AM Log: Initiating Hook
10:50:21 AM Log: Initiating Hook
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_manager.txt', no data loaded...
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_keybinds.txt', no data loaded...
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_updates.txt', no data loaded...
10:50:21 AM Lua: [Mods] Loading mods for state (table: 02810600)
10:50:21 AM Lua: [Mods] Loading mod: base...
10:50:21 AM Log: Initiating Hook
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_manager.txt', no data loaded...
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_keybinds.txt', no data loaded...
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_updates.txt', no data loaded...
10:50:21 AM Lua: [Mods] Loading mods for state (table: 028105A0)
10:50:21 AM Lua: [Mods] Loading mod: base...
10:50:21 AM Log: Initiating Hook
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_manager.txt', no data loaded...
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_keybinds.txt', no data loaded...
10:50:21 AM Lua: [Warning] Could not load file 'mods/saves/mod_updates.txt', no data loaded...
10:50:21 AM Lua: [Mods] Loading mods for state (table: 1B9D1960)
10:50:21 AM Lua: [Mods] Loading mod: base...
10:50:21 AM Log: CURL CLOSED

Lua BLT Mods list

  • Name: Payday 2 BLT, Version: 1.0, Author: James Wilkinson

Installed PDMods/Override list

  • Name: Lower shadow map mod V4.3 (Disabled Anti-Aliasing), Type: PDMod, State: Installed, Author: I am not a spy...

Game will not start

So i installed BLT, along with Goonmod, but everytime i try and start Payday 2 it wont start, steam registers me as in game, but its not, then about a second later it just goes back to being online. I found out that if i took out he IPHLPAPI.dll file Payday 2 Booted with no problems but no mods. tried verifying cache.

--Edit I reinstalled my game, and booted, worked, reapplied BLT and Mods and it is working now. Well so Far.

Suggestion: Update All Button

So i've been using BLT since it was launched the first time, and in time, i have downloaded around 100+ BLT mods, with 83 mods currently in use. With every update, most of the mods i have will also need to be updated as well, and since i have tons of mods, sometimes there's a lot of mods that needs to be updated at the same time.

Now the problem is, when you have a lot of mods, and you can't see the list of the mods needed to be updated unless you go back to main screen, i need to check each mods for updates by clicking the update button. It's sometimes taxing when you get like 10-15 updates at once, and have to scroll each and every one of the mods to find the one that needs updating. So with that, can we get an update all button that checks every mods for update and update it on it's own?

I know it's a rather petty request, but if it's not much of a trouble, can it be done?

Please help, how i can fix this ?

I just start any heist and game crash
Look log please.
Application has crashed: access violation


Callstack:

     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
                       ???  (???)     ???                                                 
                       ???  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 

Current thread: Main
Script stack:
safe_spawn_unit() core/lib/utils/coreunit.lua:95
core/lib/utils/dev/editor/coreworlddefinition.lua:864
() =(tail
call):-1 create()
core/lib/utils/dev/editor/coreworlddefinition.lua:480 create_world()
core/lib/utils/dev/editor/worldholder.lua:110 init_game()
lib/setups/gamesetup.lua:452
core/lib/setups/coresetup.lua:394 ()
=(tail call):-1


System information:
Application version : 1.54.5
CPU : AMD Athlon(tm) II X2 215 Processor (1 core); SSE; SSE2; SSE3
DirectX : 10.0
GPU : NVIDIA GeForce GT 640 / nvd3dum.dll[10.18.13.6869]
Language : @ID69065f31945c7d82@
Memory : 42046 0MB
OS : 6.1.7601 (Service Pack 1) 0x100-0x1 (64 bits)
Physics : threaded
Renderer : DX9 threaded
Sound : Realtek Semiconductor Corp. (Динамики (Realtek High Definition Audio))

Windows Vista not supported (PSAPI version)

I am using Windows Vista. I downloaded the BLT, extracted both folders (Mods and IPHLPAPI.dll) into the Payday 2 Folder. I downloaded the vcredist_x64.exe and vcredist_x84.exe. When I open the game from Steam, I get the error," Engine has stopped working." When I open the game from the Payday 2 Folder, I get," The procedure entry point K32GetModuleInformation could not be located in the dynamic link library KERNEL32.dll, followed by Engine has stopped working. When I remove the IPHLPAPI.dll, the game works normally. (I do not have any other addons like Hoxhud)

Okay I got a reply saying Vista doesn't work yet.

New Payday Update

In the news about the new Payday update, they specifically mentioned that any modded game WILL crash.
The direct quote: http://steamcommunity.com/games/218620/announcements/detail/101677733981368160
"PLEASE NOTE: IF YOU HAVE MODS, YOU WILL CRASH!"
I was warned beforehand about this problem and uninstalled the hook before downloading the update, so I unfortunately do not have any log files available for you. I can reinstall it and purposely make my game crash if you would like the files to examine and to see if the hook is where the crash occurs or if it's only the mods.

Menu scripts access classes?

It would seem you cannot use menu scripts that access persistent scripts/classes? Is there any way to have common logic I use for several mods available to menu scripts?

Issue when download BLT in-game

After finished the download of the new BLT version (BLT 1.06) and restart the game I have a crash to Desktop, the crash.log file point to this line
mods/base/req/localization.lua:10: bad argument #1 to 'pairs' (table expected, got no value)

I have no more data since I delete the folder and download the release from here.

Mods Installed:
Lobby layer Info
PocoHud
Reconnect to server
Driver's neck brace removed

Reserved word "type" used as a parameter

The function LNetwork:SendToPeersExcept() can't work as is.

This works:
function LNetwork:SendToPeersExcept(peer, type_prm, data)
[followed by according replacements]

Post require that works with pd2hook not being run with BLT

With pd2hook if you wanted to extend a function by running some code before or after a function call you could do the following:

--Additional colours to support UI elements for additional peers
orig_TweakData = orig_TweakData or {}
orig_TweakData.init = orig_TweakData.init or TweakData.init

function TweakData.init(self, ...)
    log("[TweakData] BLT log test")
    orig_TweakData.init(self, ...)
    --Logic here
end

The log and the logic do not execute with BLT. I am seeing no errors printed in console logs or crashlog related to this, I am getting a crash due to another script trying to access an array index that doesn't have any data as the one posted above was meant to have run by then.

What is the alternative with BLT? To explain the method shown, the original is stored in a reference variable and it's method replaced with my own logic that passes on any arguments(although there are none in this case) to the original method followed by running my own logic before/after.

NetworkGame hooks are not working

I am desperately trying to get the NetworkGame hooks ("OnEnteredLobby", "OnGameJoined", ...) to work, but they are just not calling anything.

Not even when I put some debug prints into the "mods/base/lua/NetworkGame.lua" file - not even that get's logged to the console...

Did Overkill change some stuff up over here?

I could really get a hold of a method:

  • Method that get's called once a client loads into a lobby (or in-game) for the client-side

Then I could trigger some variables from the server to the client over the LuaNetworking methods.

Mod-made global tables are not kept throughout the game

Hi! First of all, thanks for this hook :)
I'm trying to make a mod which requires a table to be initialized when the game is run, and the table to be kept for as long as the game is running. I've got an example here: https://github.com/thatguyfrombb/BLT-KeepTable-Test

In the log I can see that my table (bltKeepTable_data, a global) disappears when I exit a contract, either by quitting to menu or completing it succesfully. In the example I've used some simple static data (a string, "Hey, here's your data!") and is never modified by anything. Sadly, my mod (whenever it's done), will require the addition of dynamic data, so keeping it in a static file and loading it each time is not an option. I've also tried both keeping the table in LocalizationManager and creating the global table from LocalizationManager:init(), checking first if it did exist so I didn't overwrite it. In those two cases, I got rid of the persist script, but the result is exactly the same.

I'm not sure if it's me doing anything wrong or if there's any other way to do this, but I've tried everything I could think of, so I'm coming straight to you guys :)

Crash in mid game

Sometimes when playing Watchdogs or Alesso, the game will automactly crash for no reason, as i try looking for the problem of why is that happening, i found that the problem comes from the base folder, a lua called delayed_calls.lua, i dont if this also happen to some other people but this happen to me twice the amount when playing some random maps, i also try playing without mods and just leaving BLT alone and it still crashes randomly, this is the crash log.

Application has crashed: C++ exception
mods/base/req/delayed_calls.lua:23: attempt to call field 'functionCall' (a nil value)

SCRIPT STACK


Callstack:

     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 

Current thread: Main


System information:
Application version : 1.42.0
CPU : Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz (4 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
DirectX : 10.0
GPU : NVIDIA GeForce GTX 750 Ti / nvd3dum.dll[10.18.13.5598]
Language : @ID94cca2fdaccfc2cd@
Memory : 48175 0MB
OS : 6.1.7601 (Service Pack 1) 0x300-0x1 (64 bits)
Physics : threaded
Renderer : DX9 threaded
Sound : Microsoft (Altavoces (USB Audio Device))

Adding integrity checking to downloaded contents

I'm experiencing an issue where the mod's update pack is not complete. Probably it's better to verify mod updates / downloaded zip file with MD5 or SHA1. Also, as far as I see in the HTTP code, it does not check HTTP response code. If the connection is aborted mid way, it could result in a broken zip file - extracting which to mods dir will lead to a black screen the next time game starts.

Goonmod "mod options" menu empty

It goes like this: main menu>options>mod options>blank

I have tried reinstalling both BLT and Goonmod with no success. Please note that I have no other mods installed. Any help would be appreciated.

BLT mods not receiving automatic updates

I've only recently come across this problem, and I've been struggling to find any solutions, as no one else seems to be having the same issues. Basically, none of the BLT mods I have installed (Newbies go back to overkill, Goonmod, Better Bots) have been auto-updating. It was never an issue in the past, I always received automatic updates from them when I went to the main menu, but as of late, none of the mods that are capable of receiving automatic updates have been able to do so. When I try to click update from the mod menu, the BLT console reads:

Launching Async HTTP Thread
[Error] Could not connect to PaydayMods.com API!

I've tried uninstalling and reinstalling BLT, verifying game cache, uninstalling individual mods, but I'm still getting the same results. Can anyone help with this issue?

Game crashing while using BTL and Dualshock 4

I'm using sony dualshock 4 controller with ds4tool to play Payday 2. But when i install BTL game start crashing when loading the heist. I have tried to delete save000.sav in userdata folder - no luck...

Maybe, the problem is in microsoft visual c++ file which is reqired to instal both on BLT and ds4tool?

FATAL ERROR: mods/base/req/json-1.0.lua:212: Failed to scan constant from string {... [r14]

Console and log file is getting filled with

FATAL ERROR: mods/base/req/json-1.0.lua:212: Failed to scan constant from string {... 
Lua: Found a json error, attempting to use old json loader!

...error messages for every mod installed. This issue was not present in the version prior to r14. The mods still work, but the console and log file is getting filled with the error messages and json file contents of every mod installed.

Sample log file with the above-mentioned issue:
2017_04_29_log.txt

Keybinds not working

I've set up a basic keybind script following the documentation here: http://payday-2-blt-docs.readthedocs.org/en/latest/mods/definition/ . When I run the game and go to Mods Keybinds I see my keybind prefixed with Error:, the same applies to the description. I click the keybind to set a key and get a warning ERROR, Key "mouse 0" is already mapped to "Fire Weapon". please remap it first. I'm not even given a chance to wait for input and provide a key,I can also hover over it and press enter and it sets enter. I have all other mods disabled and restarted, no idea why this is happening.

mod.txt:

{
  "name": "Get My Peer ID",
  "description": "Prints local peer id to console via keybind.",
  "author": "Polarathene",
  "contact": "[email protected]",
  "version": "1.0",
  "updates": [
    {
      "revision": 1,
      "identifier": "bkin_getid"
    }
  ],
  "keybinds": [
    {
      "keybind_id": "bkin_getid-1",
      "name": "Print Peer ID to Console",
      "description": "Prints local peer id to console via keybind.",
      "script_path": "getid.lua",
      "run_in_menu": true,
      "run_in_game": true
    }
  ]
}

getid.lua:

local me = managers.network:session():local_peer()
log("My Peer ID is: " .. tostring(me:id()) .. ", and my name is: " .. tostring(me:name()) .. "\n")

Issues after using multiple scripts

Hi,

There is a bug that ruins the easy drag & drop way of using scripts. After a certain amount of scripts, some of them don't work properly anymore. For example, after about 15 seperated scripts, the character blocker script didn't work correctly anymore. It stopped working on clients, only bots were affected. The way of solving the problem was merging multiple mods into an extra folder until I had 15 seperated folders left, so dragging & dropping into the mods folder is not working for me anymore. The script itself works fine if the amount of seperate scripts is below the threshold. Basically, the steps to reproduce the problem are to get over 15 seperate scripts with the character blocker script installed. I guess that there are other scripts that are affected too. You can find the script here: http://www.mediafire.com/download/n15p9dn4wzl9bl0/Character+Blocker+BLT.zip
scriptmenu

Net:SendToPeer not working

Have been working with the network features(great idea using hidden chat channel btw!). The message pops up on the console of peer I was testing this with, but it did not trigger the event code to run. However with Net:SendToPeers() where all peers get it, it runs the logic on their end as intended. I've also tried Net:SendToPeersExcept() with success. The following appears on the peers console: [4] Pola: GNSP/2/client_on_join_request_reply/["join_request_reply",1,2,"spanish",27,3,2,"bodhi","76561198052399869","standalone",9,1,0,0,""]

--jdata = table of json encoded parameters as a string prints:
--["join_request_reply",1,2,"spanish",27,3,2,"bodhi","76561198052399869","standalone",9,1,0,0,""]
--encoded like: json.encode({ "join_request_reply", 1, new_peer_id, character, level_index, difficulty_index, 2, data.local_peer:character(), my_user_id, Global.game_settings.mission, job_id_index, job_stage, alternative_job_stage, interupt_job_stage_level_index, server_xuid})

--Works
Net:SendToPeers("client_on_join_request_reply", jdata)

--Doesn't work
Net:SendToPeer(2, "client_on_join_request_reply", jdata)

--Works
local exclude = { 1, 3, 4 }
Net:SendToPeersExcept( exclude, "client_on_join_request_reply", jdata )

Seems for now I'll have to recreate the table to exclude the peer number each time I send this event/data, the 2 is usually dynamic, but I've done the testing with hardcoded 2 to make sure that the number was correct.

I think I've done a simple test with a basic string and still had the same issue, not sure if it's related to when I'm using it which is to deal with players joining as you might have guessed. The other two work though so wouldn't think that to be the cause.

Game needs restart after finishing a heist/leaving a lobby

After completing a heist and leaving the lobby, crime.net is blank with no server availble to join.
Issue can sometimes occur after being kicked by the host or simply leaving the lobby
The following line can be found in logs:
FATAL ERROR: [string "lib/network/base/networkpeer.lua"]:959: attempt to index a nil value
The line is repeated until the game is closed
mods used: Pocohud, Goonmod

Dev Console Suggestion

I would suggest make a option to be loaded from mod.txt

This way a developer can easily switch it on/off as they want for development.

Ignore update check on launch feature doesn't work.

Title pretty much says it all. If I go to the update manager then un-check one of my mods that I don't want to check for an update every time, it still checks for it and prompts me every time to update.

Allow setting Priority for JSON menu's

Currently you can not set a priority in any way for JSON menu's

It would be nice to set Priority not only for the items in a menu so that you can organize them with coded and other json menu's. It would be nice to set the priority for the menu itself in its parent

{
    "menu_id" : "json_example_menu",
    "parent_menu_id" : "lua_mod_options_menu",
    "title" : "my_custom_menu",
    "description" : "my_custom_menu_desc",
    "priority" : 4,
    "items" : [
    {
        "type" : "toggle",
        "id" : "json_menu_toggle",
        "title" : "json_item_toggle",
        "description" : "json_item_toggle_desc",
        "callback" : "callback_test_toggle",
        "value" : "toggle_value",
        "default_value" : false,
        "priority" : 10
    }
    ]
}

In this example the first priority would be set for the AddMenuItem for adding this new menu to its parent

Then the ones for the items would be set well for them in their menu

Lua: load, loadfile, loadstring, and dofile implementations

The lua functions load, loadfile, and loadstring are all currently set to nil, making it impossible to set the environment of any lua file that are being loaded.

Also, when calling dofile(), it does not return any of the values that the chunk returned, making it harder to pass vaules between files.

The problem with this is when trying to load other lua files under a common environment, to prevent contamination of the global environment, while still making it easy to pass values between files.

Suggestion: Allow Keybindings to Overlap

I think it would be a good idea to add in an option for keybindings in the specific mod's menu and mod keybinds menu in case we want a script to be activated with [F] along with using [F] for shout/interact.

download page timeout

I wanted to get BLT to load in HUDs, but every time I try to download it the page times out.

Split LUA code in to a separate repository.

As it stands there are currently three BLT Loaders. One is for Windows, and two are for Linux.

  • JamesWilko/Payday-2-BLT - The Original BLT, for Windows
  • Ozymandias117/Payday-2-BLT (branch: linux-work) - The Original BLT, Linux Port (same old code)
  • RomanHargrave/blt4l - Fresh BLT-Compatible Re-implementation (a lot of similar code), All platform code written for Linux rather than ported.

All of these support the same mods, and have the same LUA API. Since the LUA API is, for the most part, platform agnostic, it would be nice to move it to a separate repository so that anyone using it can depend on it as a submodule without pulling in the BLT loader.

This has the advantage of insuring that any BLT loader is using the same code as any other, and allowing for contributions of any BLT loader to the LUA base to benefit the rest.

Error Reporting

So, maybe I'm just missing something extremely obvious here, but it seems to me that BLT does absolutely no error reporting whatsoever when it encounters Lua errors, it just stops dead in it's tracks.

This has made me waste a whole hell of a lot of hours trying to find stupid errors such as syntax goofs and mistyped functions. As someone who's jumping into PAYDAY 2 modding for the first time and reading/learning the Lua structure, this is an extremely huge barrier to entry IMO and should be addressed in some fashion.

In the vein hope to get some error reporting, I wrapped a lot of things in pcall() as I wrote them to help me find issues, but even that just seems to give me errors whenever it feels like it, doesn't seem to be any consistency to it whatsoever.

Hopefully I don't sound like I'm ragging on the hook too much, because besides that and another issue I will post later, the hook is great and is very stable and has a good API behind it.

Oh, and I should probably mention that this is all on the current release hook, working on Update 78 (since I refuse to touch anything past that for the moment)

"mods/base/lua/MenuManager.lua:155: table index is nil" crash when accessing Options » Lua Mods after reinstalling previously removed mod

I have recently installed a mod (put its folder in the '\PAYDAY 2\mods' directory) after previously disabling it, and then removing it from the 'mods' folder afterwards (prior to version r14).

After I've installed the mod, when I go to Options » Lua Mods, the game crashes with crash.txt log:

Application has crashed: C++ exception
mods/base/lua/MenuManager.lua:155: table index is nil

I've looked at that file, and it's this part of function ModMenuCreator.create_lua_mods_menu:

if not _hooks[ hook ] then
	hooks_str = hooks_str .. "    " .. tostring(hook) .. "\n"
	_hooks[ hook ] = true
end

It crashes in the _hooks[ hook ] = true line. I fixed it by modifying the code above to:

if hook and not _hooks[ hook ] then -- added check for 'hook' variable
	hooks_str = hooks_str .. "    " .. tostring(hook) .. "\n"
	_hooks[ hook ] = true
end

... which allowed me to access Options » Lua Mods without crashing.

Crash issue related to PocoHud

I know this isn't BLT-specific, but I'm listing it for completeness' sake. Crashed out of nowhere. Got the following crash report:


Application has crashed: C++ exception
mods/PocoHud3/poco/Hud3.lua:150: attempt to index a nil value

SCRIPT STACK


Callstack:

     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 

Current thread: Main


System information:
Application version : 1.41.6
CPU : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (4 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
DirectX : 10.0
GPU : NVIDIA GeForce GTX 780 / nvd3dum.dll[10.18.13.5560]
Language : @ID94cca2fdaccfc2cd@
Memory : 416321 0MB
OS : 6.1.7601 (Service Pack 1) 0x100-0x1 (64 bits)
Physics : threaded
Renderer : DX9 threaded

Sound : CREATIVE (Speakers (Sound Blaster Audigy Fx))

What's in there is a simple function that I'm not really clear on the... Function of:

function TPocoHud3:AddDmgPopByUnit(sender,unit,offset,damage,death,head,dmgType)
if unit and alive(unit) then
local isPlayer = unit:base().upgrade_value
if not isPlayer then -- this filters PlayerDrama related events out when hosting a game
self:AddDmgPop(sender,self:_pos(unit),unit,offset,damage,death,head,dmgType)
end
end
end

Crashing in the loadout screen while entering a heist

Whenever I try to host The Diamond, I get the following crash when playing online:

Application has crashed: access violation

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
                      IPHLPAPI  (???)     ???                                                 
                      IPHLPAPI  (???)     register_icmp                                       
                      IPHLPAPI  (???)     register_icmp                                       
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
                    KERNELBASE  (???)     SleepEx                                             
         payday2_win32_release  (???)     ???                                                 
                    KERNELBASE  (???)     WaitForSingleObjectEx                               


-------------------------------

Current thread: Main
Script stack:
     _load_continent_package()  core/lib/utils/dev/editor/coreworlddefinition.lua:163  
           _insert_instances()  core/lib/utils/dev/editor/coreworlddefinition.lua:266  
            parse_continents()  core/lib/utils/dev/editor/coreworlddefinition.lua:254  
                        init()  core/lib/utils/dev/editor/coreworlddefinition.lua:40  
                        init()  lib/utils/dev/editor/worlddefinition.lua:6          
                         new()  core/lib/utils/coreclass.lua:35                     
                        init()  core/lib/utils/dev/editor/worldholder.lua:49        
                         new()  core/lib/utils/coreclass.lua:35                     
                   init_game()  lib/setups/gamesetup.lua:428                        
                                core/lib/setups/coresetup.lua:388                   
                            ()  =(tail                                              
                      call):-1  
-------------------------------

System information:
    Application version : 1.39.8
    CPU : Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz (4 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 10.0 
    GPU : AMD Radeon HD 6900 Series / aticfx32.dll[8.17.10.1333]
    Language : @ID94cca2fdaccfc2cd@
    Memory :     48172    0MB
    OS : 6.1.7601 (Service Pack 1) 0x100-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Realtek Semiconductor Corp. (Speakers (Realtek High Definition Audio))

When I play offline, I get the following crash instead:

Application has crashed: access violation

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 


-------------------------------

Current thread: Main
Script stack:
            _on_peer_removed()  lib/network/base/basenetworksession.lua:426         
            _on_peer_removed()  @mods/base/lua/BaseNetworkSession.lua:20            
                 remove_peer()  lib/network/base/basenetworksession.lua:315         
                 remove_peer()  lib/network/base/hostnetworksession.lua:514         
    on_join_request_received()  lib/network/base/session_states/hoststateingame.lua:63  
    on_join_request_received()  lib/network/base/hostnetworksession.lua:55          
                                lib/network/base/handlers/connectionnetworkhandler.lua:50  

-------------------------------

System information:
    Application version : 1.39.8
    CPU : Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz (4 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 10.0 
    GPU : AMD Radeon HD 6900 Series / aticfx32.dll[8.17.10.1333]
    Language : @ID94cca2fdaccfc2cd@
    Memory :     48172    0MB
    OS : 6.1.7601 (Service Pack 1) 0x100-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Realtek Semiconductor Corp. (Speakers (Realtek High Definition Audio))

Additionally, I get the following fatal error in my logs:
05:00:17 PM FATAL ERROR: [string "lib/managers/menu/menulobbyrenderer.lua"]:285: attempt to index local 'slot' (a nil value)

I have completely removed all other mods, and I have the correct Visual C++ 2013 Redistributable. It's just the base BLT Hook and the "base" mod that's installed.

Require statement

I'm migrating a mod from pd2hook to BLT where many scripts require another one that isn't a class but more like a json object with a bit of logic. This doesn't seem to work though, whenever running a keybind script that uses any of the required scripts the game crashes. I've tested a simple one in a mods folder called custom, however nothing seems to work. I've tried the following:

mods/custom/script
custom/script
script
each again but with the .lua extension suggested by someone else

There is no documentation on this type of statement with the BLT docs. It works perfectly with pd2hook and is a native lua feature, so I'm not sure what I'm doing wrong.

Game crashing when posting certain strings to in-game chat

Any time I post a message in the lobby or in-game containing a Percentage Sign ('%') followed by a single digit integer, the game crashes to the desktop. This was tested with no mods enabled aside from Payday 2 BLT, in order to ensure that BLT was at fault, as well as without BLT installed at all. In the first case, the game crashes when posting messages to chat, while in the second, the message is sent successfully and the game does not crash.

The crash.txt and crashlog.txt (which includes large amounts of data from other crashes) from one of my tests are available for your review.

I am unsure if this is capable of crashing other clients as well, or if it is restricted to the player.

It may be an issue with the game attempting to parse % as the modulo operator.

Is there a way to use BLT to call native methods?

TL;DR: I'm looking into calling some native methods via exposed C API. I'd like to provide a library/dll file that I can call into from Lua. Would the BLT hook be a way to go about this?


The existing FFI solutions I've glazed over is difficult to tell if I can release binaries that users don't have to compile/install beyond drag/drop to PD2 directory.

Besides those two options, I guess I could also do a local web server to redirect to my native code, but if I can't automate that running when PD2 is it's probably inconvenient for users too.

I'm wanting to reduce maintenance of my BigLobby project by avoiding the pdmod which breaks with most game updates. I've looked into how PD2 is handling network packets which is UDP via SteamWorks, packets are identified by an id incremented by message elements in the network.network_settings XML which I currently patch, so a proxy server that manipulates the packets isn't going to work either.

I did try BLTs network message feature early on in my project but it proved unreliable at delivering messages effectively from memory. Does the way BLT work with it's hook make it possible to call native code from another library easily if that's also provided as a DLL(either through BLT or using the same technique)?

A space in mod identifier can block the update of other mods

An mod identifier containing a space will prevent the update of all the mods after it.
A friend had the problem with this mod (unregistered?).

A simple fix can be:

function LuaModUpdates:FetchUpdatesFromAPI( path, callback )
    path = path:gsub(" ", "%%20")
    dohttpreq( path, function( data, id )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.