v12 Integrated mod loader

General discussion about the game

Re: v12 Integrated mod loader

Postby Atoning Unifex » Mon Mar 18, 2013 3:15 pm

supermalparit wrote:Actually the gen_XXX files are completelly replaced, so, you can have a mod that adds new campaigns/maps.

Yeah that's the way that I did it with my Mod Manager too. I was asked if amending existing map files would be possible though. The reason being that if someone created a mod that adds a special terrain seed to maps (In this original thread it was 'fishing sites' before fishing was in the game) then, if amending existing maps wasn't possible, they would have to provide copies of each map they wanted their mod to work with. By allowing map amendment it would be theoretically possible to provide just the core mod plus the seed to be added to the map. It's certainly not essential functionality but might be worth considering...?

supermalparit wrote:Yes, the menuXXX files are actually a problem, but we are still working on the mod loader.

Seems that the simplest way around this is to add a required unique ID attribute to each menu item. This way it's easy to match up mods with actual menus. Of course then there's the problem of positioning new menu items and sub menus.... Hmm, good luck with that!! ;)
Atoning Unifex
 
Posts: 340
Joined: Wed Sep 05, 2012 11:28 am

Re: v12 Integrated mod loader

Postby supermalparit » Mon Mar 18, 2013 9:39 pm

Well, actually it is "solved" by doing an internal merge of the menus.

So, if the modded menu_right.xml (for example) just have a
Code: Select all
<walls>
   <wooden>
       <item ..... />

the new item will be added to the walls/wooden submenu.
Xavi Canal
Image
User avatar
supermalparit
Towns team
 
Posts: 2444
Joined: Thu Oct 27, 2011 11:57 pm

Re: v12 Integrated mod loader

Postby Colombo » Mon Mar 18, 2013 9:53 pm

what about mods that want to redefine whole menu?

What about tag for modloader so he would know if original file would have to be:
1. Replaced
2. appended
3. ???
4. Profit
by mod file.
User avatar
Colombo
 
Posts: 737
Joined: Mon Jan 23, 2012 5:55 pm

Re: v12 Integrated mod loader

Postby ericb1800 » Mon Mar 18, 2013 10:54 pm

OK here is the issues I know of with the current Mod Manager...

If I have 2 mods, 1 that adds corn and another that adds tomatos... In order to get the gen_map to be able to seed both of these mods in the same map would be to create a new map with both seeds... You cant install 1 mod(corn) and its gen_map changes then install the 2nd mod(tomatos) and its gen_ map changes...
We need to be able to add multiple mods that change/add to the same gen_map file and any custom maps...

The menu.xml file is an issue because of adding mutiple mods with actions to say edit the Harvest command...

No sound.ini compatibility...

Adding/Changing/Order of categories and items, both new and changed/deleted...

Mods that change the same item but different tags...
ericb1800
 
Posts: 815
Joined: Sun Nov 25, 2012 7:17 pm

Re: v12 Integrated mod loader

Postby supermalparit » Tue Mar 19, 2013 9:51 am

Modded audio.ini

About the menu, this is an example of what you can do with the integrated loader:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<menu>
   <walls>
      <!-- This deletes the walls/log menu completelly -->
      <log delete="true"/>

      <!-- This adds a new log menu at the end of the walls menu -->
      <log name="Log walls" esES="Muros de troncos" icon="ui_l_walls">
         <item code="QUEUEANDPLACEROW" parameter="qlogblock2" />
         <item name="Back" esES="Atrás" code="BACK" icon="ui_back" />
      </log>


      <!-- This deletes the content of the walls/wooden menu -->
      <wooden deleteContent="true" />

      <!-- This changes the name of the walls/wooden menu and adds a new item at the end of it -->
      <wooden name="Wooden shitty walls" esES="Muros de madera mierdosos">
         <item code="QUEUEANDPLACEROW" parameter="qlogblock2" />
         <item name="Back" esES="Atrás" code="BACK" icon="ui_back" />
      </wooden>


      <!-- This adds a new item at the end of the walls/stone menu -->
      <stone>
         <item code="QUEUEANDPLACEROW" parameter="qlimestoneblock" />
      </stone>
   </walls>
</menu>


The loader allows the change of different tags on items/livings/... etc on different mods (2 mods can coexist editing the same item).
The loader also alows the modification of the normal campaigns (and tutorials), and you can also add new campaigns.

I still have to check the gen_XXX files and, somehow, allow the order of items on the menuXXX.xml's
Xavi Canal
Image
User avatar
supermalparit
Towns team
 
Posts: 2444
Joined: Thu Oct 27, 2011 11:57 pm

Re: v12 Integrated mod loader

Postby YetiChow » Tue Mar 19, 2013 9:58 am

supermalparit wrote:Modded audio.ini

About the menu, this is an example of what you can do with the integrated loader:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<menu>
   <walls>
      <!-- This deletes the walls/log menu completelly -->
      <log delete="true"/>

      <!-- This adds a new log menu at the end of the walls menu -->
      <log name="Log walls" esES="Muros de troncos" icon="ui_l_walls">
         <item code="QUEUEANDPLACEROW" parameter="qlogblock2" />
         <item name="Back" esES="Atrás" code="BACK" icon="ui_back" />
      </log>


      <!-- This deletes the content of the walls/wooden menu -->
      <wooden deleteContent="true" />

      <!-- This changes the name of the walls/wooden menu and adds a new item at the end of it -->
      <wooden name="Wooden shitty walls" esES="Muros de madera mierdosos">
         <item code="QUEUEANDPLACEROW" parameter="qlogblock2" />
         <item name="Back" esES="Atrás" code="BACK" icon="ui_back" />
      </wooden>


      <!-- This adds a new item at the end of the walls/stone menu -->
      <stone>
         <item code="QUEUEANDPLACEROW" parameter="qlimestoneblock" />
      </stone>
   </walls>
