In prefabs/monkey.lua, near the top of the file, a 'monkey' loot table is defined:
SetSharedLootTable( 'monkey', { {'smallmeat', 1.0}, {'cave_banana', 1.0}, {'nightmarefuel', 0.5}, })
Further down, in the SetNormalMonkey function, another loot table is created and added to non-shadow splumonkeys:
inst.components.lootdropper:SetLoot({"smallmeat", "cave_banana"}) inst.components.lootdropper.droppingchanceloot = false
The droppingchanceloot variable is used in an attempt to prevent the top table from being used, but this has no effect since this isn't the variable's purpose, resulting in non-shadow splumonkeys dropping twice as many morsels and cave bananas as they should, and also having a chance to drop nightmare fuel.
Shadow splumonkey loot works exactly as intended; only non-shadow splumonkeys have bugged loot.
The reason this bug doesn't cause non-shadow splumonkeys to drop beard hair is because beard hair is added separately in the SetNightmareMonkey function:
inst.components.lootdropper:SetLoot({"beardhair"})
This also prevents shadow splumonkeys from potentially dropping extra morsels and cave bananas as it overwrites the loot table used in the SetNormalMonkey function.
This bug is fixed in DST. I can not confirm whether or not this bug occurs in Shipwrecked or Hamlet as I do not have them.
I have a working fix that I've tested in the base game and RoG, that also makes the code easier to understand:
-
Replace lines 26-31
SetSharedLootTable( 'monkey', { {'smallmeat', 1.0}, {'cave_banana', 1.0}, {'nightmarefuel', 0.5}, })
with this:
SetSharedLootTable( 'monkey', { {'smallmeat', 1.0}, {'cave_banana', 1.0}, }) SetSharedLootTable( 'nightmaremonkey', { {'smallmeat', 1.0}, {'cave_banana', 1.0}, {'beardhair', 1.0}, {'nightmarefuel', 0.5}, })
-
Replace lines 246-247
inst.components.lootdropper:SetLoot({"smallmeat", "cave_banana"}) inst.components.lootdropper.droppingchanceloot = false
with this:
inst.components.lootdropper:SetChanceLootTable('monkey')
-
Replace lines 267-268
inst.components.lootdropper:SetLoot({"beardhair"}) inst.components.lootdropper.droppingchanceloot = true
with this:
inst.components.lootdropper:SetChanceLootTable('nightmaremonkey')
-
Remove line 347
inst.components.lootdropper.droppingchanceloot = false
since it doesn't do anything.
- The SetNormalMonkey function isn't used if splumonkeys are spawned outside of the ruins, so if you spawn them on the surface, the only part of the bug you'll see is them having a chance to drop nightmare fuel.
- c_give("pickaxe")c_give("minerhat")c_gonext("cave_entrance")
- Mine the sinkhole and enter it.
- c_godmode()c_gonext("cave_entrance")
- Equip the miner hat, mine the thulecite sinkhole, and enter it.
- c_godmode()
- c_removeall("monkey")c_removeall("smallmeat")c_removeall("cave_banana")c_removeall("nightmarefuel")
- c_spawn("monkey",100)
- local x,y,z = GetPlayer().Transform:GetWorldPosition() for k,v in pairs(TheSim:FindEntities(x,y,z,40)) do if v.prefab == "monkey" then v.components.health:DoDelta(-125) end end
- c_countprefabs("smallmeat")c_countprefabs("cave_banana")c_countprefabs("nightmarefuel")
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now