If Culture Level is higher / lower - function

dartmor

Chieftain
Joined
Oct 23, 2010
Messages
55
Location
Russia
I want unhappiness from war to be modified. If Culture Level of civilization you're at war with is LOWER, than you generate less unhappiness / or / nothing at all. If it's HIGHER you generate more unhappiness from war.

So basically i guess i can write two xml files both changing Unhappiness value. I already did it. But i guess i will need lua function that checks If Culture Level of Civilization you're at War with is higher / lower > it runs XML1 ( that gives low unhappiness from occupied / annexed cities or not at all ) or XML2 ( with high unhappiness from occupied / annexed cities ).

How this function will look?
 
The function you might be looking for is

Code:
lGetJONSCultureEverGenerated

This function here

Code:
lGetLastTurnLifetimeCulture

returns the total culture ever generated from the previous turn.
 
Can you please give me a link to a good guide? I don't know anything about other ways of modding exept XML at the moment. But many things i want to do are not possible through XML.
 
As far as i've read, basically it should look something like:
if Enemy Culture < lGetLastTurnLifetimeCulture
then SetActive xml file or simply directly change unhappiness output from cities of certain civ
end

?
 
and if i want to make more military units free only in time of war it gonna be something like:

if war
then make more units free
end

?
 
ok i came up to something like this:

if
function WarStateChangedHandler( team1, team2, bool war)
then
iFreeMilitaryUnitsPopulationPercent == 1;
print ("In time of war number of free military units is increased");
end

And this:

if
function WarStateChangedHandler( team1, team2, bool war)
if player's culture > lGetLastTurnLifetimeCulture of enemy?
then
ChangeOccupiedPopulationUnhappinessMod ==?
ChangeUnhappinessFromCapturedCityCount ==?
ChangeUnhappinessFromOccupiedCities ==?

end
Events.WarStateChanged.Add(WarStateChangedHandler) ;

So, how far am i from the right code? :D :D
 
First off, good on you for not giving up and actually trying to forge ahead and learn, rather than sitting around waiting for help, or mindlessly copying code.

While that's not truly "real" code, it's a decent start for "pseudo code" in which you basically write up the logic you'll need to eventually replace with actual code. Think of it as an outline for a paper.

There are a few problems with what you've prototyped, but the biggest problem is the order of your statements. For reference, you'll also want to wrap your code inside the CODE block tags, instead of QUOTE, because it will preserve whitespace formatting.

Code:
[COLOR="Red"]if[/COLOR]
[COLOR="Green"]function WarStateChangedHandler( team1, team2, bool war)[/COLOR]
[COLOR="Red"]if[/COLOR] player's culture > lGetLastTurnLifetimeCulture of enemy?
[COLOR="Red"]then[/COLOR]
ChangeOccupiedPopulationUnhappinessMod ==?
ChangeUnhappinessFromCapturedCityCount ==?
ChangeUnhappinessFromOccupiedCities ==?

[COLOR="Red"]end[/COLOR]
[COLOR="Blue"]Events.WarStateChanged.Add(WarStateChangedHandler)[/COLOR] ;

Starting from the top, you have an if check. However, the if must be able to check some kind of condition. Unfortunately, your 'condition' is a function which does other things. An if block merely checks for true or false, and then runs whatever is specified in the "then" section, which is missing for at least one of your if blocks, since you have two of them.

Furthermore, for Lua, every if and every function call must have a corresponding end in its pair. If not, Lua will complain and throw an error. On this point, I find it's easiest to remember this if I immediately write the "end" whenever I open up a new block:

Code:
[B]function[/B] XYZ()
[B]end[/B]
Code:
function XYZ()
	[B]if[/B] X then
	[B]end[/B]
end
Code:
function XYZ()
	if X then
		[B]if[/B] Y then
		elseif Z then
		else
		[B]end[/B]
	end
end
This is an example of how I make sure that I have the appropriate number of end calls even before I start filling the function in with logic.

