How exactly do monster drops work? I’m working on a mod and trying to include an enemy based off of a Touhou character.
Under monster_drops.json I have this:
{
“type” : “item_group”,
“id” : “moonrabbit_drops”,
“items”:[
[“lunar_rifle”, 3],
[“bra”, 1],
[“panties”, 1],
[“dress_shirt”, 1],
[“suit_reisen”, 1],
[“skirt”, 1],
[“lunar_helmet”, 1],
[“dress_shoes”, 1],
[“stockings”, 1]
]
}
And under monsters.json I have this part:
“death_drops”: {
“subtype”: “collection”,
“groups”: [
[ “moonrabbit_drops”, 40 ]
]
},
What exactly do the numbers mean? I kinda used existing code as a template, but don’t really know what it means.
Also, how does text formatting for code work on this new forum? It seemed to work better on the old forums, and the old forums didn’t mangle the spacing in my code.
I’m fairly sure the numbers are percentage chance for the item to spawn, so your monster has a 40% chance to spawn a single item from the drop list. If an item is spawned the specific item it’ll be is determined semi randomly, with those with a higher number (again, percentage chance) being more likely.
In the following example the Zombie Grenadier will always drop items from two groups, and will always drop a (slightly to severely damaged) chest rig, 0 - 3 manhacks, and has a 50% chance to drop a flashbang hack and another 50% chance to drop a teargas hack, from the “mon_zombie_grenadier” group.
The zombie’s death drops:
"death_drops": {
"subtype": "collection",
"groups": [
[ "mon_zombie_soldier_death_drops", 100 ],
[ "mon_zombie_grenadier", 100 ]
]
},
The “mon_zombie_grenadier” item group:
{
"type" : "item_group",
"subtype": "collection",
"id": "mon_zombie_grenadier",
"entries":
[
{ "item": "chestrig", "damage": [1, 4] },
{ "item": "bot_grenade_hack", "count": [0, 3] },
{ "item": "bot_flashbang_hack", "prob": 50},
{ "item": "bot_gasbomb_hack", "prob": 50}
]
},
I hope this helps!
1 Like