News:

Welcome to World of Banished!

Main Menu

Need a bit of help creating a simple mod

Started by Maoman, September 06, 2015, 01:39:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Maoman

This post is copied from my reddit post in /r/Banished. A user there suggested I try here. I appreciate any help. :) I have little experience modding, mostly just tiny changes to variables and such in skyrim or Feed the Beast, like this mod I'm trying here.

Anyways. As far as I can tell, all I need is the file location of the audio .wav files for the chicken, cow, and sheep in a steam install. I can't find them anywhere. If you want more information (or if you want to figure out for yourself if there's a way to do this without the .wav files), continue reading.

____

I have 50 sheep, 40 cows, and 130 chicken, and I'm only gonna get more. Running the game at 10x speed is already killing my ears and it's gonna get worse. I found the mod Quieter Livestock (http://banishedinfo.com/mods/view/53-Quieter-Livestock#description) but it's not enough for me - but at the same time, I don't want them completely silent, so I figured I'd edit the file myself. That was easy enough, but I figured if I was going to do that, may as well package it into a mod I can upload to the workshop for others, right?

Well there's my problem - As far as I can tell, everything is set up correctly to be packaged, but when I do so, It tries to find the .wav files for the animals, which I don't have. I know why it's doing that, I'm trying to package the .rsc files for the animals which target the .wav files in the code like so:

    SoundBuffer version0
    {
       bool _looping = false;
       String _wave = "Audio\Animal\Sheep0.wav";
    }


But if I simply remove all that and only leave the variable I'm changing:

    AnimAudioEvent event
    {
       SoundEffect _soundEffect = "resource";
       float _chance = 0.0025;
    }

(_chance defaults to 0.05) in the .rsc files, the mod doesn't work. I checked every instance of Audio\Animal I could find, everywhere on my computer, there are no .wav files anywhere, only .rsc and .crs files. I'm assuming the .wav files are compiled into the .crs files but I don't know.

If my description sucks and you're confused, here is a dropbox link to the entire modding tools folder of mine, including all my mod data, so you can see for yourself. Just click "BuildMyMod.bat" and see the error message for yourself. It's about 200mb https://www.dropbox.com/s/fsoav8ytxnusz3j/BanishedMod.rar?dl=0

Edited to remove reddit comment syntax.

RedKetchup

#1
yeah we dont have access to any .wav sounds nor any .fbx graphics :(

i am downloading your .rar and will check all your work :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

#2
QuoteBut if I simply remove all that and only leave the variable I'm changing:

    AnimAudioEvent event
    {
       SoundEffect _soundEffect = "resource";
       float _chance = 0.0025;
    }

so if you want to only change the float _chance i am suggesting you to :

call only that function in your package.rsc with (no need to delete everything in the .rsc, just call it direct) :

ExternalList list
{
External _resources
[
"animal/Chicken.rsc:event"
"animal/Cow.rsc:event"
"animal/Sheep.rsc:event"
]
}


and edit all your animal/Chicken.rsc:event , animal/Cow.rsc:event , animal/Sheep.rsc:event
with an // in front of your SoundEffect _soundEffect = "resource"; (to prevent being called and need all the wav) like :


AnimAudioEvent event
{
//SoundEffect _soundEffect = "resource";
float _chance = 0.001;
}



try it . might it work :) (but not sure if 0.001 is enough, i would try 0.00001;)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

#3
alright , i contacted GimmeCat, the person who made the QuieterLivestock and and he generously agree to send me the files :)

you will find in this .zip below all his code and files. they compile and work. so you can use it and modify the parameters you want :) and compile :)
let me know if you need more further help :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maoman

#4
I really appreciate the response. I'm at a loss here, it's not making sense to me.

Ok, so I changed everything you suggested and it still calls for the .wav files, but it doesn't raise an error anymore, it does finish at least. Still, when I run Banished and enable my mod, it makes no difference. I even lowered the values even further from 1/20 as frequent to 1/200 as frequent, so they'd be almost completely silent if the mod was working, just to be absolutely certain it wasn't working.