So, the first problem is that you really shouldn't have an if there before you define your function. As it's a function, let it sort itself out -- that's what functions are meant to do. Easy fix in this case -- delete the if in the line before function.

Your next line defines a new function called WarStateChangedHandler and it takes a number of arguments -- in this case, it's information called team1, team2, and bool war. Keep in mind that the space may throw that off, so always keep your variable names without spaces.

At the very end you've specified this function via its name to be added to the WarStateChanged event. This is an event hook made available to us by Firaxis, and simply means that at the point that Firaxis is running their game code related to war state being changed, it will additionally run any user functions provided here at the same time.

Recall that your function needed three arguments -- team1, team2, and boolwar. This event, when it fires your function, will also provide those three arguments automatically.
Code:
if [COLOR="Red"]player's[/COLOR] culture > lGetLastTurnLifetimeCulture of [COLOR="Red"]enemy[/COLOR]?
Here is where things start getting tricky.

This is fine pseudo code, as you want to compare culture levels of the two players, but you haven't actually specified who is who. This is where you need to make use of the team1 and team2 information and match them up with player ID's. You need to store this information into variables (either global or local) so that you can use them to find other information you need.

Typically, in order to find information about a player, you need to gain access to the 'Player' game object which is the game table which contains all of the data about that player. This game table is called Players (note the 's') and the table index matches up with the player ID. For example, to get the player game object for player 3, you would specify something like this:
Code:
local pPlayer = Players[3]
In this case, we are defining a new variable caleld pPlayer to hold the data contained in the Players table for player 3 -- this gives us the game object for player 3 and we can then start querying that table to find out what is up with player 3.

However, hardcoding like this is usually bad, so we want to let the game fill in the player number for us whenever possible. This is usually achieved via the use of iPlayer or playerID, or whatever other naming convention you like to use.
Code:
local pPlayer = Players[iPlayer]
There is still a problem, though -- iPlayer/B] here is not defined. Lua requires all variables to be defined with a value first, or else it turns up as nil -- nothing at all. Normally, we depend on the game's events to give it to us (for example, GameEvents.PlayerDoTurn() returns the iPlayer for which it is running functions for at the time) but it doesn't appear like your WarStateChanged event does so. I haven't used it personally, so I can't remember if it returns team numbers or player numbers, but I believe team numbers is accurate, since wars are waged between teams rather than players.

In this case you'll need to figure out the player from the team number. This is other logic though, and this is getting on the long side, and I've got to go soon so I'm unable to be any more precise than this -- hopefully it's a good starting point for you.

The Modiki is a great reference for what commands / methods and hooks are available to you, though.

This leads into your last section:
Code:
ChangeOccupiedPopulationUnhappinessMod ==?
ChangeUnhappinessFromCapturedCityCount ==?
ChangeUnhappinessFromOccupiedCities ==?
Again, pseudo code is fine, but I have no idea of those methods actually exist (check with the Modiki there) and even if they do, they are missing the game object/B] they are supposed to be for.

As an example, there exists a player method called ChangeUnhappinessFromUnits(). In order to use it properly, since it's a player method, we need to link it with a player object:
Code:
local pPlayer = Players[iPlayer]
pPlayer:ChangeUnhappinessFromUnits()

Hope that helps!
 
Thanks for kind words and for help :) I will try to figure out the rest, but

Actually there are no
ChangeOccupiedPopulationUnhappinessMod
ChangeUnhappinessFromCapturedCityCount
ChangeUnhappinessFromOccupiedCities

I've just changed "Get" to "Change". But I don't need to get those, i need to actually change them and i don't see such possibly objects listed.
So it's not possible to change or what?

Then the only way i see here, it's to change basic Unhappiness - to be generated only from Units from the start ( through XML ). And then lower that Unhappiness in time of war ( with civilization that has lower culture ).
But because my second mode increases number of Free Military Units in time of war ( for example you have 10 free military ( = 10 Unhappiness ) units for 5 cities and 30 free military ( = 30 Unhappiness? ) units in time of war ), i should decrease Unhappiness from units by a large amount...

