Skip to content

added LootableRandom tag - #8

Open
shadoxxhd wants to merge 2 commits into
BattletechModders:masterfrom
shadoxxhd:LootableRandom
Open

added LootableRandom tag#8
shadoxxhd wants to merge 2 commits into
BattletechModders:masterfrom
shadoxxhd:LootableRandom

Conversation

@shadoxxhd

Copy link
Copy Markdown

Adds LootableRandom tag, allowing drops to be randomized:

"LootableRandom": {
      "Options": [
        {
          "ItemID": "Gear_HeatSink_Single",
          "Weight": 1.0
        },
        {
          "ItemID": "Gear_Cooling_Pod_x1",
          "Weight": 0.05
        }
      ]
    }

If "no_salvage" is set, it chooses a random option to drop instead of the original item. The normal Lootable tag is ignored when LootableRandom is set and valid, otherwise it falls back to Lootable.

Weighting is linear (drop chance is proportional to weight - P(option) = weight(option)/sum(weights)).

Since one significant use case for LootableRandom is to add rare drops to items while still usually dropping the item itself, the "no_salvage" flag is ignored for the replacement item (both for Lootable and LootableRandom).
This behavior could technically be restricted to LootableRandom, keeping the "no_salvage" behavior of the normal Lootable tag, if desired - the question is whether to simplify the behavior, or keep backwards compatibility of rare "noop" edge cases.

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.

1 participant