Palmyra, Collab Mod

I uploaded the wrong one. Use this instead.

That's better! I like that one. Now i feel bad for saying i didn't like it, because you were showing me the wrong one.

This new leaderscreen looks much better then the older one, But it means this icon is no longer usable. Despite how awesome it is.
M3W8Mau.png
 
I uploaded the wrong one. Use this instead.

Outstanding work. This gets my vote.

Now I have to dig into the code issue.

EDIT: This just isn't making sense! If I expend a Great Person in a city, it works perfectly. If I expend a Great Merchant in a City State, it works perfectly. If I expend a Great Person anywhere else, the Funerary Tower count changes in mid-code to 0.
 
You can use this if you want:

vL77WqW.png
 
I agree with Pouakai, keep the old icon - it's pretty great.

@calcul8or, I haven't seen the code, but a friendly advise, if you're not already, is to use print statements. Preferably in all steps of the code. That usually makes it pretty easy to spot where something goes wrong.
 
You really think we should keep using the old icon? I understand that civs use different poses for their leaders, but she looks like a totally different woman in that icon.
 
I agree with Pouakai, keep the old icon - it's pretty great.

@calcul8or, I haven't seen the code, but a friendly advise, if you're not already, is to use print statements. Preferably in all steps of the code. That usually makes it pretty easy to spot where something goes wrong.

Here's the relevant part of the code:

Spoiler :
Code:
			if (pPlot:IsCity()) then
				local pCity = pPlot:GetPlotCity()
				print("It's a city")
				FTcount = FuneraryTowerCountPalmyra(pCity, iPlayer)
			elseif (pPlot:GetWorkingCity() ~= nil and pPlot:GetOwner() == iPlayer) then
				print("Plot worked by city")
				local FTcount = FuneraryTowerCountPalmyra(pPlot:GetWorkingCity(), iPlayer)
				print("FTcount is " .. FTcount)
			else
				print("Looking for the right city")
				local unitDistance = 9999
				local newCity = nil
				for iCity in pPlayer:Cities() do
					local iNewDistance = Map.PlotDistance(iCity:GetX(), iCity:GetY(), iX, iY)
					print("iNewDistance = " .. iNewDistance)
					if (iNewDistance < unitDistance) then
						newCity = iCity
					end
				end
				if (newCity ~= nil) then
					FTcount = FuneraryTowerCountPalmyra(newCity, iPlayer)
				else
					print("No city found, using capital");
					FTcount = FuneraryTowerCountPalmyra(pPlayer:GetCapitalCity(), iPlayer)
				end
			end
			bGreatPerson = false
			print("Changing culture by " .. FTcount)
			pPlayer:ChangeJONSCulture(FTcount)

The "If..." condition works correctly. The "Else..." condition works correctly. Here is the log when the "elseif..." condition fires:

Spoiler :
Code:
[529920.109] PalmyraTest2: GP expended in GreatPersonExpended
[529920.109] PalmyraTest2: Great person expended by Palmyra
[529920.109] PalmyraTest2: Plot worked by city
[529920.109] PalmyraTest2: iFuneraryTowerNum is 1
[529920.109] PalmyraTest2: iFuneraryTowerNum is 2
[529920.109] PalmyraTest2: iFuneraryTowerNum is 3
[529920.109] PalmyraTest2: FTcount is 3
[529920.109] PalmyraTest2: Changing culture by 0

"FTcount is 3" is the last line of the "elseif" block, and "Changing culture by 0" is the first line afterward....and the variable changes from 3 to 0 when making that step.