And i am not sure how it will affect Unhappiness system overall. And also if Unhappiness will depend on units, then it will be no matter how many cities you've actually captured in war - i don't like it. It can ruin Unhappiness system overall.

Instead i guess i can try to use "ChangeExtraHappinessPerCity", hm.

By the way, if we have small civ with high culture per city - with many policies, and a large civ with lower culture per city and less policies - but with more culture overall... who should be considered as "more cultured civilization" ? :/
Logically, large civ has more culture. But it's divided between large empire. While a smaller civ in this case, while having lower culture overall, is more cultured per city.

lol and i don't see in modiki how to change number of free military units too
but i can simply run XML through lua that do that, huh?

ok, currently i have two lua files, one:

Code:
Events.WarStateChanged.Add(
function WarStateChangedHandler( team1, team2, bool war)

local pPlayer = Players [1]
local pPlayerAI = Players [2]

	if pPlayer:lGetLastTurnLifetimeCulture >  pPlayerAI:lGetLastTurnLifetimeCulture
	then

local pPlayer = Players[iPlayer]
pPlayer: ChangeExtraHappinessPerCity(2)
print ("If your Culture Level is higher than your enemy's, every city generate - including captured ones - 2 bonus Happiness")
        end
end)
and
Code:
Events.WarStateChanged.Add(
function WarStateChangedHandler( team1, team2, bool war)
local B = GameInfo.HandicapInfos.ProductionFreeUnitsPopulationPercent
local pPlayer = Players[iPlayer]
pPlayer:B(100)
print ("In time of war number of free military units is increased")
end)

