1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Additional Yield Change Tables 1.0

This modcomponent adds several new finer-grained YieldChange tables for other mods to use.

  1. Castar
    What
    This is a modcomponent that allows other mods to make use of some extra YieldChanges tables (which change Plot yields). This mod has no in-game effect on its own.

    The new tables are:

    - Improvement_FeatureYieldChanges
    - Improvement_ResourceYieldChanges
    - Technology_FeatureYieldChanges
    - Technology_ResourceYieldChanges
    - Building_FeatureYieldChanges
    - Building_ResourceYieldChanges

    Why
    The "vanilla" YieldChanges tables, such as Improvement_YieldChanges, are sometimes too limited. Improvement_YieldChanges, for example, will add a YieldChange (e.g. +1 Food) to all plots that have the given Improvement. There is no way to distinguish yields by the resource that is improved or the feature on the plot tile, for example.

    This modcomponent adds tables which allow for a finer control over yield changes. For example, the tables Improvement_FeatureYieldChanges and Improvement_ResourceYieldChanges allow a modder to specify a yield change for an improvement, given that a specific feature or resource is present on the improved tile. This allow for a much more fine-grained control on the yields for a mod.

    How
    Through the magic of Modifiers and LoadOrder!

    The mod adds the new tables early in the process. Sometime later (to allow for other mods to add features/resources), it will generate RequirementSets for all (non-Natural-Wonder-)features and all resources. Then, with a very high load order (i.e. after another mod has potentially added stuff to the new tables), it will process the contents of the new tables and generate the required Modifiers to make everything work.

    Technical:
    - At Load Order -100: Create the new tables
    - At Load Order 222050: Generate RequirementSets based on the contents of the Resources and Features tables
    - At Load Order 1222050: Generate the necessary Modifiers based on the contents of the new tables.

    How do I use this in my mod
    If you Require this mod in your mod, you can use the new tables without much problem. If you only do simple things in your mod, you shouldn't really worry about load order. If you have a complex mod that needs LoadOrder for doing its own thing, just make sure that it doesn't conflict with the above load order, i.e. don't try to use the new tables before LoadOrder -100, add your new Features and Resources before LoadOrder 222050, and don't count on this mod doing anything after LoadOrder 1222050.

    Compatibility
    As long as the above load order guidelines are followed, this should be compatible with anything (since it doesn't do anything on its own).

    Known issues
    The tooltip for a Builder's build actions does not accurately reflect the yield changes that will happen when an improvement is built. I'll see if I can fix this in a generic way, but I'm not a good LUA modder and I don't want to maintain compatibility with all the UI mods out there.

Recent Reviews

  1. qqqbbb
    qqqbbb
    5/5,
    Version: 1.0
    Useful for modders