Palmyra, Collab Mod

The lua IS in the same file as the caravan production. and i'm NOT plopping down citadels with IGE.

I'm out of ideas then - in any case, here's the Modbuddy project from before with the new code merged in, as it functioned for me.
 

Attachments

  • Palmyra.zip
    13 KB · Views: 42
I'll take a look for any super obvious and stupid mistakes that i usually make.
 
Originally Posted by NiaoMeow
It should be something like a rush production bonus (like chopping down a forest) that is initially quite weak (+10 ?) that is increased a lot. We have to remember that how much production things cost in the ancient and the information era are very different, so it might make sense to double the bonus mid-game. We also have to remember that for much of the game you only have so many trade routes.

I quite like +10 , with +5 per trade route. Doubled upon entering the Industrial era.


I quite like the first one. I feel as though its easier to balance the numbers. We can start with Meow's numbers then test it. If it turns out to be OP or UP we can rebalance.

As you mentioned, Caesar, your idea would be quite hard to balance the numbers.

But i have no idea how to code this, so i may ask around.

Excellent you got it going! Well done!

Yes balancing is going to be a bit fiddly. If its caravans that go through your terrain, that could be either very low or very high. I've had games with the AIs sending 10+ caravans into my civ. That would be 100 hammers per turn if every caravan ended its turn on my tiles. And that is before the modifier from sending caravans from the capital.
But since they come from distance we could assume each caravan will be spending about 2-4 turns going in and out of our territory (out of about 8-10+ turns to in the total caravan loop [i.e. from their city to Palmyra and back]).

This would give you about 20-40 hammers every 8-10 turns which equates to about 2.5-4 hammers per turn. However it is heavily dependent on city placement - In other words a potentially very powerful bonus.

I'm sure my numbers are a bit off but I think caravans move at about 3 tiles per turn don't they?

Edit:
You might have to be careful with the bonus from each caravan originating from the capital. If I'm not mistaken the capital is usually where people send their external caravans from - this could potentially cause some major balance issues, especially if you are lucky in drawing a lot of AI trade routes.
I'd possibly keep a backup idea in mind in case that second part of the UA does prove to be a bit too over the top. Production is arguably the most powerful value in Civ 5 and the faster you get through the build queue the sooner you win. If it's too much you can always trim the bonus from your capital trade routes and put in place the other idea you had which was to let Palmyra caravans treat deserts tiles as roads. Not trying to change your UA around but its not a bad idea to consider tweaking the UA a bit if the production bonuses are a bit over the top.

For what its worth I think the screenshot below shows the peak of my success with attracting trade routes. Granted I don't have a lot of land but I'd still be getting a tonne of free production from the UA. This was a pure trade route oriented strategy on Diety that was focused around a rush to Colossus (using Egypts UA) and East India Company and the Market.


Spoiler :
 
Excellent you got it going! Well done!

Yes balancing is going to be a bit fiddly. If its caravans that go through your terrain, that could be either very low or very high. I've had games with the AIs sending 10+ caravans into my civ. That would be 100 hammers per turn if every caravan ended its turn on my tiles. And that is before the modifier from sending caravans from the capital.
But since they come from distance we could assume each caravan will be spending about 2-4 turns going in and out of our territory (out of about 8-10+ turns to in the total caravan loop [i.e. from their city to Palmyra and back]).

This would give you about 20-40 hammers every 8-10 turns which equates to about 2.5-4 hammers per turn. However it is heavily dependent on city placement - In other words a potentially very powerful bonus.

I'm sure my numbers are a bit off but I think caravans move at about 3 tiles per turn don't they?

Edit:
You might have to be careful with the bonus from each caravan originating from the capital. If I'm not mistaken the capital is usually where people send their external caravans from - this could potentially cause some major balance issues, especially if you are lucky in drawing a lot of AI trade routes.
I'd possibly keep a backup idea in mind in case that second part of the UA does prove to be a bit too over the top. Production is arguably the most powerful value in Civ 5 and the faster you get through the build queue the sooner you win. If it's too much you can always trim the bonus from your capital trade routes and put in place the other idea you had which was to let Palmyra caravans treat deserts tiles as roads. Not trying to change your UA around but its not a bad idea to consider tweaking the UA a bit if the production bonuses are a bit over the top.

