Specific GPP Generation during Peace

bane_

Howardianism High-Priest
Joined
Nov 27, 2013
Messages
1,559
Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_SEKAWA_PEACE</Type>
			<Description>TXT_KEY_TRAIT_SEKAWA_PEACE</Description>
	<ShortDescription>TXT_KEY_TRAIT_SEKAWA_PEACE_SHORT</ShortDescription>
			<DOFGreatPersonModifier>10</DOFGreatPersonModifier>
			<GreatArtistRateModifier>15</GreatArtistRateModifier>
			<GreatMusicianRateModifier>15</GreatMusicianRateModifier>
			<GreatWriterRateModifier>15</GreatWriterRateModifier>
			<RequiresPeace>true</RequiresPeace>
		</Row>
	</Traits>
</GameData>
This is what I had, which I found out can't be done because those RateModifiers do not exist, so I got part of what could be the start of the code:

Code:
function GreatPersonModifierIfAtPeace(playerID)
	local pPlayer = Players[playerID]
	if (Teams[pPlayer:GetTeam()]:IsAtWar() ~= true)
	and (pPlayer:GetCivilizationType() == GameInfoTypes.CIVILIZATION_YOURCIV) then [...]
(code provided by AggressiveWimp)

Now, how do I do the rest? There is no problem if someone just come up and do the code, but I want more: Where should I look for syntaxes, parameters, events and whatever else I need to know to start making my own codes and stop nagging you all for them. :lol:

Thanks in advance. :)
 
And just to clarify, the code I gave you was only the beginning of the code, and it was also only the beginning of the code because I couldn't find any lua functions remotely like City.SetGreatPersonGenerationBonus on the Lua/UI reference. :dunno:

(it was also only a guess, as I'm not really all that great at coding lua... :lol:)

So here's the (a?) problem: There is, in fact, a function called City.GetGreatPersonRateModifier, and better yet, Player.GetGreatPersonRateModifier. Which is great, except for two "small" problems:
1) They refer to overall GP modifiers, not specific GPs, and more importantly,
2) That doesn't help us because the "Get" in either function would have to be "Set" or "Change" to make the function, well, functional. :p
 
Yes yes, I mentioned it is only 'part of what could be the start of the code'. haha I've got you covered. :)

It may be possible (long shot here!) to make a condition to this generation? Like, 'Give # GPP, but not for Scientist', plus 'Give # GPP, but not for Engineer' and so on? Or maybe take away from these after giving (although that might be a problem if you're already near the threshold for a GP being born)?

Here comes the newbie question every veteran facepalms himself every 30th he reads it: Lua/UI reference, what's that? Where can I get it?
 
Back
Top Bottom