I am not sure yet how to manage Events (because it doesn't work yet) and if my function is right at all. For example, "GameInfo.HandicapInfos.ProductionFreeUnitsPopulationPercent"
is based on http://forums.civfanatics.com/showthread.php?t=449431
And i am not even sure if it's possible yet
 
Ok, i don't get it. I can't even run simple lua, like:

This is Test.lua
Code:
Events.ActivePlayerTurnStart.Add(
function WarStateChangedHandler
print("Booyaa1!")
end)

This one is Test4.lua
Code:
Events.SerialEventStartGame.Add(
function WarStateChangedHandler
print("Booyaa2!")
end)

Test3.lua
Code:
function listener()
print("I'm listening2!")
end
Events.SerialEventStartGame.Add(listener)

And finally Test2.lua
Code:
function listener()
print("I'm listening!")
end
Events.ActivePlayerTurnStart.Add(listener)

The last one is right from modiki, and it don't work. I've tried different ones to make sure which one will work. But none of them!
I enabled logging somehow, and it says:
[158565.079] Syntax Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Culture.lua:6: '(' expected near 'WarStateChangedHandler'
[158565.079] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Culture.lua.
[158565.079] Syntax Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test.lua:6: '(' expected near 'WarStateChangedHandler'
[158565.079] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test.lua.
[158565.079] Runtime Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test2.lua:8: attempt to index global 'Events' (a nil value)
[158565.079] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test2.lua.
[158565.079] Runtime Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test3.lua:8: attempt to index global 'Events' (a nil value)
[158565.079] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test3.lua.
[158565.079] Syntax Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test4.lua:6: '(' expected near 'WarStateChangedHandler'
[158565.079] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test4.lua.
[158565.079] Syntax Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\War Units.lua:6: '(' expected near 'WarStateChangedHandler'
 
Whoa, this will be a lot to go through.

First off, in response to your earlier post, simply changing Get to Change will not necessarily work, because Firaxis is consistently inconsistent with their code. Generally, only methods explicitly listed are available. The exceptions are any and all methods introduced with BNW, because the Modiki is out of date and I believe only contains information up to G&K.

With that said, Unhappiness is a tricky thing to change, and regarding the free units thing, although Lua greatly expands the power we have to change the game, we are still extremely limited by exactly what Firaxis chose to expose to us from the game core. I can't think of any simple way of doing what you want to achieve.

For the functions posted in your earlier post, there are several problems with them.

First, you're subscribing directly to the Event itself, but you've defined a function name. I have not tested this, but I am not entirely sure if that works, since every example I've seen of a function directly being called in an Event handler in that way has been an anonymous function -- a function without a name.

I believe what is effectively happening is that whenever WarStateChanged fires, instead of running your function, it tries to add another function with that name instead.

Secondly, your function is defined as taking the three arguments team1, team2, and bool war (setting aside again the fact that spaces in variable names will through Lua off,) you try to define pPlayer as Players[iPlayer] -- the problem is iPlayer doesn't have any value here. It needs to be defined before being used.

The other one hardcodes the players to be player 1 and 2, which is extremely bad as that corresponds to the second and third players in the game, and no one else.. regardless of who is actually triggering wars.

Code:
pPlayer:B(100)
This also doesn't make any sense.

As far as your more recent post goes, you've provided Lua log information, which is helpful, and a good step toward trying to figure out where you're going wrong.

I don't know which code snippet corresponds to which Lua error, though, so I'll have to make some assumptions.

First, let's look at this one:
[158565.079] Syntax Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Culture.lua:6: '(' expected near 'WarStateChangedHandler'
This tells you three things:
  1. The type of error.
  2. The file and line number where Lua ran into an error.
  3. What the error was.
The second point is likely where it gets vague sometimes, but it is telling you something: Lua wanted to see an opening parenthesis near WarStateChangedHandler which happens to be your function name. Why is that?
Code:
Events.ActivePlayerTurnStart.Add(
[B]function WarStateChangedHandler[/B]
print("Booyaa1!")
end)
Let's compare this with:
Code:
[B]function listener()[/B]
print("I'm listening!")
end
Notice anything? You've attempted to define a function, but it's missing the set of parenthesis to let it know what, if any, arguments it should expect. All Lua functions are of, at the minimum, the following syntax: function name(), not function name.

[158565.079] Runtime Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test2.lua:8: attempt to index global 'Events' (a nil value)
This one is a bit trickier because I'm not sure what your file and mod setup looks like, but this is saying that, as a runtime error, the code technically worked fine, but Lua ran into some other logical problem and couldn't successfully complete the function's commands. In this case, it is saying that you attempted to use an Events table which was nil, perhaps before it was defined. I'd need to look at the code to figure this one out any more specifically, though, as I'm not sure why it's seeing it as nil.

Finally, to my knowledge, I'm not sure there is any way to "set" or "activate" an XML file through Lua -- XML is all parsed into the database as the mod loads. You have some ability to directly modify the database from within Lua, but there is quite a lot of data that simply is cached, and won't impact the game even if you do alter the database with a new value. I'm not sure if this would apply in your case, but it's something to be aware of.
 
That function should still run fine. This is why I said I'd need to look at the mod and/or the code in its entirety to see what's going on with it.

You've amended your previous post with the Lua files, but they're obviously not the full files, because the errors aren't matching up -- each of your functions posted spans 4 lines, yet the errors are quoting an error occurring on line 6 and line 8.
 
Maybe it's because i have
Code:
-- Test2
-- Author: Dartmor
-- DateCreated: 5/27/2015 5:33:07 AM
--------------------------------------------------------------
function listener()
print("I'm listening!")
end
Events.ActivePlayerTurnStart.Add(listener)

You have Skype maybe? I am not sure if it will be comfortable for you, but i have to ask. I will not abuse your help :)
 
I do not have Skype, unfortunately, and I'm also about to head to bed.

Please zip up your mod and post it here -- even if I do not get to it, there may be other members here that might be able to help you before I get up in the morning.
 
You are very nice, thnx :) I will try to figure it out myself first and if don't, then will zip and post it )
 
Your real problem was with the way you were structuring your Add to the hooks

