Civitar said:
I saw you were working on a Blight effect for Éa, and I'd appreciate some help doing something similar. (Yes, I downloaded Éa, but I can't play it - no BNW).
I'm looking to make two new features, like forest or marsh:
- Chaos Waste: Should only appear at the poles (north and south). Will very slowly spread. I want it to look like your blight with Krakatoa's effect, so it has gouts of flame shooting up. It should damage units on it, but not units adjacent to it.
- Magical Energy: I want it to look like blue-purplish fallout. It should damage units on it, but not units adjacent to it. It should be fairly rare.
I don't really know how to do any of these, so can you help? I'd prefer if it could be done as entirely new feature types, so that I can delete all vanilla features with SQL (which, btw, is working out grand for me - thanks for the tip-off!).
Thanks as always.
OK, this is doable but it is very complicated due to hard-coded limitations. If you read
this reference, you will know that you can't delete features as you've indicated. Here are the rules you have to follow:
- Don't change names or IDs for any of the first 7 features (ids 0 - 6). They are hard-coded in both dll and graphics engine (even dll modders can't do anything about the latter).
- Only the first 7 features will update graphically if changed in-game. Atoll and the NWs and any you add won't (note: graphics will work for a permanent feature there at game start).
- Improvements and resources will update graphically in-game.
My mod has two "bad" plots that spread: Blight and Breach. Blight is the one you probably saw in a screenshot. Breach is that plus the base Civ5 fallout. Based on rules above, you should realize that these
aren't just features! If you dig through my mod code, you will find:
FEATURE_BLIGHT
IMPROVEMENT_BLIGHT
RESOURCE_BLIGHT
The first one has ArtDefine = "dummy". It isn't linked to any art asset (and I was very careful in my SQL to preserve IDs 0-6 as they are). Both the blight improvement and resource are linked to the new blight art. Blight in my mod is always:
FEATURE_BLIGHT plus (IMPROVEMENT_BLIGHT or RESOURCE_BLIGHT)
The feature provides the yield effect (-4f iirc) and the graphic is provided by the improvement or resource. So the feature is always paired with the improvement or resource. The mod decides whether to apply the improvement or resource based on some complicated Lua. The problem here is that if I use improvement, it will overwrite any existing improvement. Or if I use resource, then it will overwrite any existing resource. I wanted my blight to destroy most improvements anyway, but some I waned to save so in those plots I use the blight resource.
Breach is just the base FEATURE_FALLOUT paired with the blight improvement or resource. FEATURE_FALLOUT is one of the "privileged" 7 features, so it will update just fine.
You can find all of this in my mod. The blight feature, improvement and resource are all added in CoreTables/Terrain.sql (you can also see here the complicated way that I preserve IDs 0-6 while adding stuff after). The Lua logic for applying blight or breach is in EaMain/EaPlot.lua, functions BlightPlot() and BreachPlot().
I
think that you can modify the existing fallout feature graphic to recolor it. But no promises there. A surprising amount of the feature stuff is hard-coded in graphics engine.