Muscogee Confederacy

I think in order to code the culture from trade routes you'll need to set a cap, say up to 30% or such? As for the science part of the UA, maybe gain a boost in science if other player has higher tech count, (more balanced in my opinion anyway ;) :p) I do think in this case dummy buildings are your friend
PS. The mico looks awesome

Dummy buildings are very good. But how would i code the link between the trade routes being sent and the dummy buildings being made while also having a cap.
 
Not quite sure on the trade route lua, but the logic would be:
4 buildings with the same class, 0 does nothing, 1 gives 10% culture rate, 2 gives 20% culture rate, 3 gives 30% culture rate.
If # of trade routes =0 build building 0
If = 1 build building 1
If =2 build building 2
If # of trade routes >2 build building 3

I believe that takes care of dummy buildings being made( they don't stack in the same class), and sets the cap at 30%, in not perfectly sure, so I'd check out more civs Phoenicia and Jfds Flanders for some examples of similar coding
 
I've found that JFD's Merchant Republic of Novgorod has a trade route based lua, i'll see how it reads that a trade route is arriving.
Its the code for how many more techs the civ trading with you has then you.

I might change it so you gain 33% of the science of the city that is sending the route, but i'll keep looking at whether the current one is possible.
 
Ok no, i cannot work my head around how to get the trait working. If anyone can please help, it'd be great.
 
This is the new plan for the UA, after looks around coding to work out what i can actually manage.

UA: Four Mothers Society
For each Trade Route sent from a city with a garrisoned Mico gain a +10% global :c5science: Science boost (up to 30%). Cities generate +10% :c5culture: Culture (up to 30%) for each International Trade Route sent to them.


The Mico would lose its +1 Delegate to balance it spawning in every city, since when i tested it i won a diplomatic victory really easily.
 
Love the new UA, ( now dummy building friendy;))maybe for balance make archery units trained in cities with a mico receive 15 xp, the trading post seems a might extreme. Do you still want the miko to build citadels and give a combat boost? I did like the 3-4 free mico from cities cap personally.

PS what did you think of my uu graphic suggestion?
 
Love the new UA, ( now dummy building friendy;))maybe for balance make archery units trained in cities with a mico receive 15 xp, the trading post seems a might extreme. Do you still want the miko to build citadels and give a combat boost? I did like the 3-4 free mico from cities cap personally.

PS what did you think of my uu graphic suggestion?

That seems like a good idea.
I'll be honest, i have no clue how to get the free Mico to only appear in the first 4 cities.

Sorry, i missed your UU graphic suggestion.
If you can reskin that in the same kind of colours that appear in the UU's icon that'd be great.
 
