• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.
Resource icon

Additional Yield Change Tables 1.0

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.
Author
Castar
Downloads
491
Views
510
First release
Last update

Ratings

5.00 star(s) 1 ratings

Latest reviews

Useful for modders
Back
Top Bottom