Almost desperately now, I scoured quieterlivestock's files and compared them to mine, then basically made my files completely identical in every way I could find, yet it still won't work. The only discrepancy I can think of are the resource files in the bin folder (chicken_resource.crs and others). I just copied mine from the game's files in winData (because I saw them in the example mod's files, but didn't know what they were), but when I copied his into my mod and tried to compile... well it still didn't work, but it actually saw them and tried to compile them, where before they were never mentioned. He also has a file quieterlivestockResource_resource.crs; I don't know what it is, what it does, or how to make one for my own mod. The mod tool doesn't seem to make them, as far as I can tell.

Attached is the current state of my quietPastures mod folder. Also wtf, no .rar files allowed? It's just an arguably better .zip file.

EDIT: Ok, clearly I'm doing something simple incorrectly, because I just changed the value in quieterlivestock's files to make the animals speak less frequently and compiled it as is, and the mod isn't working.

I compile by making a .bat file with bin\x64\Tools-x64.exe followed by the /build and /mod commands and the appropriate file destinations, as you can see in my dropbox file above. After compiling a mod, I'll go into bin/x64 and run the 64bit dev version of Banished included in the modtools, load my saved game, enable the mod from the in-game mod list, and reload. At this point I'm anticipating a facepalm of epic proportions because of some simple mistake I've been doing all this time to lead to my troubles here.

RedKetchup

#5
if i check the command prompt window.... it says ' trying to load from the pack..... ' so i assume it finds it.
personally i see a little difference but maybe it is just 'hallucinations' ^^ but if it really do, maybe there is a minimum limit we cant go further and the game automatictly replace it with minimum value :P

but effectively , it isnt clear at all. gonna ask another pro to check that :)
@kralyerg !! we need your help if you have time :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maoman

Yeah I saw it was trying to load from the pack too. I wish there was a better tutorial out there. The .html file one that came with the modtools is pretty terrible. "It would take too long to teach you how to make mods with this, so here's 5 example mods and you can just figure it out by looking at them."

I doubt there's a minimum limit because when I edit the file directly (meaning in the game's resources files, rather than trying to pack a mod that does it for me), it works like a charm. If there was a barrier specifically applied to modded variables, maybe, but that seems unlikely - if there was a limit it would just straight up check the variable _chance, right?

RedKetchup

it is significally different when you go edit your resource files ? (which i didnt tried)
because if it is the case.... that would means something wrongs with our mods ... probably cause we dont have the .wav's
and that would mean we would need to make our personal '.wav's'
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maoman

I don't know how to edit .crs files. Everything I've been doing has been with the .rsc and .bat files.

RedKetchup

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maoman

Yeah nevermind, for some reason I thought when you said "resource files" I thought you meant like chicken_resources.crs and similar.

When I edit the resource files directly, all I do is change the value for the variable _chance, save, and start the game. Works like a charm, but I can't exactly pack that and put it on workshop.

RedKetchup

thats sad. maybe @kralyerg  will have some ideas cause after couple of hours... i m out of ideas of 'how to do trick it'.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maoman

Welp, I'm going to bed and subsequently to work, so I won't see any replies for almost 24 hours (I work a 12 hour shift). :/ Thanks for trying to help, Red. lol and here I thought this mod would be simple. Just change one variable, how hard can it be? Hope kralyerg will have some ideas.

kralyerg

I don't think I can be of any help, because I don't see a problem.

When I take the quietPasture code and build a mod from it and put it in my Steam folder and load it up, it seems to work just fine.

I build a pasture and populate it with animals and it's virtually silent.  Then I unload the mod in the middle of the game and then the animals are noisy again.  Then I reload QP midgame and they're quiet again.

I don't know how to compile it without the weird wav errors, but everything seems to run great for me.