Thanks Deep Blue for the code and workaround suggestions!
A simple solution to the resource map-location allocation problem occurred to me. This extremely oversimplified approach might work perfectly for some, but not others.
If (and this is a big if) a mod has the same number of resources desired as the original, the resource allocation logic could be tricked by the names of the references to the details of the resources.
Supposing I wanted a zinc resource instead of Iron. I could simply replace all XML details referred to as "Iron" with the details of my zinc resource (including the in-game and Civilopedia text of "zinc" for this Iron resource slot). I would have "zinc" details behind RESOURCE_IRON and TXT_RESOURCE_IRON_DESCRIPTION type references. The allocation logic would then probably distribute my zinc resource in exactly the same manner Iron is currently placed onto the map.
The downside, is that no true Iron resource would be allocated. Perhaps I could put the details for the Iron resource in what the Lua allocation logic refers to as "Uranium" or a "strategic" resource. I could change all the XML details for Uranium references to match the original XML definitions of Iron. I would be placing the iron details behind the RESOURCE_URANIUM style references. I would not mind at all if Uranium was not available as a resource. In the XML, I could even mod all Uranium dependent items (units, buildings, etc.) to no longer be dependent on Uranium if I wish. The reason I wouldn't start by replacing URANIUM references with my new "zinc" definitions would be that URANIUM might have aspects I prefer to be applied to the old Iron definitions. It would just seem easier in some cases by playing musical chairs in rearranging the resource definitions.
This is a very limited approach. But it might work for those who wish to add a new resource, and are willing to remove, eliminate, or ignore an existing "vanilla" resource from the same class (bonus, luxury, strategic).
This approach might be very appropriate for a mod I am currently working on. My goal was to start each of 12 civilizations with a unique luxury resource requiring the plantation improvement within each capital city. Since there are only 9 plantation improved luxury resources in BNW, this was not possible (only 8 in G&K prior to cocoa). I think I will try to simply trick the game in the way I suggested by plugging in my additional new plantation improved luxury resource details into the slots currently used for coastal (fishing boat improved) luxury resources. I will change the XML details such that previous fishing boat improved resources become plantation improved. Of course I would need to switch up the terrain booleans.
Crossing my fingers. Will probably post about the success or failure of this hair-brained approach afterward.
I haven't seen anything in code or XML files to indicate that the reference name of a resource has anything at all to do with resource map allocation logic. However, the behavior I am observing is that only the original vanilla resources are ever allocated on any map automatically generated with my mod. This happens either without modding any allocation logic, or alternatively attempting to use your approach. In other words, all of my newly created resources are totally being ignored in the resource map-location allocation process.
With my typical approach to things in life, I was having so much fun creating a few new resources that I went a little overboard and ended up creating 37 new resources altogether. LOL That is far too many for a balanced game on even the largest map. But at least I'm not stuck with the standard boring ones I've seen a thousand times before. At least, I mean, I am only stuck with the in-game 3D animated graphical representations of the vanilla resources (until I learn how to mod 3D graphics).
I was not successful in following your suggested approach. I probably set things up incorrectly or didn't follow instructions perfectly. Or maybe 37 new resources were even too much for your approach. Or maybe something has changed with BNW which is preventing my mods to work with your approach. I'm not too worried, because my original plan for a mod adding 37 new resources was to only use maps where I explicitly designate resource locations by creating a map in World Builder. Probably not worth my time to debug what I might have done wrong attempting to follow your approach.
By the way, last night, I was about ready to dive into the 3D animated graphics modding world. But it occurred to me at the last minute that much of my learning curve might be completely obsoleted with the release of Civilization 6. I am sure I would gain much generally applicable experience (within the gaming industry) by learning how to mod things in the Civilization 5 manner. I just don't have the slightest clue about how much of the acquired knowledge would become a total waste relative to Civilization 6.
I would appreciate if you (or anybody else) could provide some insight about your best guess regarding how much of my Civ 5 graphics learning curve might help in Civilization 6 3D animated graphics mods. You seem to be fairly proficient, experienced, and knowledgeable on the topic even if you have absolutely no inside information about Civ 6 yet. I am a software developer and reasonably adept at learning such things. I am not too inept at artistic matters in general either (I use Gimp often). I already understand many of the theoretical concepts of animated 3D graphics.
Thanks again.