Jump to content

Recommended Posts

Hello, I have realized sometimes when I am playing during the summer I get this crash. I have looked over the log and when the game tries to start making it rain something goes wrong. I have looked and I honestly don't understand what's wrong.

 

This is the Crash:

 

...ont_starve/data/scripts/components/seasonmanager.lua:218: attempt to index field 'SoundEmitter' (a nil value)
LUA ERROR stack traceback:
        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/components/seasonmanager.lua(218,1) in function 'OnRainStart'
        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/components/seasonmanager.lua(83,1) in function 'fn'
        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/entityscript.lua(693,1) in function 'PushEvent'
        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/components/seasonmanager.lua(860,1) in function 'StartPrecip'
        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/components/seasonmanager.lua(802,1) in function 'UpdateDynamicPrecip'
        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/components/seasonmanager.lua(1149,1) in function 'OnUpdate'
        C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/update.lua(104,1)
Edited by BillBobJoy

I do not know how that error is possible. It's saying that the world has no SoundEmitter.

You'd have to be like... adding the seasonmanager component to an entity without a sound emitter, or... removing the sound emitter from the world prefab.

@squeek That's what I thought here is my mod

 

mrgmview.zip

 

other than that, do you think it's a game bug?

 

The prefab "mrhat" has the season manager but as I said, I only get crashes in the middle summer and they happen with or without that item.

@squeek That's what I thought here is my mod

 

attachicon.gifmrgmview.zip

 

other than that, do you think it's a game bug?

 

The prefab "mrhat" has the season manager but as I said, I only get crashes in the middle summer and they happen with or without that item.

Haha, well that solves that then. You should never add the seasonmanager component to anything except the world prefab. Basically, unless you're creating new world types, you should never add the seasonmanager to anything.

In looking at your code, I'm unsure why you thought you needed it.

Edited by squeek

@squeek

I have not had that issue before, I use the component to differentiate between seasons.

the character himself, prefab mr7 has had it since I started the mod

Edited by BillBobJoy

You don't need the seasonmanager on a prefab to be able to differentiate between seasons. The function GetSeasonManager() can be called from anywhere and gives you the world's seasonmanager component for you to differentiate between seasons with.

The seasonmanager component is written to only work when added to the world prefab and it's written so that there should only be one seasonmanager component that exists at a time. The name should give that away. You don't want your player or your hat to manage the seasons. That doesn't make any sense.

Edited by squeek

So I can just

inst:AddComponent("seasonmanager")

and it will work the same?

If you forgot a word and that was meant to say "So I can just remove inst:AddComponent("seasonmanager") and it will work the same?", then yes. Remove it from mrhat and mr7. Edited by squeek

@squeek

 

Yes I forgot that word, my bad getting late where I live, 3 AM, been trying to fix this for hours.

I am trying your suggestion out and thins seem to be going OK, right now I have the game running testing to see what happens.

Edited by BillBobJoy

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