Jump to content

Recommended Posts

Alright, twice I posted this on the wrong forum (once by accident, once cause I thought it wouldn't be considered a mod, lol), so let's hope it has more success in here.

 

I wanted to know how (if possible, but I think it is) to change and/or remove some of the visuals and audio caused by going insane. The heavy screen effects murder my FPS, the darker screen makes it so I can't see crap at dusk, and the sounds and everything else overall are pretty unsettling in general to me, and just urge me to get my sanity back up. And while I understand some of this might be on purpose, personally it just makes staying insane for a while not an option, so getting Nightmare Fuel and such pretty inconvenient.

 

I found a bit about the audio part, found everything is on sanity.fsb, but that really didn't help me much cause apparently fsb files aren't just a bunch of audio files compressed. I tried following the tutorials in here but apparently they are quite outdated and everything was different when I tried following it.

 

From what I checked, I'd like to change sanity_loop1.mp3, sanity_loop2.mp3, crazy extra 1.mp3 and crazy_extra 2.mp3, if it makes any difference.

 

As for the screen effects, I have no clue whatsoever so far.

Hm, you mean this?

self.INSANITY_CCS =	{		DAY = "images/colour_cubes/insane_day_cc.tex",		DUSK = "images/colour_cubes/insane_dusk_cc.tex",		NIGHT = "images/colour_cubes/insane_night_cc.tex",		FULL_MOON = "images/colour_cubes/insane_night_cc.tex",	}

Thing is, I don't even know how to use/edit/create tex files, and I doubt I can just redirect it to a non-existant file. Also I should probably do that through a modmain rather than changing the game file itself, right? Not quite sure how to do that either...

Hm, you mean this?

self.INSANITY_CCS =	{		DAY = "images/colour_cubes/insane_day_cc.tex",		DUSK = "images/colour_cubes/insane_dusk_cc.tex",		NIGHT = "images/colour_cubes/insane_night_cc.tex",		FULL_MOON = "images/colour_cubes/insane_night_cc.tex",	}

Thing is, I don't even know how to use/edit/create tex files, and I doubt I can just redirect it to a non-existant file. Also I should probably do that through a modmain rather than changing the game file itself, right? Not quite sure how to do that either...

 

No,no,no, you missunderstood. In your modmain, do this (but with the right file path for every one of those):

 

GLOBAL.PostProcessor.INSANITY_CCS.DAY = "images/colour_cubes/day05_cc.tex"

Edited by Mobbstar

Oh, yeah, I was thinking it might have been something like that, but I really had no idea how the code for it would be. My doubt with that is that there's two different night tex files, though. Is maybe one for NIGHT and one for FULL_MOON? I'll try the day and dusk ones meanwhile.

 

Edit: Welp...

 

"...tarve/data/../mods/Ran's Insanity Tweaks/modmain.lua:1: attempt to index field 'PostProcessor' (a nil value)"

 

Got that when trying to load the mod. Yeah, sorry, I'm really basic with my modding knowledge, I don't know how to fix those "nil value" issues when they come up xD

Edited by Ran

Well, that's weird, I actually tried that mod before, at two different times, but it always gave me some error. But somehow it just doesn't anymore. Maybe it was incompatible with some other mod I used before, dunno. But well, glad you mentioned it then, that's one down then.

 

It's just the top part of the mod that disables the insanity overlay, right? Cause I'd like to have all of these changes together in one mod if possible, you know, for convenience.

Yeah, this part handles the hud animation.

local function Hooker_Specific_Insanity_Disable(self, owner)    self.GoInsane = function(self, ...)        -- Stop function from applying the screen overlay by not showing the animation state.    endend AddClassPostConstruct("screens/playerhud", Hooker_Specific_Insanity_Disable)

 

As far as mod incompatibility, do you happen to remember which mod(s) you were using at the time to create the error?

Luckily I keep all mods I used before in a different folder, so I remember in case I wanna add something back, so I could tell you those, but honestly none have anything to do with sanity or overlays afaik.

 

-Birdcage

-Brass Lantern

-Charcoal Burner

-Don't Spoil Early

-Dynamic Status Bar (I think I added this later so it shouldn't be)

-Manual Workshop Update (same for this)

-Mineable Gems

-Minimap HUD

-Minimap HUD MZ

-Regeneration

-Storm Cellar

-Walls Drop Walls (I still have the code of this in another mod, so it shouldn't be this)

-Where's My Beefalo

 

I always distrust stability when I use a lot of mods in games though (and those are just the ones I disabled so imagine how many I actually have), you never know what kinda weird combination can cause what. So who knows, it might be none and instead some weird combination of several, dunno.

 

Edit: Oh wait, actually Regeneration has to do with sanity, I just didn't use that part of the mod.

 

(Also, I guess my computer is more or less a potato with some wires, lol)

 

Edit 2: Well, nevermind, now it's back! I'm getting that dumb error again, so it wasn't any of those mods. I think it's not any specific mod, it has to do with something in the game when I load the save, cause it's not even mentioning any more, but it definitelly only happens when I load the game with that mod enabled.

 

The specific error it mentions is:

 

"...on/dont_starve/data/scripts/widgets/inventorybar.lua:901: attempt to index field '?' (a nil value)"

 

but I'll attach the whole log file cause I saw a bunch of weird things all over.

log.txt

Edited by Ran

Yeah I noticed that name show up later. The problem is that I really REALLY don't wanna get rid of that one, lol. Also, like I said, the problem only shows up while I have the Overlays Disabler mod active too, so I guess it's sort of a compatibility problem, in a way.

 

So is there any way I could fix it myself, judging from that log, or is it something all tangled up in the code of the mod and it'd need a whole rework to fix it? Or alternatively, write the overlay change in a different way that won't interact with the RPG HUD mod.

Was that a philosophical answer? Lol. I meant, like, if it's something clear and simple enough that I could change it myself (with the help of the nice people in this forum, of course :p), or if it's something too complicated so that only mod creator should spend that much time to fix.

 

At any rate, there's still the color cubes thing that I couldn't get working, and I'd also still like to know how would one go around modding sounds within an fsb file (namely the sanity.fsb that I mentioned).

Well I already tried commenting out one by one the parts of the code that were giving an error and eventually it ended up pointing to inventorybar.lua of the base game (dont_starve/data/scripts/widgets) which is kinda ridiculous cause for one, the mod actually does have that file and replaces it, and two, I'm using RoG which has its own version of that file, so the base game one shouldn't really be touched.

 

So overall I just don't know enough to even understand what the problem is, lol.

@Ran,

 

The file that throws the error isn't always the one that causes it.  For example, if a function of yours passes bad data to some function in a different file, and then that function tries to do something with it it, it will throw the error even though the error originated in the first function in a different file.  That's why the stack trace is so useful.  It shows the flow of control of the program up until the error.  Just trace it back until you see a non-base-game file, and that's most likely your culprit.

I don't know what's going on quite yet, but when I copy paste the mod and make it non-workshop it runs fine with the RPG Hud you're using.

 

Load order probably changes, which seems to imply one of the methods used to hook the function is wrong.

 

Will tinker further.

 

Edit 1:

Yeah, it looks like mod load order is alphabetical.

I set his to load before mine and his crashes.

 

Going to tinker his hook method and see if it's his.

 

Edit 2:

Still tinkering and generating more crashes trying to get the two to work.

I set my mod's hook to look like his.

I set his mod's hook to look like mine.

I've tried using another hook type.

 

But all of them cause a crash one way or another.

Which is odd because the two functions don't cross.

 

Edit 3:

His function does cross GoInsane a couple of times.

 

Edited by CarlZalph

Oh, interesting. I actually have the custom of downloading a mod from the workshop, then changing the name of the folder to make it "local". Cause workshop updates have the nasty tendency of making some of my subscribed mods simply disappear now and then.

 

And now that I think about it, when it DIDN'T crash at first was most likely when I was still using your mod straight from the workshop, and those always go at the end. Then when I saw it worked and made it non-workshop, it started crashing. I'm gonna try changing the mod folder name to change the order, see what happens.

 

Edit: Well what the heck and a half. If I just change the name manually it doesn't seem to work either way. Both local, I tried "aRGP HUD" (both in the folder and modinfo, just in case) so it was pretty much first, crash. Then i tried "zRPG HUD" so it was last, same thing. But I try just leaving RPG HUD alone as local, and using the workshop version of Overlays Disabler (which ends up almost last), and it freaking works! It's not just the order then, I'd say.

 

Edit 2: Well I tried using my mod with the extract of yours in it, put it last on the order, and it also works. I have no idea why changing the order of RPG HUD didn't work, though, if it's a matter of load order it should have worked when I put that one first. But well, at least I have a functional workaround for now.

 

(It's like an edit war in here)

Edited by Ran

So I just made my callbacks for all of the overlays not do anything and it still crashes.

 

I am going to keep it blank slate like that and try editing his mod to make it not crash with mine doing nothing but just being there.

 

Edit1:

I think his mod has a race condition in it, and with my mod just being there with its postinit it is causing it to consistently delay part of his mod enough for the other to fail and call on a nil value.

 

Edit2:

When my mod is present with the AddClassPostConstruct's, his inventorybar widget does not get created and all of the internal references are nil.

 

Edit3:

Yes, I am very confident that his mod is having a race condition with initializations.

Edited by CarlZalph

Well, not really sure what all that means, but at least you're figuring stuff out :p

 

Now, on a previous topic, could anyone help with this:

 

"...tarve/data/../mods/Ran's Insanity Tweaks/modmain.lua:1: attempt to index field 'PostProcessor' (a nil value)"

 

when I try to do for example this:

GLOBAL.PostProcessor.INSANITY_CCS.DAY = "images/colour_cubes/day05_cc.tex"

?

From main.lua:

local function ModSafeStartup()    ...    ModManager:LoadMods()    ...    PostProcessor = TheGlobalInstance.entity:AddPostProcessor()    local IDENTITY_COLOURCUBE = "images/colour_cubes/identity_colourcube.tex"    PostProcessor:SetColourCubeData( 0, IDENTITY_COLOURCUBE, IDENTITY_COLOURCUBE )    PostProcessor:SetColourCubeData( 1, IDENTITY_COLOURCUBE, IDENTITY_COLOURCUBE )    ...end

It would seem that the global PostProcessor doesn't exist until sometime after mods are load(ing/ed).

 

I'mma see about trying to force that change with one of the post initializers.

Oh, well that's inconvenient. That can be forced to be created earlier through a mod itself? It all sounds pretty delicate. But anyway, thanks for your continued effort, I already managed to get one thing working thanks to it, even if it's with a workaround :p

local function OnLoad(player)    if(GLOBAL.PostProcessor~=nil)    then        print("PostProcessor is valid here.")        --GLOBAL.PostProcessor.INSANITY_CCS.DAY = "images/colour_cubes/day05_cc.tex"        -- Crashes due to INSANITY_CCS being nil!    endendAddSimPostInit(OnLoad)

The INSANITY_CCS is defined only in components/colourcubemanager.lua

 

Which would seem to imply that you could have an AddComponentPostInit to touch this.

Trying that.

 

Edit 1:

local function PostInit_Component_colourcubemanager(self, instance)    if(self.INSANITY_CCS~=nil)    then        print("INSANITY_CCS is valid")    endendAddComponentPostInit("colourcubemanager", PostInit_Component_colourcubemanager)

Says it's valid at this point, going to try editing the value to yours.

 

The one it is defined at in there has a table or keyvalue pair tree, not sure which:

self.INSANITY_CCS =    {        DAY = "images/colour_cubes/insane_day_cc.tex",        DUSK = "images/colour_cubes/insane_dusk_cc.tex",        NIGHT = "images/colour_cubes/insane_night_cc.tex",    }

Edit 2:

local function PostInit_Component_colourcubemanager(self, instance)    if(self.INSANITY_CCS~=nil)    then        print("INSANITY_CCS is valid")        self.INSANITY_CCS =        {            DAY = "images/colour_cubes/day05_cc.tex",            DUSK = "images/colour_cubes/dusk03_cc.tex",            NIGHT = "images/colour_cubes/night03_cc.tex",       }    endendAddComponentPostInit("colourcubemanager", PostInit_Component_colourcubemanager)

This seems to remove the color changes on insane and shoves it to the default summer cubemap.

 

This will have a side-effect, though, of making the world look different in winter when going insane.

 

Edit 3:

This doesn't help the screen getting darker, there seems to be yet another thing the insanity effect is applying.

 

This will stop it from washing the colouring out.

Edited by CarlZalph

Oh boy, how many things did they stuff in that insanity of theirs, lol.

 

I was fearing it'd change the normal seasonal looks, but I was hoping it wouldn't since I only saw one day and one dusk color cube. So I figured maybe the seasonal tones were handled somewhere else, but I guess not. I realized they just have other names for those, like snow_cc for winter day, etc. So I guess being insane makes it so all seasons look the same.

Also, there's a FULL_MOON too but I guess you were using the base game files and that one's only on the RoG one. Plus it just uses the normal night insanity cube anyway so it makes no difference.

 

Well, I don't mind the discoloring much, and I do want some hint of being insane, after all, so I guess I could leave that one as is. I'd love to find where they make the darker screen change though, that actually bothers me.

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