Welcome to Black Liquid Software

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Necora

Individual tool bar icons for mods

26 posts in this topic

Good day everyone,

I was playing around with getting my own space on each sub-tool bar, so that I can break my main mod up and release bits independently, with out worrying about multiple placement issues or spamming up existing tool bars.

First, I started a new mod, based on the apiary example. I made a trapper. In the 'MyMods/Trapper folder', I added another folder, 'Game' and a file 'NecoraToolbar.rsc' so it is 'MyMods/Trapper/Game/NecoraToolbar.rsc'. This rsc looked like this...
 

Quote
- MyMods/Trapper/Game/NecoraToolbar.rsc

Toolbar base
{
   StringTable _stringTable = "Dialog/NecoraTBStringTable.rsc";
   SpriteSheet _spriteSheet = "Dialog/NecoraTBSpriteSheet.rsc";
}

ExternalList resource
{
   External _resources
   [
      "NecoraFood",
      "NecoraHousing"
   ]
}

Toolbar NecoraFood : "base"   
{   
   Toolbar _parent = "Game/Toolbar.rsc:food";
   int _sortPriority = 100;

   String _toolTip = "NecoraFoodTip";   
   String _image = "NecoraFood";
   Action _action = ShowGroup;

   bool _autoHotKey = true; 
   Keys _hotKey = Toolbar1; 
}

Toolbar NecoraHousing : "base"   
{   
   Toolbar _parent = "Game/Toolbar.rsc:housing";
   int _sortPriority = 100;

   String _toolTip = "NecoraHousingTip";   
   String _image = "NecoraHousing";
   Action _action = ShowGroup;

   bool _autoHotKey = true; 
   Keys _hotKey = Toolbar1; 
}
 


You'll see I added a sprite sheet (and associated texture, material etc.) into the 'Trapper/Dialog' folder, along with a string table. The sprite sheet just points to a few 32x32 icons, in this case one, a maple leaf, for each tool bar icon. Same with string table.
 

Quote
MyMods/Trapper/Dialog/NecoraTBStringTable.rsc

StringTable resource
{
   Entry _strings
   [ 
      { String _name = "NecoraFoodTip";            String _text = "Necora's Food"; } 
      { String _name = "NecoraHousingTip";            String _text = "Necora's Housing"; } 
   ]
}
 

 

Quote
MyMods/Trapper/Dialog/NecoraTBSpriteSheet.rsc

SpriteSheet resource
{
   String _materialName = "NecoraTBSpriteSheetMaterial.rsc";
   String _imageName = "Build/NecoraTBSpriteSheet.png";
   int _imageWidth = 256;
   int _imageHeight = 256;
   bool _padForFiltering = true;
   
   Sprite _sprites
   [ 
      { String _name = "NecoraFood";         String _source = "Dialog/MapleLeaf.png"; }
      { String _name = "NecoraHousing";      String _source = "Dialog/MapleLeaf.png"; }
   ]
}
 


So now, I can add a tool bar icon to each sub menu, one for housing, food, storage, industry etc.

All I need to do, is make sure that these files are in the 'Dialog' and 'Game' folder of every mod I break my big one up into.

For example, I made this trapper, then copied the whole Trapper folder, renamed it AnotherTrapper, and three files within to AnotherTrapper/AnotherTrapper.rsc, AnotherTrapper/AnotherTrapperResources.rsc, and AnotherTrapper/Template/AnotherTrapper.rsc. Everything else was left the same. I built and packaged it up.

I moved both mods, Trapper.pkm and AnotherTrapper.pkm into my Windata in the steam folder, fired it up, enabled both mods, loaded a game, and the results are in the attached picture. As you can see, there is 1 maple leaf icon in the food tool bar, and both trappers are sitting happily side by side within it, despite both being separate mods.

ToolBar.jpg.d5c0d59226a6ee507baa404b39a91140.jpg


So modders can have their own menu on either the main tool bar or in different sub tool bars, with all individual mods into it with no crashes etc.!

Somebody with lots of separate mods please test this!

Edited by Necora
2 people like this

Share this post


Link to post
Share on other sites

Did you actually test it creating a main toolbar icon, or just assume that it would be the same since the sub-toolbar worked? I haven't actually tested it myself, but RedKetchup has worked on it, and even has an email from Luke about it, and doing it with a main toolbar never worked for him, it just created a second copy, instead of merging them into one.

Share this post


Link to post
Share on other sites

I didn't test the main toolbar just the secondary.

I would assume you put the main toolbar in this folder as well and it should work. I'll try it tonight when I get back from skating (adult learn to skate, fun times).

 

Edit - Ketchup did show me the email from Luke, and I think this is what he might have been getting at, just he didn't explain it very well in the email...

Edited by Necora
1 person likes this

Share this post


Link to post
Share on other sites

i confirm ! i did what Luke email said : never worked

 

i did what Necora said : it worked awesome !!!!