</menu>


The loader allows the change of different tags on items/livings/... etc on different mods (2 mods can coexist editing the same item).
The loader also alows the modification of the normal campaigns (and tutorials), and you can also add new campaigns.

I still have to check the gen_XXX files and, somehow, allow the order of items on the menuXXX.xml's


Thanks for the explanation, it's already looking like a nice, simple system but still robust enough to be very fun to mess with :D

Out of curiosity, will that new wooden wall category be making it into the official game? I can just see the reaction to that :lol:

This is going to be one hell of an update :mrgreen:
What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.
User avatar
YetiChow
 
Posts: 3149
Joined: Wed Apr 25, 2012 9:26 am
Location: Cramped between a Yeti's small intestine and its stomach... trying not to dissolve!

Re: v12 Integrated mod loader

Postby supermalparit » Tue Mar 19, 2013 10:10 am

YetiChow wrote:Out of curiosity, will that new wooden wall category be making it into the official game? I can just see the reaction to that :lol:


Oppps! I have to stop using "funny" words when develop :)
Xavi Canal
Image
User avatar
supermalparit
Towns team
 
Posts: 2444
Joined: Thu Oct 27, 2011 11:57 pm

Re: v12 Integrated mod loader

Postby supermalparit » Tue Mar 19, 2013 11:18 am

New feature to delete items of the original menus.

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<menu>
   <walls>
      <!-- This deletes the walls/log menu completelly -->
      <log delete="true"/>

      <!-- This adds a new log menu at the end of the walls menu -->
      <log name="Log walls" esES="Muros de troncos" icon="ui_l_walls">
         <item code="QUEUEANDPLACEROW" parameter="qlogblock2" />
         <item name="Back" esES="Atrás" code="BACK" icon="ui_back" />
      </log>


      <!-- This deletes the content of the walls/wooden menu -->
      <wooden deleteContent="true" />

      <!-- This changes the name of the walls/wooden menu and adds a new item at the end of it -->
      <wooden name="Wooden shitty walls" esES="Muros de madera mierdosos">
         <item code="QUEUEANDPLACEROW" parameter="qlogblock2" />
         <item name="Back" esES="Atrás" code="BACK" icon="ui_back" />
      </wooden>


      <stone>
         <brick>
            <!-- This deletes 3 items of the stone/brick menu -->
            <item id="qstonebrickblock" delete="true" />
            <item id="qstonebrickblock2" delete="true" />
            <item id="qstonebrickblock3" delete="true" />
         </brick>

         <!-- This adds a new item at the end of the stone menu -->
         <item code="QUEUEANDPLACEROW" parameter="qlimestoneblock" />
      </stone>
   </walls>
</menu>


Note that the original items will have a scripted id (I will use the parameter value for them)
Xavi Canal
Image
User avatar
supermalparit
Towns team
 
Posts: 2444
Joined: Thu Oct 27, 2011 11:57 pm

Re: v12 Integrated mod loader

Postby ericb1800 » Tue Mar 19, 2013 1:17 pm

Sounds like you have already fixed the issues that have arose with other mod managers...
ericb1800
 
Posts: 815
Joined: Sun Nov 25, 2012 7:17 pm

Re: v12 Integrated mod loader

Postby Atoning Unifex » Tue Mar 19, 2013 2:33 pm

Looking great! A couple of questions:

supermalparit wrote:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<menu>
   <walls>
      <!-- This changes the name of the walls/wooden menu and adds a new item at the end of it -->
      <wooden name="Wooden shitty walls" esES="Muros de madera mierdosos">
         <item code="QUEUEANDPLACEROW" parameter="qlogblock2" />
         <item name="Back" esES="Atrás" code="BACK" icon="ui_back" />
      </wooden>


      <!-- This adds a new item at the end of the walls/stone menu -->
      <stone>
         <item code="QUEUEANDPLACEROW" parameter="qlimestoneblock" />
      </stone>
   </walls>
</menu>



In the first code snippet you add in a new item plus a 'back' button, however in the 2nd snippet you do not. Would the first example replace the existing back button so that it nw appears at the end? Or would there now be 2 back buttons? In the second button should you have theoretically added a new back button?

supermalparit wrote:I still have to check the gen_XXX files and, somehow, allow the order of items on the menuXXX.xml's


This was something I spent a lot of time considering when I was working on Mod Manager (the menu ordering that is!). I had a numer of ideas:
* Add mod specific positioning attributes to the XML, like 'AddAt=5' to place an item in the 5th place in a menu. 'AddAtStart="true"'/'AddAtEnd="true"' should be self explanatory - although adding at the end of a menu would really need to take the back button into consideration, perhaps allow numbers in these attributes to allow placement relative to the start or end, like end-1 to go before the back button. Something like this is probably the most flexible, and my personal favourite.
* Always add new sub menu's at the top of the parent menu (either at the start or after the last existing sub menu), and always add new menu items at the end of the parent menu, but before the back button. This is inflexible but has a fairly sensible standard.
* Add new sub menus and menu items to the end of the parent menu and then perform an alphabetical sort of the resulting XML such that sub menus are always at the start. This is also inflexible but could be simple to implement.
* It just occured to me that you could possibly add a position attribute to all the core menu items, rather than just modded ones as in my first suggestion. This could be combined with a sort of the menu files by position before use in game. Not sure if this has any advantages over my first suggetion but there you go!

Good luck! ;)
Atoning Unifex
 
Posts: 340
Joined: Wed Sep 05, 2012 11:28 am

PreviousNext

Return to General discussion

Who is online

Users browsing this forum: No registered users and 9 guests