Jump to content

Autodisable is problematic when it comes to bug fixing


Recommended Posts

So I'm a novice Don't Starve modder and I recently created a mod which crashed Don't Starve Together Beta.  I made a slight adjustment in an attempt to fix it however Don't Starve Together Beta autodisables the mod and then crashes.  Could someone tell me how I can turn off the auto mod disable? thank you.

Link to comment
Share on other sites

ok right, could you please take a look at this in that case; I'm trying to have the character's max health as 100 + current sanity and this is the code:

 

inst.components.health:SetMaxHealth(100+(self.inst.replica.sanity:Current))

 

This is all I've changed to break the mod, what have I done wrong?

Link to comment
Share on other sites

ok right, could you please take a look at this in that case; I'm trying to have the character's max health as 100 + current sanity and this is the code:

 

inst.components.health:SetMaxHealth(100+(self.inst.replica.sanity:Current))

 

This is all I've changed to break the mod, what have I done wrong?

 

I'm not totally familiar with DST's workings yet, but I believe replica components aren't really used by prefabs directly like that.

 

Try changing

self.inst.replica.sanity:Current

to

inst.components.sanity.current

.

 

If that doesn't work, you should probably post in the DST-specific mod forums.

Link to comment
Share on other sites

@Destiny8Chicken, @debugman18,

 

I'm not familiar with the DST API either, but presumably you are trying to reference self, which is a nonexistent variable.  Self is often defined as a local variable inside of a class definition or function, and doesn't mean anything unless you have a self variable outside of the function.

 

 

In any case you can always check your log file to see what went wrong.  Just search this forum for log figure out where to find that.

 

In the future though, you'll probably have better results asking DST questions in the DST modding forum ;)

Link to comment
Share on other sites

@Destiny8Chicken, @debugman18,

 

I'm not familiar with the DST API either, but presumably you are trying to reference self, which is a nonexistent variable.  Self is often defined as a local variable inside of a class definition or function, and doesn't mean anything unless you have a self variable outside of the function.

 

 

In any case you can always check your log file to see what went wrong.  Just search this forum for log figure out where to find that.

 

In the future though, you'll probably have better results asking DST questions in the DST modding forum ;)

 

I'm aware that self was being used incorrectly there. That's why I didn't include it in my correction. :p

 

I'm also almost 100% sure that replica components aren't used explicitly like that.

Link to comment
Share on other sites

I figured self should at least be mentioned since that's what was causing the problem O.o

 

In any case, I have quite a bit to learn about the DST API, but I'm not sure what would prevent replica components being used like that, apart from it being improper use(i.e. shouldn't but can, technically).

Link to comment
Share on other sites

Thanks for all your posts, debugman18 came closest to fixing the problem however whilst the game worked, the max health was kept at 300, not being affected by the actual sanity level, so sanity seemed to be a constant of 200 for some reason, however I'm going to take your advice and put this in the DST beta modding forums, thanks for all your help

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...