I don't know how to add units directly through Lua, but if you don't mind *drum roll* dummy buildings! ( who'd a thunk!) Try patria grande's tiwanaku UA and have the building give a mico.

As for the uu, I'm sorry, I didn't even notice the icon despite looking right at it. I don't think I could reskin that pattern since his skin would look striped. Even though its not a mounted unit I think one of These guys with their cap would work better for skinning and match the icon. Let me know which outfit you prefer if you like them.:goodjob:

PS are decisions already lined up?
 
Accuracy to the icon won't matter quite as much because its quite a unique clothing style. I don't think the musketman would work honestly, since its carrying a gun.
 
I'm unsure how to make the skin match the icon then, I guess I'll just give a colored cloak and more subtle saddle? ( red maybe?) Should have Some thing for you tonight, give me any suggestions on looks.
 
Yeah, just generally make the outfit look more bright. but with a more subtle horse. The feather head dress should be fine but the shield needs to be more plain too.

I'll leave it to your better judgement. I'm sure the icon and the unit not matching won't cause too many issues.
 
I've done something wrong here for sure...


Code:
function Muscogee_GetNumTradeRoutesLeavingThisCity(playerID, city)
	local player = Players[playerID]
	local tradeRoutes = player:GetTradeRoutes()
	local numTradeRoutes = 0
	for i, v in ipairs(tradeRoutes) do
		local originatingCity = v.FromCity
		if originatingCity:GetID() == city:GetID() then
			numTradeRoutes = numTradeRoutes + 1
		end
	end
	
	return numTradeRoutes
end

----------------------------------------------------------------------------------------------------------------------------
-- Firebug_MicoScience
----------------------------------------------------------------------------------------------------------------------------

local buildingMuscogeeScienceID 	= GameInfoTypes["BUILDING_MICO_SCIENCE"]
		
function Muscogee_MicoScience(playerID)
local player = Players[playerID]
	if (player:IsAlive() and (not player:IsMinorCiv()) and (not player:IsBarbarian())) then
		for city in player:Cities() do
			local garrison = city:GetGarrisonedUnit()
			if (garrison and garrison:IsHasPromotion(unitPromotionMicoDelegateID)) then
				local numMicoScience = mathMin(Muscogee_GetNumTradeRoutesLeavingThisCity(playerID, city), 3)
				city:SetNumRealBuilding(buildingMuscogeeScienceID, numMicoScience)
			else
				if city:IsHasBuilding(buildingMuscogeeScienceID) then
					city:SetNumRealBuilding(buildingMuscogeeScienceID, 0)
				end
			end
		end
	end
end

function Muscogee_MicoScienceCityView()
local player = Players[playerID]
	if (player:IsAlive() and (not player:IsMinorCiv()) and (not player:IsBarbarian())) then
		for city in player:Cities() do
			local garrison = city:GetGarrisonedUnit()
			if (garrison and garrison:IsHasPromotion(unitPromotionMicoDelegateID)) then
			local numMicoScience = mathMin(Muscogee_GetNumTradeRoutesLeavingThisCity(activePlayerID, city), 3)
			city:SetNumRealBuilding(buildingMuscogeeScienceID, numMicoScience)
		else
			if city:IsHasBuilding(buildingMuscogeeScienceID) then
				city:SetNumRealBuilding(buildingMuscogeeScienceID, 0)
			end
		end
	end
end

if IsMuscogeeCivActive then
	GameEvents.PlayerDoTurn.Add(Muscogee_MicoScience)
	if IsMuscogeeActivePlayer then
		Events.SerialEventEnterCityScreen.Add(Muscogee_MicoScienceCityView)
	end
end
 
Oof, that's a lot of Lua. I couldn't tell you anything for sure, your best shot is probably checking your references in the modiki as well as in others code, maybe post the trait and your progress in c&c for help.

Nexus still isn't working:mad:. It frustrates me to no end!
 
Try changing mathMin to math.min if you didnt put in
local mathMin = math.min
 
I did have that.
But now i'm making it so a Mico doesn't need to be inside a city for the UA to work, and i'm in the middle of testing the new code.

Any help with how to give a free mico in the first 4 cities? I'm not so sure about how to do that.

Edit: My current code didn't work, i'm going to check LUA logs but i doubt its errors in the code and more just my inability to code.
 
I did have that.
But now i'm making it so a Mico doesn't need to be inside a city for the UA to work, and i'm in the middle of testing the new code.

Any help with how to give a free mico in the first 4 cities? I'm not so sure about how to do that.

Edit: My current code didn't work, i'm going to check LUA logs but i doubt its errors in the code and more just my inability to code.
EditEdit: LUA logs are empty. uuuh, ok.
You should really try using print statements in your code - print("example") - and then use the FireTuner's lua log.. That way you get instant info about how far the code executes, and help you pin point where you've made a mistake. That is, if it doesn't just give you an error message, in which the faulty line is indicated.
 
You should really try using print statements in your code - print("example") - and then use the FireTuner's lua log.. That way you get instant info about how far the code executes, and help you pin point where you've made a mistake. That is, if it doesn't just give you an error message, in which the faulty line is indicated.

Found it

Code:
[137816.437] Syntax Error: C:\Users\Rich\Documents\My Games\Sid Meier's Civilization 5\MODS\Firebug's The Muscogee Confederacy (v 1)\LUA/Trait.lua:40: 'end' expected (to close 'for' at line 37) near 'else'
[137816.437] Runtime Error: Error loading C:\Users\Rich\Documents\My Games\Sid Meier's Civilization 5\MODS\Firebug's The Muscogee Confederacy (v 1)\LUA/Trait.lua.

and fixing it.
 
Oof, that's a lot of Lua. I couldn't tell you anything for sure, your best shot is probably checking your references in the modiki as well as in others code, maybe post the trait and your progress in c&c for help.

Nexus still isn't working:mad:. It frustrates me to no end!

Civitar has offered to do a full change of model for that horseman unit, removing the spear and shield - replacing it with a flag - and doing some textures.
Thanks for your help anyway!
 
Top Bottom