Skip to content

Conversation

@sergioalmela
Copy link
Contributor

Add Optional Objectives Reward mod

Description

This PR adds a new mod that automatically rewards all optional objectives in Borderlands 2 and The Pre-Sequel with configurable scaling based on playthrough difficulty.

Mod Features

  • Automatic detection and rewarding of all optional objectives
  • Playthrough-based scaling (Normal/TVHM/UVHM)
  • Configurable via in-game sliders
  • Supports both BL2 and TPS

About

This is my very first Borderlands mod! As a web developer, I wanted to dive into the SDK modding scene and contribute something useful to the community. The mod scratches a personal itch I had about optional objectives feeling unrewarding, and I hope others find it useful too.

@apple1417
Copy link
Contributor

The pr looks good, but figured I'd point out the few small things I noticed first so you're aware/can fix them ahead of time

The main issue is that an option's on change handler is called even while the mod is disabled. A lot of people fall into this trap, it's arguably a bit of bad design, but it is behaviour you might need sometimes. In your case, it means even if the mod's disabled, dragging a slider will suddenly apply all it's changes. The fix is quite simple at least:

if not option.mod or not option.mod.is_enabled:
  return

The other thing I note is you don't have any disable logic. I haven't looked at how these objects work, or tested this in game, but I imagine if you're standing in front of a quest reward, then pause and disable the mod, the mod's changes will still apply. I don't know how feasible disabling really is, if you can't get it to work there's a RestartToDisable class you can have your mod use (build_mod(cls=RestartToDisable)), which just shows a small warning.

@sergioalmela
Copy link
Contributor Author

sergioalmela commented Dec 27, 2025

The pr looks good, but figured I'd point out the few small things I noticed first so you're aware/can fix them ahead of time

The main issue is that an option's on change handler is called even while the mod is disabled. A lot of people fall into this trap, it's arguably a bit of bad design, but it is behaviour you might need sometimes. In your case, it means even if the mod's disabled, dragging a slider will suddenly apply all it's changes. The fix is quite simple at least:

if not option.mod or not option.mod.is_enabled:
  return

The other thing I note is you don't have any disable logic. I haven't looked at how these objects work, or tested this in game, but I imagine if you're standing in front of a quest reward, then pause and disable the mod, the mod's changes will still apply. I don't know how feasible disabling really is, if you can't get it to work there's a RestartToDisable class you can have your mod use (build_mod(cls=RestartToDisable)), which just shows a small warning.

Hi, thanks for reviewing the code :) You are right, good catch. I thought the disable thing was controlled by the python SDK. I updated the code to handle it, you can review it 👍 .
Note: "disable mod" means that, since you disable it and until you restart, it will apply 0xp and 0 cash for every optional quest, which is the normal behaviour I think, from the missions I checked in the explorer. I think that's enough, but I'm not fully happy since I'd impact in other mods that modify that optional quests if you disable the mod while playing.
The "best" option would be to cache everything and reapply on disable, but I guess that's too complex for now.

BTW, if someone wants to check the mod, the easiest way is to create a lv 30 character and do the don't get fooled mission in sanctuary.

@apple1417 apple1417 merged commit 8f26a7d into bl-sdk:master Dec 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants