LootGenerator is a local application to handle Gun and Lootsplosion generation in the Nerdvana TTRPG, Bunkers & Badasses. Additionally, it includes transcribed roll tables from the source book for all item types in the game.
Currently this program is a PyQT GUI application in which the user can specify specific gun attributes to roll with.
Fig 1. Front view of the 2-Sided Gun Card.
Fig 2. Back/Details view of the 2-Sided Gun Card.
Fig 3. Front/Back of a printed card.
The local version of this application requires a PDFViewer capable of form/annotation rendering in order to view the generated text on the Gun Card. PDF Viewers are all over the place when it comes to support for this and it cannot be guaranteed LootGenerator will work with a given viewer. Alternative solutions were tried for rendering (e.g. pdf2image conversion, pdfjs, local chromium server), but no universal solution works. Without a full rewrite, this solution will have to suffice for now. We apologize for the inconvenience!
Here is a list of ones that work and don't work thus far from personal testing. Please put up an issue if you use one of the untested versions!
Working: Acrobat Reader DC,
Not Working: Foxit PDF (under Safe Mode), Browser PDFs (Brave, Chromium, etc), MacOS
Untested: Slim Reader, Nitro Reader, PDF Viewer Pro, Xodo PDF Reader, ...
The default size of the output Gun PDFs will be rather large (e.g., 40MB). This is due to how layer stacking is performed in the PDF graph. We resolve this using the Python library pikepdf, based on the application QPDF. Compression is done automatically when generating.
If compression fails for any reason, the original (large size) PDF should still exist in your outputs folder. A message will alert you stating that pikepdf failed to compress.
Fig 4. Compression gained by pikepdf/QPDF.
This LootGenerator has support for outputting files to import into Eronth's
BnB FoundryVTT system!
There is a checkbox in the program that outputs a .JSON file that the Import Data
function on Items recognizes.
The files are stored in api/foundryVTT/outputs/
.
Fig 5. Process of importing items into FoundryVTT.
BnB-LootGenerator/
│
├── main.py - Entrypoint for the PyQT local application
├── requirements - Automatically installs needed pypi packages
│
├── api/
│ └── foundryVTT/ - FoundryVTT folder and output files
├── app/
│ ├── GunTab.py - PyQt tab dedicated to Gun display
│ └── ... - Tabs for relics, shields, etc.
├── classes/
│ ├── Gun.py - Gun generation script
│ ├── GunImage.py - Image filtering script
│ ├── GunPDF.py - PDF generation script
│ └── ... - Other items follow the same scheme
├── output/
│ ├── grenades/ - Folder to hold generated grenades
│ └── ... - Other folders for other items
├── resources/
│ ├── chests/ - Tables for chests, caches, etc
│ ├── elements/ - Tables for element rolling
│ ├── guns/ - Tables dedicated to gun generation
│ ├── images/ - Tables that have URL PNG links to gun art from all Borderland games
│ └── misc/ - Holds the tables for misc objects (shields, grenades, etc)
│── tests/
└────
LootGenerator allows for easily adding customized rules/mods to expand the generation options. As the generation script dynamically parses the JSON files on runtime, one just needs to add a new item to the relevant JSON file in the resources/ folder.
- Elements (Type/Rolling Tiers)
- Guilds
- Gun Types
- Gun Stats
- Gun Prefixes
- Gun Images
- Red Text Mods
For example, to add a new Guild, add a new JSON item to the "resources/guild.json" file in line to the attributes of the others.
Adding an item to the JSON:
There are still a number of features in the works of being implemented. This includes the primary goal of outputting full loot generation tables for encounters given a Badass Rank or type of Container (cache, disk chest, etc).
These are the components to be fleshed out yet (we're welcome to take contributions for these!):
- Containers: Roll tables for cache, cache size, dice chests, and unassuming chests need to be input. As well, a class that handles rolling and providing function calls to relevant classes is needed.
It is a common occurance that anti-viruses mistakenly flag Python executable programs that were compiled with PyInstaller as malicious software. We have applied for detection reviews for a number of these companies in order to get whitelisted. More information on this can be found here.
Please feel free to put up any issues that are found or enhancements that would improve this work. As well, please feel welcome to put up PRs for any improvements that you can do!
The alternative damage balancing sheets are homebrew systems provided with permission by other community members.
Here are the direct links to their works:
This tool is an unofficial automated tool for the Nerdvana TTRPG, Bunkers & Badasses.
Gun art images are used from the Borderlands Lootlemon and images displayed are URL links to their hosted images.
All credit for source material and gun images belongs to Nerdvana and GearBox Software.
The chest design in our icon comes from Victor Escorsin, available here.
This icon is available as a sample icon on Adobe Spark's Logo Maker under the CC License.