World of Banished

MODS Garage => Tips and Help => Topic started by: Nikki on November 19, 2018, 10:17:07 AM

Title: Menu issues in mod
Post by: Nikki on November 19, 2018, 10:17:07 AM
I've been trying to make a mod for Banished. From what I can tell I have things the menus right and compared to the examples, but they're not showing up in game. I'm not sure what I have wrong, or how to find what it is.

I'm not sure what I else I should put here. I'm new to modding Banished, and the forums.
Title: Re: Menu issues in mod
Post by: RedKetchup on November 19, 2018, 11:59:46 AM
Quote from: Nikki on November 19, 2018, 10:17:07 AM
I've been trying to make a mod for Banished. From what I can tell I have things the menus right and compared to the examples, but they're not showing up in game. I'm not sure what I have wrong, or how to find what it is.

I'm not sure what I else I should put here. I'm new to modding Banished, and the forums.

If you want to help you, you need to give some infos. we arent soothsayers or telepathics. you need to type, copypaste, provide everything you can so we can "see" whats going on and where are your errors.


EDIT: I strikethrough some text, i didnt meant to offence, sorry.
Title: Re: Menu issues in mod
Post by: Nikki on November 19, 2018, 04:44:46 PM
No one said you are "soothsayers or telepathics", I don't know what I need to copy&paste or I would have. Unless I know what to put here I can't put anything useful here. If this is how you "help" people I'm not sure I want help. I will either figure it out eventually or give up, but if this is how people act I won't share any mods for this like I don't share any mods I've made for other games. It doesn't matter to me how much work I put into a mod, it's not worth sharing only to get crap for replies.
Title: Re: Menu issues in mod
Post by: Glenn on November 19, 2018, 06:30:10 PM
Nikki,

Red isn't giving you crap, he simply said that you need to share/show what you have done so far so the others can guide you in the right direction.

Help them so they in turn can help you.

Everyone is very nice here, so please do not over react.
Title: Re: Menu issues in mod
Post by: RedKetchup on November 19, 2018, 06:55:51 PM
Quote from: Glenn on November 19, 2018, 06:30:10 PM
Nikki,

Red isn't giving you crap, he simply said that you need to share/show what you have done so far so the others can guide you in the right direction.

Help them so they in turn can help you.

Everyone is very nice here, so please do not over react.

sorry @Nikki   :'(
i didnt meant to give you any crap.

you ask for help. we here always help people. surf a bit those this subforum.
we need to see your code so we can point out your error(s). start with your root resource and toolbar files, package.rsc and your .bat
if we need more, we gonna ask more details.

Again, Nikki. i am very very sorry.
Title: Re: Menu issues in mod
Post by: Gatherer on November 20, 2018, 08:17:22 AM
 ::)
Title: Re: Menu issues in mod
Post by: Nikki on November 22, 2018, 07:32:13 AM
I don't check forums daily, and all the extra things to fill in don't help me want to reply here. The cmd file is more complicated than it needs to be, but for how I use things it's easier for me. The other projects I have that don't have menus work fine.

I don't like sharing source to anything. I've had far too much work stolen, and had other people take credit for it. Then because they had the source, I'm the one that gets accused of theft. No surprise that when I stop sharing new source, the "original" stops being updated.

This is no where near finished. I'm trying to get the first part finished before moving on.
Title: Re: Menu issues in mod
Post by: Tom Sawyer on November 22, 2018, 09:12:32 AM
I don't use the community toolbar, so others can say more about this. But the way of adding new items to the game is actually different to your source. If you look at the apiary example from Luke, there is an ApiaryResources.rsc calling Apiary.rsc:apiary and the modkit is quite sensitive to this naming relative to the mod name and so on. I would try to make it close to this example. In your case, making a NM_Storage.rsc for the toolbar items and calling them separately via NM_StorageResources.rsc. Just a thought but maybe it helps.
Title: Re: Menu issues in mod
Post by: RedKetchup on November 23, 2018, 08:05:25 AM
first, i dont know why you are not using the .bat files system and use those .cmd. Is it because you dont use windows 7 or 10 ?

i looked inside all those .cmd and nowhere it is written all the infos a real build.bat file should have. Probably it is playing a big part about your trouble, or NOT. No idea.

sedundo, your package.rsc:list

there is tons of things there that should not be. in fact, absolutely all the lines you did put in your :list paragraph, none of them should be there. so you can delete all those lines, all of them.