This is an example of the method needed to get a function to run from GameEvents.PlayerDoTurn:
Code:
GameEvents.PlayerDoTurn.Add(function(iPlayer)
	--stuff happens
end)
Now compare with the method that you were trying with your WarStateChangedHandler:
Code:
Events.ActivePlayerTurnStart.Add(
	function WarStateChangedHandler
	print("Booyaa1!")
end)
If I were following the syntax method you were trying to use, and I was trying to make the WarStateChangedHandler run from GameEvents.PlayerDoTurn instead of Events.ActivePlayerTurnStart, and I used your syntax methods, I would have:
Code:
GameEvents.PlayerDoTurn.Add(
	function WarStateChangedHandler
	print("Booyaa1!")
end)
This would not work. Compare it again to my original code snippet, with your print statement added:
Code:
GameEvents.PlayerDoTurn.Add(function(iPlayer)
	print("Booyaa1!")
end)
See the difference?
If not:
Code:
GameEvents.PlayerDoTurn.Add(
	function [color="red"]WarStateChangedHandler[/color]
	print("Booyaa1!")
end)
The game is interpretting the red bit, WarStateChangedHandler, as a subsidiary function it should try to run, as in if it were stated this way:
Code:
GameEvents.PlayerDoTurn.Add(
	function [color="red"]WarStateChangedHandler()[/color]
	print("Booyaa1!")
end)

function [color="red"]WarStateChangedHandler()[/color]
	print("something ought to happen here")
end
But even that will not work, because it still is missing a pair of (), as in here:
Code:
GameEvents.PlayerDoTurn.Add(function()
	[color="red"]WarStateChangedHandler()[/color]
	print("Booyaa1!")
end)

function [color="red"]WarStateChangedHandler()[/color]
	print("something ought to happen here")
end
None of these, however, are really what you are looking for. What you would really want would be:
Code:
GameEvents.PlayerDoTurn.Add(function(iPlayer)
	print("Booyaa1!")
end)
And, to use that as a template for your Events.ActivePlayerTurnStart hook, you would want:
Code:
Events.ActivePlayerTurnStart.Add(function()
	print("Booyaa1!")
end)

----------------------------------------------------------------------------------------------

But you also have another problem in that Events.ActivePlayerTurnStart is not a relaible hook for general use since it does not always fire for AI players. The same is true for Events.ActivePlayerTurnEnd
 
This is very odd:

Test
Code:
GameEvents.PlayerDoTurn.Add(function()
	WarStateChangedHandler()
	print("Booyaa1!")
end)

Test2
Code:
GameEvents.PlayerDoTurn.Add(function()
	WarStateChangedHandler()
	print("Booyaa2!")
end)

function WarStateChangedHandler()
	print("something ought to happen here2")
end

Test3 < this one should be right, no?
Code:
GameEvents.PlayerDoTurn.Add(function(iPlayer)
	print("Booyaa3!")
end)

Test4
Code:
GameEvents.PlayerDoTurn.Add(
	function WarStateChangedHandler()
	print("Booyaa4!")
end)

function WarStateChangedHandler()
	print("something ought to happen here4")
end

And i get
[226972.469] Runtime Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test.lua:5: attempt to index global 'GameEvents' (a nil value)
[226972.469] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test.lua.
[226972.469] Runtime Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test2.lua:5: attempt to index global 'GameEvents' (a nil value)
[226972.469] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test2.lua.
[226972.469] Runtime Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test3.lua:5: attempt to index global 'GameEvents' (a nil value)
[226972.469] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test3.lua.

[226972.469] Syntax Error: C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test4.lua:6: '(' expected near 'WarStateChangedHandler'
[226972.469] Runtime Error: Error loading C:\Users\Dartmor\Documents\My Games\Sid Meier's Civilization 5\MODS\Advanced Culture (v 1)\Test4.lua.

I am so confused.
 
We really need the mod package to help you here.

