Default Types V1.0.1

Default Types v1.0

This is a little addon that changes the way fill types and fruit types are loaded. Normally, xml files from the game install folders load first, then the map information is loaded and added to those existing entries. That is fine in most cases. But there are cases where map makers would like to change or remove things that normally cannot be changed or removed.

That’s where Default Types comes in. It allows map makers bypass certain game install xml files in favor of the ones embedded in their map. This allows complete control over the configuration process. More control, however, comes with increased difficulty.

For example, in a default game a xml mistake would just cause the game to (often silently) to revert to the already loaded default value for that setting. When you override the defaults, there is no fallback or safety net. The value (or fruit type, fill type, etc.) may not load at all. Keep that in mind.

Currently supported:

  • maps_fillTypes.xml (fill type configuration)
  • maps_fruitTypes.xml (fruit type configuration)

Activating is as simple as copying the configuration xml file(s) from your game install folder to your map, then using the thDefaultTypes key in your map.xml file. Examples are included in the sdk folder of this mod.

Examples:
<fruitTypes filename=”path/to/maps_fruitTypes.xml” thDefaultTypes=”true”/>
<fillTypes filename=”path/to/maps_fillTypes.xml” thDefaultTypes=”true”/>

Also, and this is just the vanilla load process, when you specify an external filename (i.e. maps_fruitTypes.xml or maps_fillTypes.xml”) you also have to copy all related information from your map.xml to the file you specified as well. The game, by default, loads from either the file you specify -or- the map.xml not both.

For example, everything in the <fruitTypes> section (other than the filename pointer and thDefaultTypes key) would need to be copied to your map embedded maps_fruitTypes.xml file. In addition, things normally found in maps_fruitTypes.xml like <fruitTypeCategories> would need to be copied from your map.xml to your maps_fruitTypes.xml as well.

Finally, the $data filename constant does continue to work as far as I can tell. You don’t have to copy over all foliage and textures files or anything like that. Just the main configuration xml(s) and go from there.

Note: This also addresses the current fruit type double registration issue when trying to change vanilla fruit/fill type values. Double registrations will show a warning and try to self correct if this mod is enabled. You do NOT need to edit a map for this functionality. This is enabled just by activating the mod.

Changelog:

Changes in this version 1.0.1:

  • Configuration change, now all configured in the <thDefaultTypes> section of the map xml
  • Added ability to re-route densityMapHeightTypes
  • Added ability to re-route storeItems
  • Added blackList capabilities
  • Added backwards compatible code
Update v1.0.0.5:

  • Updated the way defaults are loaded, should be more efficient now
  • Added a check for double registered fill types
  • Minor bug fixes

V1.0.0.3

– Uploaded older version that still had a code type. This should now be fixed.

Download and install instructions from ThundRFS:

Note: If you are using this with a map already set up for Default Types, you don’t have to do anything other than have this mod in your mods folder and enabled in game. The instructions below are for people who want to add the functionality to a new map.

Also, as said before, you do not need to configure anything to fix the double registration issue. Again, just having this mod installed and enabled in game will address address that automatically.

Adding to your map.xml:

<map>
    <thDefaultTypes>
        <fillTypes filename="path/to/your/maps_fillTypes.xml"/>
        <fruitTypes filename="path/to/your/maps_fruitTypes.xml"/>
        <densityMapHeightTypes filename="path/to/your/maps_densityMapHeightTypes.xml"/>
        <storeItems filename="path/to/your/maps_storeItems.xml"/>
        <blackList filename="path/to/your/blackListItems.xml"/>
    </thDefaultTypes>
</map>

You don’t have to use them all. For example, if you wanted to just re-route the fruit types, you could include just the <fruitTypes> line and either comment out or remove all of the other entries from the <thDefaultTypes> section.

Remember, this is just rerouting the loading of default information (the part you normally do not see) from the game install location to a location inside of your map.  This step occurs in vanilla before the map loads. The map configuration and everything else will still load as normal with this mod installed. For example, do not make your default <fruitTypes> filename the same as your map configuration <fruitTypes> filename or it would load twice.

Example blackListItems.xml:

<thDefaultTypes>
    <blackList>
        <fruitTypes>
            <fruitType name="POPLAR"/>
            <!-- for testing purposes -->
            <fruitType name="BARLEY"/>
            <fruitType name="SUNFLOWER"/>
            <fruitType name="PARSNIP"/>
            <fruitType name="COTTON"/>
        </fruitTypes>
        <fillTypes>
            <fillType name="POPLAR"/>
            <!-- for testing purposes -->
            <fillType name="BARLEY"/>
            <fillType name="SUNFLOWER"/>
            <fillType name="PARSNIP"/>
            <fillType name="COTTON"/>
        </fillTypes>
        <densityMapHeightTypes>
            <!-- <densityMapHeightType fillTypeName="COTTON"/> -->
        </densityMapHeightTypes>
        <storeItems>
            <!-- <storeItem xmlFilename="$data/vehicles/johnDeere/cp690/cp690.xml"/> -->
        </storeItems>
    </blackList>
</thDefaultTypes>

Credits:

ThundRFS

5/5 - (3 votes)

You may also like...

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x