Full code (I'm testing using a different civ with its own unique improvement to test):

Spoiler :
Code:
local civID    = GameInfoTypes["CIVILIZATION_ALASKA"];
local iImprovementFuneraryTowerID = GameInfoTypes.IMPROVEMENT_AKHUNTINGCAMP
local bGreatPerson = false

function PalmyraFTbonus(iPlayer, UnitID, UnitType, iX, iY, bDelay, eByPlayer)
	local pPlayer = Players[iPlayer]
	if (pPlayer:IsAlive() and pPlayer:GetCivilizationType() == civID) then
		if bGreatPerson then
			print("Great person expended by Palmyra");
			local FTcount = 0
			local pPlot = Map.GetPlot(iX,iY)
			if (pPlot:IsCity()) then
				local pCity = pPlot:GetPlotCity()
				print("It's a city")
				FTcount = FuneraryTowerCountPalmyra(pCity, iPlayer)
			elseif (pPlot:GetWorkingCity() ~= nil and pPlot:GetOwner() == iPlayer) then
				print("Plot worked by city")
				local FTcount = FuneraryTowerCountPalmyra(pPlot:GetWorkingCity(), iPlayer)
				print("FTcount is " .. FTcount)
			else
				print("Looking for the right city")
				local unitDistance = 9999
				local newCity = nil
				for iCity in pPlayer:Cities() do
					local iNewDistance = Map.PlotDistance(iCity:GetX(), iCity:GetY(), iX, iY)
					print("iNewDistance = " .. iNewDistance)
					if (iNewDistance < unitDistance) then
						newCity = iCity
					end
				end
				if (newCity ~= nil) then
					FTcount = FuneraryTowerCountPalmyra(newCity, iPlayer)
				else
					print("No city found, using capital");
					FTcount = FuneraryTowerCountPalmyra(pPlayer:GetCapitalCity(), iPlayer)
				end
			end
			bGreatPerson = false
			print("Changing culture by " .. FTcount)
			pPlayer:ChangeJONSCulture(FTcount)
			if (pPlayer:IsHuman() and FTcount > 0) then 
				Events.GameplayAlertMessage(Locale.ConvertTextKey("You have gained +{1_Num} Culture from the burial of a great person!", FTcount)) 
			end
		end
	end
end

GameEvents.UnitPrekill.Add(PalmyraFTbonus)

function PalmyraGPexpended(playerID, iUnit)
	local pPlayer = Players[playerID]
	if (pPlayer:IsAlive() and pPlayer:GetCivilizationType() == civID) then
		print("GP expended in GreatPersonExpended")
		bGreatPerson = true
	end
end

GameEvents.GreatPersonExpended.Add(PalmyraGPexpended)

function FuneraryTowerCountPalmyra(city, playerID)
	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
					print("iFuneraryTowerNum is " .. iFuneraryTowerNum)
				end
			end
		end    
	end
	return iFuneraryTowerNum
end
 
If this code works, the civ will be fully functional and working. But, we could do with additional things like Compatibilities and Music.

Just realised a lack of Clibanarii unit art as well.
Oh, and a city list.
and Civilopedia.
and DOM text.
 
Anyone asked for a city list?
Spoiler :
Palmyra
Damascus
Aleppo
Baalbek
Cyrrhus
Berytus
Tarsus
Caesarea
Antioch
Zeugma
Alexandria
Jerusalem
Bosra
Edessa
Ankara
Aelia Capitolina
Tyre
Sidon
Memphis
Tyana
Iconium
Emesa
Gaza
Nisibis
Apamea
Tripoli
Dura-Europos
Aila
Petra
Hegra
Ptolemais
Berenice
Adummatu
Sura
Laodicea
Resafa
Apamea
 
Thanks a lot, chaps.
I'll get to adding that to the mod and test it. As said before, we're in need of compatibilities. I can manage all the basics, but E&D is going to be an issue.
Some Civilopedia text and Dawn of Man text would of be great too, since i suck at those.


Could you explain how the extra culture works, Calcul8or?
While working a funerary tower, i expend the great person and a message lets me know that i buried a great person and gained culture.
The yield of the funerary tower doesn't increase, so what happens?
 
Could you explain how the extra culture works, Calcul8or?
While working a funerary tower, i expend the great person and a message lets me know that i buried a great person and gained culture.
The yield of the funerary tower doesn't increase, so what happens?

A lump sum of culture is paid out when a great person is expended based on the number of funerary towers being worked by the city the GP is in (or the nearest city). If that's not the way it was supposed to me, then I goofed it up :eek:
 
A lump sum of culture is paid out when a great person is expended based on the number of funerary towers being worked by the city the GP is in (or the nearest city). If that's not the way it was supposed to me, then I goofed it up :eek:

ooh, that kind works. I like that.

I think i worded it badly, which is why you did it different. But its a good different.
The original was that it would yield +1 culture.

What do people think? Calcul8ors is kinda neat. Working funerary towers to gain a lump sum upon expending. (Although the Funerary Tower's base yield would need buffing because +3 Faith isn't enough to make it worth working in the long term)
or perhaps its more then +1 culture per tower. It wouldn't be hard for me to edit that code to like +2 or +5 or something.
 
I seriously though that was the plan from the start.
 
Wow, i'm must be so bad at writing uniques.
We'll stick with it. I'll test how good it gets, if its weak i'll give it a base culture yield too. Or increase the amount of culture per tower.

edit:
Definetley increasing the base yields and the amount of culture gained per tower worked.
To gain a lump sum of culture from expending great people requires for you to work multiple funerary towers, which at the current +3 faith is really really bad. especially when its only a lump sum of +1 culture.
 
We can always increase the rate. Like, *10 the number of Funerary Towers.
 
The changes to the Funerary Towers, putting into consideration the no adjacency and desert only.

  • Available at Construction
  • Lump sum of 10 Culture per Funerary Towers worked when you expend a Great Person.
  • +2 Culture and +1 Faith
  • +1 Faith at Philosophy and +1 Culture at Archaeology

It used to be +3 Faith yield only, but that was both too powerful and too weak. Too weak because its kinda pointless to work it so early on. Too powerful for gaining a pantheon and religion, and would increase to +4 faith with the Desert Pantheon.

New version is +2 Culture and +1 Faith and allows for an early culture and faith boost and makes the desert useful. Then, similiar to the Chateau and Brazilwood Camps, it gains an increase as the game advances.


Also - any ideas on what to use as Clibanarii unit art? i did some brief searching and its suprisingly hard to find armored cavalry.

Teasers!
Spoiler :
E6i6Wko.jpg

I'll need to look back through the thread for credits once the mod is released.
But we still need compats, unit art and music.
 
The changes to the Funerary Towers, putting into consideration the no adjacency and desert only.

  • Lump sum of 10 Culture per Funerary Towers worked when you expend a Great Person.

    Teasers!
    Spoiler :
    E6i6Wko.jpg

    I'll need to look back through the thread for credits once the mod is released.
    But we still need compats, unit art and music.


  • To change the lump sum, replace the last section of the Lua with this (lines 84 - 92):

    Spoiler :
    Code:
    function ChangePalmyraCulture(delta, playerID)
    	local deltaX10 = delta * 10
    	print("Changing Culture by " .. deltaX10);
    	local pPlayer = Players[playerID]
    	pPlayer:ChangeJONSCulture(deltaX10)
    	if (pPlayer:IsHuman() and delta > 0) then 
    		Events.GameplayAlertMessage(Locale.ConvertTextKey("You have gained +{1_Num} Culture from the burial of a great person!", deltaX10)) 		
    	end
    end

    The teaser looks great!
 
Back
Top Bottom