along with your package.rsc, at the root, you should have a file named : NMStorage.rsc which will contain the toolbar placement of your items you want to add

NMStorage.rsc

Toolbar NMStorageBarn
{
Toolbar _parent = "Game/NMtoolbar.rsc:NMstorage";
int _sortPriority = 10;
Action _action = Tool;
ComponentDescription _tool = "Template/NMStorageBarn.rsc";
bool _autoHotKey = true;
}

Toolbar NMStorageBarnWood
{
Toolbar _parent = "Game/NMtoolbar.rsc:NMstorage";
int _sortPriority = 20;
Action _action = Tool;
ComponentDescription _tool = "Template/NMStorageBarnWood.rsc";
bool _autoHotKey = true;
}

Toolbar NMStorageBarnFirewood
{
Toolbar _parent = "Game/NMtoolbar.rsc:NMstorage";
int _sortPriority = 30;
Action _action = Tool;
ComponentDescription _tool = "Template/NMStorageBarnFirewood.rsc";
bool _autoHotKey = true;
}

Toolbar NMStorageBarnStone
{
Toolbar _parent = "Game/NMtoolbar.rsc:NMstorage";
int _sortPriority = 40;
Action _action = Tool;
ComponentDescription _tool = "Template/NMStorageBarnStone.rsc";
bool _autoHotKey = true;
}

Toolbar NMStorageBarnIron
{
Toolbar _parent = "Game/NMtoolbar.rsc:NMstorage";
int _sortPriority = 50;
Action _action = Tool;
ComponentDescription _tool = "Template/NMStorageBarnIron.rsc";
bool _autoHotKey = true;
}

Toolbar NMStorageBarnCoal
{
Toolbar _parent = "Game/NMtoolbar.rsc:NMstorage";
int _sortPriority = 60;
Action _action = Tool;
ComponentDescription _tool = "Template/NMStorageBarnCoal.rsc";
bool _autoHotKey = true;
}


those are your anchors for your items you want to add to the game, anchored on your Game/NMtoolbar.rsc:NMstorage toolbar which is also anchored in CommonToolbar.rsc


then your new Package.rsc should look like that:


PackageFile NMStorage
{
String _name = "Nikki's Mods Storage";
String _author = "Nikki";
String _description = "Nikki's Storage v0.0.1a";
String _icon = "icon.png";
String _preview = "preview.png";
int _userVersion = 0;

// all files in resource directory
String _includeList
[
"*"
]

// exclude package files, mod files, file used for building packages
String _excludeList
[
"Package_*.crs"
"*.pkg"
"*.pkm"
]
}

ExternalList list
{
External _resources
[
"NMStorage.rsc:NMStorageBarn",
"NMStorage.rsc:NMStorageBarnWood",
"NMStorage.rsc:NMStorageBarnFirewood",
"NMStorage.rsc:NMStorageBarnStone",
"NMStorage.rsc:NMStorageBarnIron",
"NMStorage.rsc:NMStorageBarnIronCoal",
]
}



Again, i have no idea if your .cmd works, i suggest to use the real build.bat. do your Package.rsc modifications. create the new .rsc file at the root of your mod next to the Package.rsc and called: NMStorage.rsc
(i also deleted your _ underscore in PackageFile NM_Storage : the game hate special caracters because they have a certain functions sometimes, let the game use them when needed, you, abstain to use those.)

your build.bat should look like that :

bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../NMStorage /pathdat ../NMStorage/bin
bin\x64\Tools-x64.exe /mod Package.rsc:NMStorage /pathres ../NMStorage /pathdat ../NMStorage/bin


again i delete your undescore of your folder name from NM_Storage to NMStorage. Let us know how it goes and if it has been resolve.
-RedK
Title: Re: Menu issues in mod
Post by: Glenn on November 23, 2018, 04:03:25 PM
Nikki,

I fully understand your worry about people stealing the work you have already done, many times I have seen mods on steam with multiple creators.

I have never seen such horrible behaviour here, and if it ever happened I am sure the culprit would be banned.

While I am not a modder (perhaps one day) those that do mod help one another to the best of their ability.

By sharing files more experienced eyes can see what needs to be done when you are having problems.

Indeed a new coding discovery by one person (such as recreating the water in the game) is shared so the other modders can make new creations.

Resource file sharing allows for multiple modders to have their creations work together

By doing so glass, bricks or a grain etc made by one modder can be used in another modders house or mill.