Those errors point to your Lua code not being able to 'see' the contents of the global event handlers. It sounds like there's potentially a scoping problem, and/or a problem with the way you've set up your Lua contexts, but without being able to see the mod, I can't help you.

There are issues with the code in Test, Test2, and Test4, but the three lines you've posted of Test3 should be fine as far as I can tell.
 
You are trying to run all that stuff at once, I think, which is a mistake. Only run one at a time as a test. Otherwise you are merely fighting any one error you make effecting everything. [edit]or just confusing you to an irrecoverable degree.

only this
Code:
GameEvents.PlayerDoTurn.Add(function(iPlayer)
	print("Booyaa1!")
end)
or this
Code:
Events.ActivePlayerTurnStart.Add(function()
	print("Booyaa1!")
end)
or this
Code:
GameEvents.PlayerDoTurn.Add(function()
	WarStateChangedHandler()
	print("Booyaa1!")
end)

function WarStateChangedHandler()
	print("something ought to happen here")
end
should work. But do not try to run all at the same time in the same file or even across multiple files each with one of those in it because any little mistake in one will drive you crazy figuring out why it does not work.

zip and attach the mod you were running the codes from and getting those errors.

-----------------------------------------------------------------------------------------------------------


I haven't even looked at the code as yet, but this is giant no-no for what you are trying to do:
Spoiler :
Code:
  <EntryPoints>
    <EntryPoint type="MapScript" file="Culture.lua">
      <Name>1</Name>
      <Description>1</Description>
    </EntryPoint>
    <EntryPoint type="MapScript" file="War Units.lua">
      <Name>2</Name>
      <Description>2</Description>
    </EntryPoint>
    <EntryPoint type="MapScript" file="Test.lua">
      <Name>3</Name>
      <Description>3</Description>
    </EntryPoint>
    <EntryPoint type="MapScript" file="Test2.lua">
      <Name>4</Name>
      <Description>4</Description>
    </EntryPoint>
    <EntryPoint type="MapScript" file="Test3.lua">
      <Name>5</Name>
      <Description>5</Description>
    </EntryPoint>
    <EntryPoint type="MapScript" file="Test4.lua">
      <Name>6</Name>
      <Description>6</Description>
    </EntryPoint>
  </EntryPoints>

In addition, remember how I said this will not work ?
Code:
GameEvents.PlayerDoTurn.Add(
	function WarStateChangedHandler()
	print("MAGIC!!! IT WORK4!!!!")
end)

function WarStateChangedHandler()
	print("something ought to happen here4")
end

-------------------------------------------------------------------------------------

The basic trouble with your lua is that your entry points need to be InGameUIAddin. See here: whoward69's what ModBuddy setting for what file types tutorial

And as I mentioned earlier, attempt only one thing at a time, so get rid of all but one. Keep the files themselves, but delete the "EntryPoint" info in the Content Tab of ModBuddy. You will need to delete these incorrect usages anyway from the Content tab.

---------------------------------------------------------------------------------------------------

Also, in your xml file War Units.xml:
Code:
<GameData>
	[COLOR="Red"]<GameData>[/COLOR]
		<HandicapInfos>
[COLOR="Green"]			<ProductionFreeUnits>12</ProductionFreeUnits>
			<ProductionFreeUnitsPopulationPercent>100</ProductionFreeUnitsPopulationPercent>
			<ProductionFreeUnitsPerCity>2</ProductionFreeUnitsPerCity>[/COLOR]
		</HandicapInfos>
	[COLOR="red"]</GameData>[/COLOR]
</GameData>
The Red bits are no good. But the Green bits are no good either because they are not placed under a <Row>, <Update>, or <Replace> pair, and they make no reference to a <Type> of <HandicapInfos> so there is a double-whammy of XML without anything to be associated to.

[edit][edit][edit]The XML file will not run anyway because you have it set as ImportIntoVFS=true instead of as Actions Tab > OnModActivated > UpdateDatabase
 
Back
Top Bottom