Friends, coders, artist, lend me your ears!

Isn't the Himeji castle's bonus universal though?

See, I was assuming something like this pseudocode:
Spoiler :
Code:
local numPromotions = 10 -- I guess

GameEvents.UnitSetXY.Add(
function(iPlayer, iUnit, iX, iY)
	local pPlayer = Players[iPlayer]
	local pUnit:GetUnitByID(iUnit)
	local iNumTradeRoutes = ###!!!!WIZARDRY.### -- not a real function

	-- Magic:
	for k,v in pairs(bts(2^numPromotions)) do
		-- note: bts(int NumberToConvert) is a number-to-bits function in a utility file I made
		pUnit:SetHasPromotion(GameInfoTypes["PROMOTION_WHATSTHISPROMOTIONCALLED_"..tostring(v*5)], false)
		-- I assume this promotion, like that of the catapult, gives only a vs. city bonus
	end
	
	-- bunch of code to find if the unit is ours
	-- and if it's next to an enemy city
	
	-- moarMagic(tm):
	for k,v in pairs(bts(iNumTradeRoutes)) do
		pUnit:SetHasPromotion(GameInfoTypes["PROMOTION_WHATSTHISPROMOTIONCALLED_"..tostring(v*5)], true)
	end
	
	-- yay we're done
end)
But if no binary haxxing, fine. Where do we cap it? 10 promotions would be a measly 50%.
...although to be fair... I'm not sure it's actually possible to get 10 trade routes in game...
 
It's possible to get 10 Trade Routes if you get Petra and the Colossus.

The Himeji Castle's bonus, much like Statue of Zeus, grants it to the units it can grant. If it's not part of the group, well, you're out of luck, then.
 
Okay so you need a dummy building to get a combat bonus against cities? Also would putting a cap on combat strength be a good idea? 25,30%?
 
It's not just that a cap would be a good idea, a cap is required. An bonus which can go infinitely high would require infinitely many promotions, which would take infinitely long to load and would use up infinitely many computing resources like memory and CPU usage, which would require infinitely many microchips, which would require an infinite amount of silicon, which is more than there actually is in the universe.

So we need a cap; it's just a matter of determining where. 50% is probably a good bet, but just for those superplayers who can get absolutely everything required for 10 trade routes (I personally can't, but...) Although, just to be safe and account for people somehow being able to go above and beyond this - say, with a civ like MC's Minoans - we should set it a little higher, at 60% or 70%. But then, 70% requires 14 separate promotions if we're not going the binary promotion route. It becomes a problem, essentially, of pedia cluttering vs. unit panel cluttering.
 
AFAIK one of the few ways to get extra Trade Routes is through having a Defensive Pact with JFD's New Zealand. Other than that, I can't think of any.
 
[...] It becomes a problem, essentially, of pedia cluttering vs. unit panel cluttering.

This might be what you're looking for then (Another amazing Whoward mod :D)
 
It's not just that a cap would be a good idea, a cap is required. An bonus which can go infinitely high would require infinitely many promotions, which would take infinitely long to load and would use up infinitely many computing resources like memory and CPU usage, which would require infinitely many microchips, which would require an infinite amount of silicon, which is more than there actually is in the universe.

So we need a cap; it's just a matter of determining where. 50% is probably a good bet, but just for those superplayers who can get absolutely everything required for 10 trade routes (I personally can't, but...) Although, just to be safe and account for people somehow being able to go above and beyond this - say, with a civ like MC's Minoans - we should set it a little higher, at 60% or 70%. But then, 70% requires 14 separate promotions if we're not going the binary promotion route. It becomes a problem, essentially, of pedia cluttering vs. unit panel cluttering.

True true there needs to be a cap somewhere, I'm okay with a 30% cap, nice bounds that doesn't require to many promotions and dummy buildings.

AFAIK one of the few ways to get extra Trade Routes is through having a Defensive Pact with JFD's New Zealand. Other than that, I can't think of any.

Yeah you're right, Sedon will get two trade routes while you will only get one.
 
AFAIK one of the few ways to get extra Trade Routes is through having a Defensive Pact with JFD's New Zealand. Other than that, I can't think of any.
Numerous modded wonders on the workshop add additional trade-routes.

Other mods add huge numbers of trade-routes for any and all players.
 
True true, but we can't make a bonus for all those trader routes. Rum would be over powered and the coding would be silly.
I meant this is why a cap is a good thing...you cannot assume there will only ever be X trade-routes and so a cap is not necessary.
 
That'd be too small. Max 100%, +10% per Trade Route would be better.
 
Too small.
 
Well no we're not limiting the amount of trade routes the civ can have, we're putting a cap on how many trade routes I can have so that the civ doesn't get ridiculous combat bonus agaisnt cities. That's why instead of it being 5% per trade route I bumped it up to 10% per trade route and put a cap on 5 routes. But apparently it is too small of a bonus.
 
That is way too small of a bonus. A ridiculous combat bonus would be limit 10 trade routes at +150%, and even then, consider it's only against cities. Most of the fighting is, unsurprisingly, against Units.

+100% doesn't even affect the game that much - it's surprisingly hard to keep Trade Routes going in times of war. If you can manage that and still conquer stuff, you're doing some insane micromanagement.
 
Well no we're not limiting the amount of trade routes the civ can have, we're putting a cap on how many trade routes I can have so that the civ doesn't get ridiculous combat bonus agaisnt cities. That's why instead of it being 5% per trade route I bumped it up to 10% per trade route and put a cap on 5 routes. But apparently it is too small of a bonus.
If you are talking about a combat bonus given to units when attacking cities, then even 25% total is pretty darn powerful. Himeji Castle only gives 15% combat boost to units in friendly lands. 50% against cities is a second "siege" promotion, so I don't see how a cap at "50%" can be seen as anything but powerful (and perhaps a bit OP).
 
That is way too small of a bonus. A ridiculous combat bonus would be limit 10 trade routes at +150%, and even then, consider it's only against cities. Most of the fighting is, unsurprisingly, against Units.

+100% doesn't even affect the game that much - it's surprisingly hard to keep Trade Routes going in times of war. If you can manage that and still conquer stuff, you're doing some insane micromanagement.

Hmm I see your point, but how much would +100% actually feel like? How quickly could you take down a city with that bonus?

If you are talking about a combat bonus given to units when attacking cities, then even 25% total is pretty darn powerful. Himeji Castle only gives 15% combat boost to units in friendly lands. 50% against cities is a second "siege" promotion, so I don't see how a cap at "50%" can be seen as anything but powerful (and perhaps a bit OP).

Yeah the combat bonus is given to any and all units that attack cities, so that's why I want a cap at a low amount of trade routes. So 25% is a good enough number, GPuzzle does bring up a point about maintaining those trade routes, especially in war.
 
Top Bottom