Variety if the life blood of any game, and the material made by the wonderful modders that we have can only be complimented by anything that you may create.

All my best

Glenn
Title: Re: Menu issues in mod
Post by: RedKetchup on November 24, 2018, 05:42:41 AM
sharing to folder is a very last minute option when we cannot find the problem at all for days...
and sharing is always better in PM to a direct person instead make it open where everyone can download.

Title: Re: Menu issues in mod
Post by: Nikki on November 24, 2018, 07:26:41 PM
I have multiple mod projects, but I'm only working on two of them for banished right now. The other one that doesn't have toolbars works correctly. I use the almost the same command files for both. I will try what has been said.
Title: Re: Menu issues in mod
Post by: Nikki on November 28, 2018, 08:43:11 AM
I didn't have time to add this before, but I ask that if you don't know much about bat/cmd files that you don't tell me mine are wrong. I said they were more complicated than needed, but they do indeed work.

If you make the script print the command instead of running it you get
bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin
bin\x64\Tools-x64.exe /mod Package.rsc:NM_Storage /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin


If you tried to use the scripts as is without configuring them for your environment, then no they wouldn't work. Any tool needs to know where something is and more often than not relative paths don't work right.

I tried commands like red says I need to use and they did not work. I can tell from looking at the commands that /build tells it what to build, /pathres tells it where it is, and /pathdat is you want the complied code to be. With the exception of package.rsc I know you can store source and bin anywhere as long as the tool can read/write them, and the data in the source location is correct. I can't say about package.rsc because I have not tried that, and I don't want to.

I know the scripts I use work, and the overall layout works because the other mods I use that don't change the menus build correctly, and work as expected in game. There is not much documentation to how some things need to be for the game, and the examples are lacking in usefulness. I know some of you will now assume I don't know what I'm doing anywhere, and if that's the case it just shows me that there is no help here.

Also the things red said to change, changed nothing in game.
Title: Re: Menu issues in mod
Post by: galensgranny on November 28, 2018, 12:37:44 PM
Nikki, the people answering you are just people like you, players of the game who decided to make mods for it.  They had to learn how to make mods basically on their own.  They are not official representatives of the game.  The maker of the game, Luke, never made any detailed instructions and does not offer help for making mods.  So any replies trying to help you are from people who did make mods that worked taking time out of their lives to try help another person trying to make a mod work.  If what they say does not solve your problem, that is unfortunate, but they do deserve thanks for trying to help.
Title: Re: Menu issues in mod
Post by: RedKetchup on November 28, 2018, 01:21:37 PM
Quote from: Nikki on November 28, 2018, 08:43:11 AM
I didn't have time to add this before, but I ask that if you don't know much about bat/cmd files that you don't tell me mine are wrong. I said they were more complicated than needed, but they do indeed work.

If you make the script print the command instead of running it you get
bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin
bin\x64\Tools-x64.exe /mod Package.rsc:NM_Storage /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin


If you tried to use the scripts as is without configuring them for your environment, then no they wouldn't work. Any tool needs to know where something is and more often than not relative paths don't work right.

I tried commands like red says I need to use and they did not work. I can tell from looking at the commands that /build tells it what to build, /pathres tells it where it is, and /pathdat is you want the complied code to be. With the exception of package.rsc I know you can store source and bin anywhere as long as the tool can read/write them, and the data in the source location is correct. I can't say about package.rsc because I have not tried that, and I don't want to.

I know the scripts I use work, and the overall layout works because the other mods I use that don't change the menus build correctly, and work as expected in game. There is not much documentation to how some things need to be for the game, and the examples are lacking in usefulness. I know some of you will now assume I don't know what I'm doing anywhere, and if that's the case it just shows me that there is no help here.

Also the things red said to change, changed nothing in game.


about the .bat and their path... it depends where you put your .bat. if you put the .bat inside your mod folder you need to add ../ at begining of each line. if your .bat is placed inside a /mods/NMStorage/ folder then you need to add 2 times the ../../ at begining of each line.


or

..\bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin
..\bin\x64\Tools-x64.exe /mod Package.rsc:NM_Storage /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin



or

..\..\bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:NM_Storage /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin


personally my .bats are never inside the mod. if you go deeper, you need to add commands to comeback less deeper.

