Is GameInfo.Natural_Wonder_Placement available in all versions of the game?

General Tso

Panzer General
Joined
Oct 12, 2007
Messages
1,547
Location
U. S. of A.
Is GameInfo.Natural_Wonder_Placement available in all versions of the game (Vanilla, G&K, and BNW)? As far as I can tell it is only used by files located in the two expansion folders. So I'm concerned that using it in my mod will cause my mod to stop working with vanilla. Does anybody have any information about this?
 
G&K and BNW only. It was introduced in G&K as part of the changes to remove some of the hard-coding in AssignStartingPlots.lua
 
I was afraid of something like that.

I'm a little rusty with the XML stuff. Would it be possible to add my own copy of Natural_Wonder_Placement using the data from the features xml. Then do something like:

Code:
If GameInfo.Natural_Wonder_Placement == nil then
    use My_Natural_Wonder_Placement
else
    use the standard Natural_Wonder_Placement
end

Can that work?

If so how do I add the XML? Then once it's in the game how do I access it?
 
While looking at the question above I realized that there might be a better approach and that I should probably start again from the beginning. So here's my situation.....

I want to add natural wonders to the map at the beginning of the game. I already have the ability to add terrain, features (including natural wonders), resources etc.... I do the appropriate checks then change plots as needed. So I have everything in place to add NWs. Unfortunately wonders require a lot more checks and each NW has different requirements. Plus as whoward69 mentioned above vanilla Civ uses a different system to place NW's.

What would be the best way to implement natural wonder placement that works for all versions of the game?

#1: Can I copy the appropriate definitions (proper XML term?) and data from Civ5Features.xml to my mod? That would solve the first step by making the needed data available for all versions of the game when my mod is active. Can I do this in a way that doesn't over write any preexisting data no matter what version of the game is being used?

#2: When placing a NW do I need to use all my own code or is there some built in stuff that's available for use by my mod. My requirements are somewhat obvious. I need to have the ability to add a NW to a plot and have the necessary plots changed (terrain, etc...) as needed so that the NW appears identical to a standard one. I'll also need to be able to test the plot to see if it's a valid spot to place the given NW. I looked at some of the in game code used for placing NW's and quickly got confused. Is it possible to use that code in my mod to manually place NW's? This would occur at the beginning of the game after map creation using the SerialEventDawnOfManShow event to trigger my code.
 
Top Bottom