Author Topic: Need Help Adding Items to Merchant Inventory or Enemy Loot Table  (Read 4834 times)

RJ Mayhem

  • Founder
  • Named
  • **
  • Posts: 142
  • Karma: 5
Hello

It's been a LONG time since I've used Reanimator. Need some help adding items to Merchant Inventory or To the drop table of an enemy.

Thanks!
« Last Edit: Sep 04, 2023; 02:07 am by RJ Mayhem »
HGG IGN
Jenara = 55/50 Engineer
Demonita = 55/50 Summoner
Gunard = 55/50 Guardian
Nonny = 50/3 Blademaster

Bryan

  • Tactical Happenstance
  • Administrator
  • Great Eye / First
  • *****
  • Posts: 3031
  • Karma: 54
I haven't dealt with merchant inventories, and I hear our file structure is rather different from Reanimator's. Still, I might be able to help with monster loot tables.

You'll need to work across 3 tables for this process, and modify 2; items (used for name reference), monsters (assigning new loot tables to specific enemies), and treasure (creating new loot tables).
Each monster in the monsters table should have a few fields related to its loot:
  • treasure, which defines usual loot
  • champion treasure, being the loot it drops if it spawns as a Champion (eg if tweaking a white monster's table, white variants will drop the above while Champion versions will drop this one)
  • first-time treasure, being the loot it drops on the first kill (which tends to be the same as regular loot except for some bosses)
These loot tables can be found in the treasures table. They also have other settings there, depending on how complex or specific you want to make the table (eg drop rates vs standard drops and so on).
So the process should be along the following lines:
  • Create a new treasure table row (copy-pasting an existing one that's close to your intended new one tends to work best, since it'll also have all loot-based settings in place). Name this row something recognizable - for this example we'll go for X.
  • Refer to the items table for desired item names(/types, depending on what you want to do), and add them to the new X row's contents.
  • As an optional step, tweak row X's other settings, like whether it should pick some items or drop them all, drop chances, and so on.
  • In the monsters table, add your new X treasure to the relevant fields above.
If you're looking for something simpler, like just adding a specific item to a specific boss's table as a standard drop, it could be as simple as a treasure table tweak. You'd need to check the monsters table to see if your boss in question has a unique treasure table (and not, say, a generic boss table shared with others). If it does, just look up your desired item's name in the items table, and add it to the treasure table that your boss is using.

Hope this helps.
"Dream big and crash often"
-Omerta

List of Global class guides.
The above guides may be obsolete for vanilla SP, but they may still hold true for the 2018 Steam version.

RJ Mayhem

  • Founder
  • Named
  • **
  • Posts: 142
  • Karma: 5
I haven't dealt with merchant inventories, and I hear our file structure is rather different from Reanimator's. Still, I might be able to help with monster loot tables.

You'll need to work across 3 tables for this process, and modify 2; items (used for name reference), monsters (assigning new loot tables to specific enemies), and treasure (creating new loot tables).
Each monster in the monsters table should have a few fields related to its loot:
  • treasure, which defines usual loot
  • champion treasure, being the loot it drops if it spawns as a Champion (eg if tweaking a white monster's table, white variants will drop the above while Champion versions will drop this one)
  • first-time treasure, being the loot it drops on the first kill (which tends to be the same as regular loot except for some bosses)
These loot tables can be found in the treasures table. They also have other settings there, depending on how complex or specific you want to make the table (eg drop rates vs standard drops and so on).
So the process should be along the following lines:
  • Create a new treasure table row (copy-pasting an existing one that's close to your intended new one tends to work best, since it'll also have all loot-based settings in place). Name this row something recognizable - for this example we'll go for X.
  • Refer to the items table for desired item names(/types, depending on what you want to do), and add them to the new X row's contents.
  • As an optional step, tweak row X's other settings, like whether it should pick some items or drop them all, drop chances, and so on.
  • In the monsters table, add your new X treasure to the relevant fields above.
If you're looking for something simpler, like just adding a specific item to a specific boss's table as a standard drop, it could be as simple as a treasure table tweak. You'd need to check the monsters table to see if your boss in question has a unique treasure table (and not, say, a generic boss table shared with others). If it does, just look up your desired item's name in the items table, and add it to the treasure table that your boss is using.

Hope this helps.

Thanks for the explanation. Still a little confused as I'm not getting the changes in game. Here's a example I'm using for testing. I added a BK Dye to the defaultmonsterloot. I changed a a 3;XXX to 2;BK Dye Index code. I'm trying to mod the Steam version so the index code might be different the the normal HGL. What am I doing that's not correct?
HGG IGN
Jenara = 55/50 Engineer
Demonita = 55/50 Summoner
Gunard = 55/50 Guardian
Nonny = 50/3 Blademaster

Bryan

  • Tactical Happenstance
  • Administrator
  • Great Eye / First
  • *****
  • Posts: 3031
  • Karma: 54
Hm, yeah... Index codes may complicate things. I don't deal in those at all, so I really can't comment on what can go wrong with them.
Since you mentioned BK though, that's an important note to make. Some items may have restrictions, such as level, theme, and so on. Some might even be set to not spawn, like BK does, so you'd need to be careful about how the treasure tables are calling them (and which enemies are using them).

My suggestion would be to start easier, using just treasures and monsters. Eg, assuming data is the same, you can locate the "pit_barron_dyekits" treasure; this is Moloch's roll for dyes. Here, you can copy-paste this row, tweak it (say, adjusting "nodrop" for drop rates or removing non-BK dyes), rename it (eg "pit_barron_dyekits_edit"), and then assign this new treasure to a unique enemy of your choice.

OR, you could directly add this new treasure row to an existing one (like defaultmonsterloot).
If you look at Moloch's treasure, the "parent" row is "pit_baron_treasure" which then flows into multiple sub-rows. This is phrased as "tc:name". So you could add a new subrow to defaultmonsterloot, phrased as "tc:pit_barron_dyekits_edit".
In both cases, just make sure to also add a number value in the column next to your new entry. If you add content to an empty field, its adjacent column (in my case "Value1", etc) would normally be empty - meaning the game has no number to roll your row for (either in amount of rolls or outcome chances).
"Dream big and crash often"
-Omerta

List of Global class guides.
The above guides may be obsolete for vanilla SP, but they may still hold true for the 2018 Steam version.

RJ Mayhem

  • Founder
  • Named
  • **
  • Posts: 142
  • Karma: 5
Hm, yeah... Index codes may complicate things. I don't deal in those at all, so I really can't comment on what can go wrong with them.
Since you mentioned BK though, that's an important note to make. Some items may have restrictions, such as level, theme, and so on. Some might even be set to not spawn, like BK does, so you'd need to be careful about how the treasure tables are calling them (and which enemies are using them).

My suggestion would be to start easier, using just treasures and monsters. Eg, assuming data is the same, you can locate the "pit_barron_dyekits" treasure; this is Moloch's roll for dyes. Here, you can copy-paste this row, tweak it (say, adjusting "nodrop" for drop rates or removing non-BK dyes), rename it (eg "pit_barron_dyekits_edit"), and then assign this new treasure to a unique enemy of your choice.

OR, you could directly add this new treasure row to an existing one (like defaultmonsterloot).
If you look at Moloch's treasure, the "parent" row is "pit_baron_treasure" which then flows into multiple sub-rows. This is phrased as "tc:name". So you could add a new subrow to defaultmonsterloot, phrased as "tc:pit_barron_dyekits_edit".
In both cases, just make sure to also add a number value in the column next to your new entry. If you add content to an empty field, its adjacent column (in my case "Value1", etc) would normally be empty - meaning the game has no number to roll your row for (either in amount of rolls or outcome chances).

Thank You, was able to figure out what I was doing wrong. Now just need to figure out how to add a Item to the Merchant.
HGG IGN
Jenara = 55/50 Engineer
Demonita = 55/50 Summoner
Gunard = 55/50 Guardian
Nonny = 50/3 Blademaster

Bryan

  • Tactical Happenstance
  • Administrator
  • Great Eye / First
  • *****
  • Posts: 3031
  • Karma: 54
At a glance, there's a tag in items that reads "unlimited_in_merchant_inventory = 1;". Guessing that's related.
What was going wrong with monster treasures before though? Could be of some use to fellow readers.
"Dream big and crash often"
-Omerta

List of Global class guides.
The above guides may be obsolete for vanilla SP, but they may still hold true for the 2018 Steam version.

RJ Mayhem

  • Founder
  • Named
  • **
  • Posts: 142
  • Karma: 5
At a glance, there's a tag in items that reads "unlimited_in_merchant_inventory = 1;". Guessing that's related.
What was going wrong with monster treasures before though? Could be of some use to fellow readers.


Things might be labeled differently in the steam reanimator &/or game files but I wasn't changing the "pickType" from "one" to "all". Which seems to tell the game to drop all the treasure in the row instead of one. I also increased the "value#" next to the "item#" which seemed to increase the chance for that item to drop. Increased the "noDrop" to make sure it drops.

Here's what I've tried and hasn't seemed to work. Using a item that's in the merchants inventory already. I copied the entries "bitmaskp1" spawnAtMerchant & "props1" SetStat669('unlimited_in_merchant_inventory', 1);. Added "buyPriceAdd" PriceXXX;. Loaded in game and the item isn't being sold.
HGG IGN
Jenara = 55/50 Engineer
Demonita = 55/50 Summoner
Gunard = 55/50 Guardian
Nonny = 50/3 Blademaster

Bryan

  • Tactical Happenstance
  • Administrator
  • Great Eye / First
  • *****
  • Posts: 3031
  • Karma: 54
Yeah, we might have different names across the versions. Still, these both apply; "pickType" determines whether one item in the row will be chosen or if all will, and the Value column is what I noted before:
In both cases, just make sure to also add a number value in the column next to your new entry. If you add content to an empty field, its adjacent column (in my case "Value1", etc) would normally be empty - meaning the game has no number to roll your row for (either in amount of rolls or outcome chances).
From what I know, if your PickType is 1:1 the values there will act as weights (ie chances among items in the row). If it's "all", then the value determines how many times that field's item will be produced.
And noDrop is essentially reverse drop chances, determining how often a row will not drop. So reducing that to 0 will guarantee drops.

The vendor part seems complicated though, so I'd need to do some proper digging to assist in any way there.
"Dream big and crash often"
-Omerta

List of Global class guides.
The above guides may be obsolete for vanilla SP, but they may still hold true for the 2018 Steam version.

RJ Mayhem

  • Founder
  • Named
  • **
  • Posts: 142
  • Karma: 5
Yeah, we might have different names across the versions. Still, these both apply; "pickType" determines whether one item in the row will be chosen or if all will, and the Value column is what I noted before:
In both cases, just make sure to also add a number value in the column next to your new entry. If you add content to an empty field, its adjacent column (in my case "Value1", etc) would normally be empty - meaning the game has no number to roll your row for (either in amount of rolls or outcome chances).
From what I know, if your PickType is 1:1 the values there will act as weights (ie chances among items in the row). If it's "all", then the value determines how many times that field's item will be produced.
And noDrop is essentially reverse drop chances, determining how often a row will not drop. So reducing that to 0 will guarantee drops.

The vendor part seems complicated though, so I'd need to do some proper digging to assist in any way there.

Thanks for all your help. I was able to add what I wanted to the drop table instead of the merchants.
HGG IGN
Jenara = 55/50 Engineer
Demonita = 55/50 Summoner
Gunard = 55/50 Guardian
Nonny = 50/3 Blademaster

Bryan

  • Tactical Happenstance
  • Administrator
  • Great Eye / First
  • *****
  • Posts: 3031
  • Karma: 54
Glad to have been able to help, really. Not the easiest thing in the world to translate my already limited knowledge to different tables, frankly.
But glad to hear it's worked out for you. :)
"Dream big and crash often"
-Omerta

List of Global class guides.
The above guides may be obsolete for vanilla SP, but they may still hold true for the 2018 Steam version.