EDIT: about your line: why there is a /source/ folder ?? and also if you use NM_Storage or NMStorage without _ , make sure it matches your syntax.
and i forsee more problems with that /source/ folder... wont the /bin/ and /build/ folder created in the /source/ folder ? dont need to change also the pathdat.. too ?
Title: Re: Menu issues in mod
Post by: RedKetchup on November 28, 2018, 01:44:59 PM
Quote from: Nikki on November 28, 2018, 08:43:11 AM
I can't say about package.rsc because I have not tried that, and I don't want to.

but why you dont want to ? thats the command inside the Tools-x64.exe that you are calling. it serves to package everything.

Quote from: Nikki on November 28, 2018, 08:43:11 AM
I know the scripts I use work, and the overall layout works because the other mods I use that don't change the menus build correctly, and work as expected in game.

did your other mods add something on a toolbar ? and working perfectly while adding something on a toolbar ?


Quote from: Nikki on November 28, 2018, 08:43:11 AM
There is not much documentation to how some things need to be for the game, and the examples are lacking in usefulness.

The developper gave us nothing, no documentation out of the README.html file and told us to look at the 3-4 examples he provided and told us to do the same as he did.

Quote from: Nikki on November 28, 2018, 08:43:11 AM
I know some of you will now assume I don't know what I'm doing anywhere, and if that's the case it just shows me that there is no help here.

why you are so mad at us ? we are the only place you can get help on this, we are not working for the game company. we are making tons of free mods for people and we always try to help other people, free. we all started with an absolute 0 knowledge and an absolute 0 experience to make mods for this game. just like you. and gods knows so much we would have loved to have someone to help us in those dark times.
Title: Re: Menu issues in mod
Post by: Maldrick on December 04, 2018, 10:17:31 PM
Almost started a new thread about this but my issue is similar to the OP's so decided to just post here.

Built a chapel and I can't get it to show up on the toolbar.  Have been through everything with a fine tooth comb and, compared against 3 different examples, everything looks as it should do far as I can tell.  Everything compiles and packs, also.  I even rebuilt the template and loaded my custom toolbar and still, nothing.  Loaded and tested my older mods to make sure the modkit is setup correctly and it is.  So I'm kind of in the same situation as the OP in that I can't get it to show up on the bar.  Launching the game in the kit crashes, but aside from that, everything looks as it should be, as far as I can tell.

I'm going to rebuild the whole thing tomorrow, but thought I would see if anyone has any suggestions.
Title: Re: Menu issues in mod
Post by: RedKetchup on December 04, 2018, 11:36:06 PM
my friend, if we dont see your code, we cannot point the thing. show us how you call your mod (package, root resource file, root toolbar file, and maybe later , if we didnt found the thing, your template)

dont get mad at me !
Title: Re: Menu issues in mod
Post by: Maldrick on December 05, 2018, 03:33:52 AM
Haha it's nothing to get mad about.  I'm just hell-bent on fixing this myself, if I can, and wanted to confirm that there isn't another place I should be looking.  I've checked and double checked all of that and it's just weird, but I changed a lot over two separate phases as I was getting my feet wet coding this so I'm sure it's something I did initially and I'm just not finding it.  It's been almost a year since I did the first one so I'm sure thats probably it.

I'm going to rebuild the whole thing first and see if it happens again.  But I'll absolutely post the whole project if not.  This one is just a test, really.  So far, I'm failing! Lol. But it's good as I've finally got my head back in the kit.

Thanks, Red. :)  If you hear screaming from the south around noon today, heads up. :P
Title: Re: Menu issues in mod
Post by: Maldrick on December 05, 2018, 11:24:04 AM
So I rebuilt the whole project and it compiled on the first try.  But I'm still getting that same problem.  Have no idea what I'm doing wrong or not doing so, mea culpa.

Attached is a zip of the project folder.  C:/BanishedKit/MyMods is the file path for this folder in the bats and my goal here is to stick it on the main bar after the Town Hall and before the Chapel.  This whole thing is a test...Going to need a chapel for what I'm working on so thought I'd take a break from modeling and get the code in order.

If anyone has time and doesn't mind giving it a glance, I would be greatly appreciative.  Completely flamuxed about what the problem might be.  However you spell that. lol
Title: Re: Menu issues in mod
Post by: RedKetchup on December 05, 2018, 12:05:42 PM
first i've look all the root files, they seemed perfect... tried to compile: ERROR at Texture03Texture.rsc

from this .zip you provided, one of the texture has a wrong size. Texture03.png is 1000x1000 instead of 1024x1024.
once i fixed that i ve been able to compile it, and then package it. i dont understand how you could compile it without error.

