Jump to content

Recommended Posts

I'm writing an AI for Dont Starve and trying to use the RandomNode functionality in the Behavior Tree....only when I do, I get the following error:

../mods/ArtificalWilson/modmain.lua(11,1) Enabling Artifical Wilson	...ps/common/dont_starve/data/scripts/behaviourtree.lua:456: variable 'inst' is not declared...

So, I open up BehaviorTree and find the RandomNode section and sure enough, there is a few cases of inst.blah when it should be self.blah.

 

The bug report forum seems like it is only suited for crashes that happen with the base game...so I'm posting it here. Maybe I should post it there instead...no idea.

 

On top of that, there is another bug in RandomNode. If the random returns the last element in the children, it will crash as it increments past the boundary. Namely, the code at line 468:

            self.idx = self.idx + 1               if self.idx == #self.children then                self.idx = 1            end

should be changed to:

            self.idx = self.idx + 1            if self.idx > #self.children then               self.idx = 1            end

After these 2 changes, RandomNode works :)

 

Current Dont Starve Version: 

 

Rev. 151567

2015-09-29_17-37-18

17:40:29

Yeah, there's some parts of the game that seem functional until you try to use them and realize that everything in the game works around them because they don't work properly... Cooldown component for instance.

 

I really hope the devs revise the base game for such minimal code changes.

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...