PAYDAY 2

PAYDAY 2

View Stats:
 This topic has been pinned, so it's probably important
Diesel Engine 3.0 for Modders
With Diesel 3.0, quite a lot of things have changed that is relevant to modders.
Below you can find a (hopefully) detailed list on what's changed and how to update your mods, this is mostly targetted at mod developers, mod users should await updates to any mod that has been broken.
This post will update from time to time as more stuff becomes written up towards the full release.

General changes
  • DB:create_entry now accepts multiple assets at once with the format
    DB:create_entry({ { name="assets/units/my_unit", type"unit", path="mods/mymod/assets/units/my_unit", properties={} }, ... })
  • ScriptFiles opened with "DB:open" can be read more than once by using "file:set_position(0)", their current read position and size can now also be retrieved with "file:position()" and "file:size()" respectively
  • Mods that made many HTTP requests should see a boost as now the engine handles more than one at once

New Lua functions
  • Functions to load/reload shader databases and render template databases have been added, they are "RenderDevice:load_shader_database/reload_shader_database(Idstring('...'))" and "RenderDevice:load_render_template_database/reload_render_template_database(Idstring('...'))" respectively

Some helper functions have been added to NetworkManager.lua to make it safer to use some session functions without needing to manually check if the session exists (the helper functions will check for this). Here's some examples:
  • managers.network:session():send_to_peers(...) ---> managers.network:send_to_peers(...)
  • managers.network:session():peer(peer_id) ---> managers.network:get_peer_safe(peer_id)

Crates and Asset Packaging
Crates are one of the biggest changes in v3 as they provide de-duplication for assets and compression for them.
Those worried about Diesel Bundle Viewer (the community tool to read .bundle files) not supporting the format: we have provided an official "Crate Browser" that can extract from the new format here: https://modworkshop.net/mod/57750

A benefit of crates over the old "Package Bundle" system is that packages now no-longer need to be loaded in order to access files inside of them, which is particularly beneficial to custom map makers.
Custom maps that loaded packages from existing base game maps to access units can now write their own ".package" XML file, add it to the game with DB:create_entry, call PackageManager:load on it as your would've the base game package and it will load units and other assets included just fine.

Distribution
We have moved all of our platform interfaces like Steam and EpicMM into two generic interfaces called "Distribution" and "DistributionMatchmaking".
Code written with Distribution is platform agnostic will never break between users playing on Steam and Epic.

At the moment, all mods should continue to function as we've integrated a wrapper for the old "Steam" name inside the game's lua in the file "lib/utils/distributionwrapper".
However there is one exception, mods using "Steam:lobby(lobby_id)" will break and throw an error as "DistributionMatchmaking:lobby_from_id( lobby_id, from_server_browser, function(lobby, result, intended_lobby_id) end )" is the replacement.
It is strongly recommended that you use that wrapper as reference to migrate your mods to the new system.

Architecture Dependant Assets
Below are the assets that have changed based on architecture, automatic converters have been written that happen as part of SuperBLT so they continue to work without needing to upgrade them yourself.
  • Animations
  • Font mods
  • ScriptData/Binary XML
  • Massunits

[h4]Animation changes[/h4]
The zlib compression embedded within animation files has also been removed, the SuperBLT for Diesel 3.0 currently has decompression automated for mods created prior to this change.

Audio Mods
Mods that replace .stream files to modify audio will continue to work fine.
Mods that replace soundbanks will have unfortunately broken due to us moving to Wwise 2022, there is currently an automatic converter created by a community member integrated into SuperBLT so that existing mods continue to work fine.

Units
Units received one minor changed in Diesel 3.0 as the "pre_destroy" function on Unit extensions is now called by the engine and should no longer be called by Lua.
< >
Showing 1-15 of 15 comments
hopefully this doesn't break SuperBLT
Originally posted by hard drugs often:
hopefully this doesn't break SuperBLT
clueless
i tried to do superblt but its wont popup it just run straight game, anyone here have same problem ?

sry my english is sec language
does the original LuaJIT still work?
Originally posted by FurToField:
i tried to do superblt but its wont popup it just run straight game, anyone here have same problem ?

sry my english is sec language
yep, superblt is broken right now
"we have provided an official "Crate Browser" that can extract from the new format" Goated :tongue:
self made packages (and 64bits for that matter) would have made Broken Arrow so much more stable if it was there in 2019

glad to see it's finally a thing tho
So, when can we expect a playable version of BLT? Can we sign in for beta testing the new BLT and bug report?
this shi is definitely gonna break so many of my mods oh God
Originally posted by ɪɴᴛᴇʀʟᴏᴘᴇʀ:
So, when can we expect a playable version of BLT? Can we sign in for beta testing the new BLT and bug report?

the dev version of SuperBLT was updated on 1st of July, but there hasn't been a release yet
hopefully soon though
Thanks for the update especially on audio mods as I make a large number of those.
Originally posted by ɪɴᴛᴇʀʟᴏᴘᴇʀ:
So, when can we expect a playable version of BLT? Can we sign in for beta testing the new BLT and bug report?

https://modworkshop.net/mod/58342
there is a beta available since 2 days ago.
so basically best idea. wait tell about a week after launch. then time to update mods and for modders ? cause the ai team mates are on better bots level on by default XD
Originally posted by Wolf Darkrose:
so basically best idea. wait tell about a week after launch. then time to update mods and for modders ? cause the ai team mates are on better bots level on by default XD
My plan is to wait until SuperBLT is out of beta and into the main branch before I make the switch. Unfortunately, I don't think TDLQ's great mods are going to be updated for V3 which sucks.
< >
Showing 1-15 of 15 comments
Per page: 1530 50