never Luke talked about the Game folder (and Dialog folder) in his email .. i just verified.

 

Look at my screenshots :

RKBeachParty.pkm

ChooChoo.pkm

RKTrainingCamp.pkm

CountryLittleHouse.pkm

newmedievaltown.pkm

 

all gone to set on my RK Toolbar at the base ^^

 

Fifth mod.jpg

First mod.jpg

Fourth mod.jpg

Second mod.jpg

Third mod.jpg

1 person likes this

Share this post


Link to post
Share on other sites

:D so that mean ... you guys can do a CC icon at the base and put everything you ve done inside it and free everything else :D

1 person likes this

Share this post


Link to post
Share on other sites

@KetchupI'm confused about what you did differently this time that you didn't do last time? Just put the toolbar in the Game folder?

Share this post


Link to post
Share on other sites

he is adding mods under his own toolbar icon.he now has his own icon button to add mods to at will.super awesome

2 people like this

Share this post


Link to post
Share on other sites

exactly the RKtoolbar.rsc in Game folder , its spritesheets files and stringtable (and all icons) in dialog (changed the links from /UI/ to /dialog/ inside the files) and everything worked out.

 

and i just copy paste my game folder and my dialog folder in all my mods and everything go sit there)

of course all the mods you want to sit on RK icons needs to be changed to go sit on RKtoolbar.rsc:RKtoolbar (instead of game/toolbar.rsc:food for example)

 

 

Edited by Ketchup
2 people like this

Share this post


Link to post
Share on other sites

screenshot of my RKtoobar.rsc 

 

and screenshots of all my other files

Game rktoolbar.jpg

RK new setup.jpg

2 people like this

Share this post


Link to post
Share on other sites
16 minutes ago, stiles said:

he is adding mods under his own toolbar icon.he now has his own icon button to add mods to at will.super awesome

everyone can now do that... i mean... all people like us who made hundreds and thousands of buildings :) everything we do we can put it on our own toolbar and free everything else :)

people will stop to get headaches each time they open the game ^^

2 people like this

Share this post


Link to post
Share on other sites

It boggles my mind that the location of the toolbar file would have any effect on it's appearance in the game.  That seems like a poor way to write the game.

Share this post


Link to post
Share on other sites

Just to learn about the aesthetics and moving forward .... 