make sure you always always delete its Bin and Build folders that is creating each time you compile. why that ? to make sure your compiler have all the right info and not some old info coming from an old compiling tentative.

so i compiled it fine after resize, packaged it , placed the .pkm inside game/windata/ folder and launched the game for real. activated your mod, reloaded, and then i asked to build it, supplied the resources, and everything works fine !!
Title: Re: Menu issues in mod
Post by: kid1293 on December 05, 2018, 12:08:00 PM
Just when I clicked 'post' RK was there :) :) :)

Yes it is Texture03
Title: Re: Menu issues in mod
Post by: Maldrick on December 05, 2018, 12:26:34 PM
That's fantastic.  Thanks so much, guys!

It's really weird that didn't cause an error.  Glad it wasn't coding related, though.  Yes, Red, I always delete the generated files.  Learned my lesson with that.

Really appreciate the help, gentlemen, as always.
Title: Re: Menu issues in mod
Post by: Maldrick on December 05, 2018, 12:54:07 PM
Yep, that totally fixed it.  I see there are some things I need to tweak...Like the footprint. LOL  I don't know why I was thinking it was that big.  4x4 not 8x8. lol  And not sure what's up with that one texture at the top.  There's something going on with the build models too, it looks like, so not sure what's up with that.

What's awesome is it runs out of the kit now, which will help with something I wanted to do with this.

Question, which is a little off-topic, but not sure where else I would ask.  This is the first time I've modded anything that actually does something.  Where does the "work" sprite come into play?  Like where is it used in-game, I mean.  Only icon I know of is on the bar.

Thank you again, guys.  I was completely stuck.
Title: Re: Menu issues in mod
Post by: kid1293 on December 05, 2018, 12:57:52 PM
Work sprite is on the buildings menu where you click to activate/deactivate it. (Work/not work.)
Title: Re: Menu issues in mod
Post by: RedKetchup on December 05, 2018, 01:12:12 PM
i personally always use only 1 icon for each buildings and i change the name to target my lonely icon. this is the same .png that i link to the toolbar and i link to the work/close button.
Title: Re: Menu issues in mod
Post by: Maldrick on December 05, 2018, 01:35:45 PM
Makes sense, thank you.  Wasn't thinking about that.

Very excited about getting back on track with this.  Thank you very much.
Title: Re: Menu issues in mod
Post by: Nikki on October 24, 2019, 09:01:06 AM
Quote from: RedKetchup on November 28, 2018, 01:21:37 PM
about the .bat and their path... it depends where you put your .bat. if you put the .bat inside your mod folder you need to add ../ at begining of each line. if your .bat is placed inside a /mods/NMStorage/ folder then you need to add 2 times the ../../ at begining of each line.
I know that ../ tells it to go up on level, and ../../ is two levels.... This kind of thing doesn't help.

Quote from: RedKetchup on November 28, 2018, 01:21:37 PM
..\..\bin\x64\Tools-x64.exe /build Package.rsc:list /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:NM_Storage /pathres ../mods/NM_Storage/source /pathdat ../mods/NM_Storage/bin

If the commands are correct relative vs full paths won't matter.

Quote from: RedKetchup on November 28, 2018, 01:21:37 PM
personally my .bats are never inside the mod. if you go deeper, you need to add commands to comeback less deeper.
the .cmd files are not in the mod.

Quote from: RedKetchup on November 28, 2018, 01:21:37 PM
EDIT: about your line: why there is a /source/ folder ?? and also if you use NM_Storage or NMStorage without _ , make sure it matches your syntax.
and i forsee more problems with that /source/ folder... wont the /bin/ and /build/ folder created in the /source/ folder ? dont need to change also the pathdat.. too ?
What you seem to call the mod folder, I call the source folder. There is more to a mod than it's source. No, the bin and build folder are not created in the source folder. The only thing in the source folder is the source. I don't like keeping things like PSD/MAX files in the same folder as ready to use source.

It looks like
  bin
    WinData
    x32
    x64
    xWMAEncode.exe
  modname
    bin
    build
    source

I clean the bin and build folders often.

The bin folder has the complied code before it's packaged. The build folder is where the pkm file is created, and the source is where the source that needs compiling is.

I've recreated it a few times, and it still doesn't show up in game. I know it's that I'm doing something wrong, but it's not the script to make it.