For what its worth I think the screenshot below shows the peak of my success with attracting trade routes. Granted I don't have a lot of land but I'd still be getting a tonne of free production from the UA. This was a pure trade route oriented strategy on Diety that was focused around a rush to Colossus (using Egypts UA) and East India Company and the Market.


Spoiler :


I agree that it could get OP, but it is quite situational. If there are no trade routes, you only have half a UA. If you place cities like a wizard, you reap the benefits.

Honestly, with some tweaks (that would make the design much more complicated and impossible to code) it could be one of the best designs I've seen here.
 
I finally got the fresh water working, and i don't know how.
I think it may of been IGE. I wasn't spawning in Citadels but i did spawn in the great generals i was testing in, which i think stopped the code from activating.
So this time i used the honor policy tree to make the great general appear and it worked perfect.

Now all that needs doing is the UI. Then all the basics are done and finished.
 
Hold on, can we actually figure out a way to know when Geat People were expended? I'm not quite sure if that's possible. I may have a way to do so but it's going to look a bit nasty.
 
Hold on, can we actually figure out a way to know when Geat People were expended? I'm not quite sure if that's possible. I may have a way to do so but it's going to look a bit nasty.

Yes, quite literally: GameEvents.GreatPersonExpended
 
I could've sworn that GameEvents.GreatPersonExpended was from the CommunityPatch :lol:
 
The one thing that worries me is that I'm not exactly sure if it can get the plot that the unit was expended from, which is necessary for the "+1 Culture when a Great Person is expended in the City working them".
 
well, probably something like:

Code:
unit = player:GetUnitByID(unitID)
plot = Map.GetPlot(unit:GetX(), unit:GetY())

or..

Code:
plot = unit:GetPlot()

:p
 
I was thinking that since you just expended it, it'd be impossible to get the plot.
 
Yeah, it's probably not that simple, especially since there's just the eGreatPersonType parameter :aargh:.
 
Code:
local iPalmyraID = GameInfoTypes.CIVILIZATION_PALMYRA
local iGreatPersonPromotionID = GameInfoTypes.PROMOTION_PALMYRA_GREAT_PERSON
local iPolicyPalmyraID = GameInfoTypes.POLICY_PALMYRA_GREAT_PERSON
local iBuildingFuneraryTowerID = GameInfoTypes.BUILDING_PALMYRA_FUNERARY_TOWER
local iImprovementFuneraryTowerID = GameInfoTypes.IMPROVEMENT_PALMYRA_FUNERARY_TOWER

function FuneraryTowerCountPalmyra(city)
	local iFuneraryTowerNum = 0
	for cityPlot = 0, city:GetNumCityPlots() - 1, 1 do
		local plot = city:GetCityIndexPlot(cityPlot)
		if plot and plot:GetOwner() == playerID then
			if city:IsWorkingPlot(plot) then
				if plot:GetImprovementType() == iImprovementFuneraryTowerID then    
					iFuneraryTowerNum = iFuneraryTowerNum + 1
				end
			end
		end    
	end
	return iFuneraryTowerNum
end
 

