Jump to content

4/5 Labyrinth trap scenarios do not work.


penguin0616
  • Fixed

Labyrinth traps are randomly given one of five scenarios to run once they open, with a 66% chance.

4/5 of them don't work, which are: "sanitydelta", "hungerdelta", "healthdelta", and "inventorydelta".
The only one that works is "summonmonsters", because it doesn't care about the issue outlined below.
(Scenario functions for Labyrinth traps can be found in scenarios/chest_openfunctions.lua)

The issue being that the parameters for these 4 scenario functions are not set up correctly. The scenario functions are called by scenarios/chestfunctions.lua:87, which calls them as: 

openfn(inst, scenariorunner, data)

Where openfn is the scenario function, 
inst is the container instance, 
scenariorunner is the scenariorunner component,
and data, which is a table generally structured as 

{
  	player = thing_that_opened_chest,
  	doer = thing_that_opened_chest
}

 

The scenario functions (using "sanitydelta" as a reference), only accept 2 arguments.

local function sanitydelta(inst, data) --Changes sanity up or down
	local tar = data.doer or data.worker

	if not tar then 
		return
	end

	local sanity = tar.components.sanity
	if sanity then
		sanity:DoDelta(math.random(-20, 20))
	end
end

Thanks to how it is called (as illustrated above), data ends up being the scenariorunner component which does not have a "doer" or "worker" member. 

Note: All of the scenario functions have this parameter issue, but the one that works, summonmonsters, works because it doesn't depend on the data being passed in.

If need be, I can provide a video demonstrating the issue.


 

@zarklord_klei


Steps to Reproduce

1. Go explore the labyrinth.

2. Open some chests, and realize that the "traps" don't seem to do anything most of the time.

3. Investigate, and notice an issue.

  • Like 1
  • Sad Dupe 1
  • GL Happy 1
  • Potato Cup 1



User Feedback


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.

we are gonna get the cursed 107% panflutes and eyebrellas from singleplayer, time to get those extra resources with decon staff

  • Wavey 2

Share this comment


Link to comment
Share on other sites



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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...