[XML] Can we add yields / resources

Gorbles

Load Balanced
Joined
Nov 24, 2014
Messages
11,892
Location
UK
And if so, can anyone point me in the right direction?

I realise resources are referenced all over the damned place, so I'm not asking for straight out code-examples, just the right file names to draw from would be good enough to get me going.

Will edit with what code I have this evening.

Moderator Action: Moved to Help and Creation subforum.
 
In addition to their XML/SQL definition, new resources would require new 3D-map graphics (non-trivial), changes to the dreaded AssignStartingPlots.lua to add them to maps and a font icon (see your other post for problems with adding these)

Your best place to get examples would be from the CivV mods that add new resources - there are lots of them.
 
AssignStartingPlots.lua is an absolute mess. There must be a way to make the code moderately shorter (6,000 lines or so, including comments, wowzer).

Important notes though.

Apparently BE doesn't use XML and the boolean operations to define resource yields anymore. It's done entirely through AssignStartingPlots.lua (as I understand it rendering a lot of the XML redundant, but hey). It states this in the comment block at the end of that LUA file (comprehensive comments, it's just that the file is mammoth).

Additionally, Affinity-specific resources (Floatstone, Xenomass and Firaxite only; Titanium doesn't count - but apparently counts as one of the few actual strategic resources) are each assigned specifically to their own tileset (Xenomass is Forest, Firaxite is Tundra and I think Floatstone is Plains). This makes adding similar resources very tricky (as that's most of the tiles covered).

Managed to break the map in my efforts so far, but will update this until I get it working, or someone else shows me up and does it in half the time :D
 
In addition to their XML/SQL definition, new resources would require new 3D-map graphics (non-trivial), changes to the dreaded AssignStartingPlots.lua to add them to maps and a font icon (see your other post for problems with adding these)

Your best place to get examples would be from the CivV mods that add new resources - there are lots of them.

I had the same question as OP: is it possible to create a new yield type? Not a new resource type, a new yield type, like :c5faith: was.

I am interested in turning the Affinity system into a yield system, based on Improvements. So Terrascapes would yield PurityYield, Arrays would yield SupremacyYield etc.

I'd have no need for new graphics and no need to assign a new resource to the map: players' actions will determine which tiles generate these yields, just as with placing a Manufactuary. I'd even be reusing existing fonticons.

But this does depend on whether it's possible to create (and manipulate) a new yield type.

So would adding three new lines to the Yield table set up three new counters? And would adding new lines to the Improvement_Yields table make improvements increment these new counters?

Has anyone ever produced a mod for [civ5] that creates a new yield type?

I would just go ahead and test, but I'm so completely new to modding that when it fails I'm not confident it won't be because I've done something wrong or forgotten something obvious.
 
It's easy to add a new yield type to the Yields table ... but, the game core will not know what to do with it so ...

So would adding three new lines to the Yield table set up three new counters?
No

And would adding new lines to the Improvement_Yields table make improvements increment these new counters?
No

Has anyone ever produced a mod for [civ5] that creates a new yield type?
Yes (including me) but it involves either extensive DLL or Lua code to make the game do something with it
 
Thanks. Disappointing, but that's saved me a whole lot of wasted effort.
 
Top Bottom