@Ketchup does this mean that you can release a single mod, and have it reference that toolbar, and it show in that toolbar, without having to release an entire update.
@Necorathis breakthrough then means that how you were envisaging Maritimes can happen, and importantly (for some wary of download bloat & game bloat (not me, I'm fine :D)) it means that as you finish one part of the concept you can release it, to your own toolbar, and them move on to the next without everyone having to download Maritimes again?

If this is correct, then that is an even bigger breakthrough than I thought.  It means that modders can be releasing content in such a way that players aren't required to download 80+ mb files, repeatedly, beta tests can happen more frequently.

This stuff is big. :)

1 person likes this

Share this post


Link to post
Share on other sites

@Kralyerg I have no idea if the location of this NecoraToolBar.rsc or RKToolBar.rsc makes any difference.

Here was my thinking about it. I figured, if we want to put a mod into the food tool bar, in the MyMods/Trapper/Trapper.rsc file we list our tool bar, which refers to the parent tool bar which is 'food' in the Resoure/Game/Toolbar.rsc. So I figured, why can't we do that with mods? Refer all individual mods to one master tool bar file? So I simply copied the Resource/Game/Toolbar.rsc, removed everything and added my own tool bar slots in the same manner, then placed this into a Trapper/Game folder. This NecoraToolbar.rsc refers back to the Toolbar.rsc in Game/Resource to read for the 'food' or 'housing' toolbars etc. I guess you could just edit the original Toolbar.rsc, keep it the same name, and move it to your own Game folder in the mod so it gets incorporated. I custom named it as I figure then everyone can do the same and there will be no conflicts between mods.

I think if you try to make the communal tool bar in the MyMods/Trapper/Trapper.rsc file, then each mod will try to make it new and it will result in crash errors or nothing in the tool bar. But if you make them all refer to the exact same CustomToolbar.rsc then they will all build the exact same thing? I'm not sure but I think this is why. I don't think it has to be in the game folder, I think it just has to refer to a CustomToolbar.rsc which is identical in all mods using this, in the same way that we refer to the Toolbar.rsc in the Game folder of the Resource folder. I used Game because that is where it is in the original resource with mod kit, same as why I used dialog.

I think the important thing is keeping these toolbar and spritesheet/stringtable files the exact same in different mods, so it needs updating for all with new instances or it needs some fore planning form the modder.

3 people like this

Share this post


Link to post
Share on other sites
45 minutes ago, QueryEverything said:

this breakthrough then means that how you were envisaging Maritimes can happen, and importantly (for some wary of download bloat & game bloat (not me, I'm fine :D)) it means that as you finish one part of the concept you can release it, to your own toolbar, and them move on to the next without everyone having to download Maritimes again?

I didin't actually think about it but yes, I guess the maritimes no longer needs to be one large mod, as the toolbar icon was the only thing really limiting that. Now everything can be truely modular, and released as added updates. Also means that if I want to change something with the PEI set, I can just package that up individually.

4 people like this

Share this post


Link to post
Share on other sites

Oh wow, @Necora this is big :)  
It may mean a lot for future development ...  Means a lot too for the players that can't game OR download the larger files as they get to really pick and choose, if the dev mods that way.
Very exciting!  I love seeing breakthrough unfold :D:D  (If you can't guess, I love software dev, just can't do it, lol)

1 person likes this

Share this post


Link to post
Share on other sites

Well I tried to make a 'CommonToolbar' on the main toolbar for if people want all modders to have their own icon within this, but I can't test it because I don't have enough individual mods! So I sent to to Ketchup, he will give it a go and see if it works.

2 people like this

Share this post


Link to post
Share on other sites

Update, @Ketchup and I have been testing this out and we managed to make a common tool bar icon on the main toolbar, within which any modder can add their own toolbar space to put their mods.

In the example below I coded up two separate mods, packaged them, and put them in windata. The first on the left is a 'farming mod' called Red's mods, with a cow icon (first one I came to). It only consists of a trapper inside a food tool bar inside the Red's Mods menu inside the Common Modders menu. The second is the PEI Shore set extracted from the maritimes mod, placed into the PEI Shore toolbar inside the Necora's Docks tool bar inside the Necora's Mods tool bar inside the Common Modders menu.

Both mods sit nicely inside the common menu. The only thing which is the same inside the two mods is a 'CommonToolbar.rsc' in the Game folder and associated sprite sheet and string table inside the Dialog folder. Then in the Red's Mods there is a RedToolbar.rsc inside the Game folder that organizes the different Red's Mods, and links to the CommonToolbar.rsc as the parent tool bar. The same is in the Necora's Mods, only NecoraToolBar.rsc.

Test01.jpg.7bd4284f3ec27eb6c03482ab3e4f051f.jpg

Test02.jpg.52fd6069e8aa1bd2f771cdd2045ff5a3.jpg

Test03.jpg.b8e65cc4b2d1715c513eb9beaa8ed132.jpg

Test04.jpg.8267f95d4924bd33c40aa8590a776fd3.jpg

3 people like this

Share this post


Link to post
Share on other sites

CommonToolbar Icon Kit.

Place this kit inside all your mods. (along with your PersonalToolbar Icon kit)
This is the common icon toolbar "at the base of the main toolbar" for all the moddlers.
All the moddlers will have all their personal Icon and will set all their mods on their personal toolbar.


ENJOY !!


********************************

PersonalToolbar Icon Kit

Do your personal Icon kit and place it inside all your mods. (along with the CommonToolbar Icon kit)
This is your personal icon toolbar "at the base of the Common Toolbar" for all your mods.
All the moddlers will have all their own personal Icon and will set all their mods on their personal toolbar.


ENJOY !!


i provide 2 examples: Personal NecoraToolbar Icon Kit.zip and Personal RedketchupToolbar Icon Kit.zip
to help you to get an idea of how to set up your own personal toolbar icon kit. (dont put other people personal kit in your mods, this is their icon. You , you will do your own one.)

when you will do a mod, you will ask to go sit on your own personal Icon (instead to go sit anywhere else in the vanilla toolbars)

like for example, my mods will be : 
    Toolbar _parent = "Game\RKToolbar.rsc:RKtoolbar";    
or
    Toolbar _parent = "Game\RKToolbar.rsc:RKhousing";    
.....

and Necora will put:
    Toolbar _parent = "Game\NecoraToolbar.rsc:NecoraToolbar";    
or
    Toolbar _parent = "Game\NecoraToolbar.rsc:Necorahousing";    
.....

if you need sub toolbars... you set it up inside your personal toolbar :) (like those "housing" )

CommonToolbar.zip

Personal NecoraToolbar Icon Kit.zip

Personal RedketchupToolbar Icon Kit.zip

2 people like this

Share this post


Link to post
Share on other sites

Awesome find/work @Necora and awesome work @Ketchup for the extra testing. This should make the toolbar a lot easier for everyone to use, modders and players! :)

3 people like this

Share this post


Link to post
Share on other sites

@KevinTheCynic I hope so. It will empty the vanilla tool bars, one reason for not doing modular maritimes was that I didn't want to spam them up with a load of fishing stuff, and make things easier to find. It also gives modders the flexibility to organise their own tool bars as they see fit, so they can be done by theme set, or following the vanilla template etc. 

If only my internet was good enough for me to upload today, I'd have the PEI shore set up with this new tool bar. Unfortunately it is too slow and it looks like I might be stuck at home for a few days with the 60 cm of snow we're getting tomorrow.

Edited by Necora
2 people like this

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0