function InitPalmyra()
	for playerID = 0, GameDefines.MAX_MAJOR_CIVS - 1 do
		local player = Players[playerID]
		if (player:GetCivilizationType() == iPalmyraID then
			if (not player:HasPolicy(iPolicyPalmyraID)) then
				player:SetNumFreePolicies(1)
				player:SetNumFreePolicies(0)
				player:SetHasPolicy(iPolicyPalmyraID, true)	
			end
		end
	end 
end

Events.LoadScreenClose.Add(InitPalmyra)

function ExpendGreatPeoplePalmyra(iPlayer, iUnit)
	local iDistance = 0
	local pPlayer = Players[iPlayer]
	if (pPlayer:GetCivilizationType() == iPalmyraID and pPlayer:IsEverAlive()) then
		local iPlot = iUnit:GetPlot()
		for iCity in pPlayer:Cites()
			iDistanceNew = Map.PlotDistance(iCity:GetX(), iCity:GetY(), iPlot:GetX(), iPlot:GetY())
			if iDistanceNew > iDistance then
				iDistance = iDistanceNew
				for pCity in pPlayer:Cities()
					if pCity:IsHasBuilding(iBuildingFuneraryTowerID) then
						pCity:SetNumRealBuilding(iBuildingFuneraryTowerID, 0)
					end
				end
				iCity:SetNumRealBuilding(iBuildingFuneraryTowerID, 1)
			end
			if iCity:IsHasBuilding(iBuildingFuneraryTowerID) then
				pPlayer:ChangeJONSCulture(FuneraryTowerCountPalmyra(iCity))
				if pPlayer:IsHuman() then 
					Events.GameplayAlertMessage(Locale.ConvertTextKey("You have gained +{1_Num} Culture from the burial of a great person!", cultureBoost)) 
				end
			end
		end
	end
end

GreatPersonExpended(ExpendGreatPeoplePalmyra)

If I didn't screw anything up, this should work.
 
I'll try that in a little bit.
 
Code:
local iPalmyraID = GameInfoTypes.CIVILIZATION_PALMYRA
local iGreatPersonPromotionID = GameInfoTypes.PROMOTION_PALMYRA_GREAT_PERSON
local iPolicyPalmyraID = GameInfoTypes.POLICY_PALMYRA_GREAT_PERSON
local iBuildingFuneraryTowerID = GameInfoTypes.BUILDING_PALMYRA_FUNERARY_TOWER
local iImprovementFuneraryTowerID = GameInfoTypes.IMPROVEMENT_PALMYRA_FUNERARY_TOWER

function FuneraryTowerCountPalmyra(city)
	local iFuneraryTowerNum = 0
	for cityPlot = 0, city:GetNumCityPlots() - 1, 1 do
		local plot = city:GetCityIndexPlot(cityPlot)
		if plot and plot:GetOwner() == playerID then
			if city:IsWorkingPlot(plot) then
				if plot:GetImprovementType() == iImprovementFuneraryTowerID then    
					iFuneraryTowerNum = iFuneraryTowerNum + 1
				end
			end
		end    
	end
	return iFuneraryTowerNum
end
 

function InitPalmyra()
	for playerID = 0, GameDefines.MAX_MAJOR_CIVS - 1 do
		local player = Players[playerID]
		if (player:GetCivilizationType() == iPalmyraID then
			if (not player:HasPolicy(iPolicyPalmyraID)) then
				player:SetNumFreePolicies(1)
				player:SetNumFreePolicies(0)
				player:SetHasPolicy(iPolicyPalmyraID, true)	
			end
		end
	end 
end

Events.LoadScreenClose.Add(InitPalmyra)

function ExpendGreatPeoplePalmyra(iPlayer, iUnit)
	local iDistance = 0
	local pPlayer = Players[iPlayer]
	if (pPlayer:GetCivilizationType() == iPalmyraID and pPlayer:IsEverAlive()) then
		local iPlot = iUnit:GetPlot()
		for iCity in pPlayer:Cites()
			iDistanceNew = Map.PlotDistance(iCity:GetX(), iCity:GetY(), iPlot:GetX(), iPlot:GetY())
			if iDistanceNew > iDistance then
				iDistance = iDistanceNew
				for pCity in pPlayer:Cities()
					if pCity:IsHasBuilding(iBuildingFuneraryTowerID) then
						pCity:SetNumRealBuilding(iBuildingFuneraryTowerID, 0)
					end
				end
				iCity:SetNumRealBuilding(iBuildingFuneraryTowerID, 1)
			end
			if iCity:IsHasBuilding(iBuildingFuneraryTowerID) then
				pPlayer:ChangeJONSCulture(FuneraryTowerCountPalmyra(iCity))
				if pPlayer:IsHuman() then 
					Events.GameplayAlertMessage(Locale.ConvertTextKey("You have gained +{1_Num} Culture from the burial of a great person!", cultureBoost)) 
				end
			end
		end
	end
end

GreatPersonExpended(ExpendGreatPeoplePalmyra)

If I didn't screw anything up, this should work.

Code:
local iPalmyraID = GameInfoTypes.CIVILIZATION_PALMYRA
local iGreatPersonPromotionID = GameInfoTypes.PROMOTION_PALMYRA_GREAT_PERSON
local iPolicyPalmyraID = GameInfoTypes.POLICY_PALMYRA_GREAT_PERSON
local iBuildingFuneraryTowerID = GameInfoTypes.BUILDING_PALMYRA_FUNERARY_TOWER
local iImprovementFuneraryTowerID = GameInfoTypes.IMPROVEMENT_PALMYRA_FUNERARY_TOWER
Does anything need to be put into the dummy policy, building and promotion? or are they just blank?
 
Top Bottom