Requests for new components (and features)

It's a valid quibble. Unfortunately, the only way to fix it would be a) English only but more importantly b) yield "Pyramids, The". The table widget does the sorting, so we have to give it a string that will sort how we want.

Okay, of course we could rename everything "1. Apostolic Palace" ... "23. The Pyramids", but that's just as bad.

Oh wait ... maybe I can add a zero-width sort column! I'll check into it.
 
Suggestion: Does python know how long until the whip / draft anger leaves a city? If so, how about we put little numbers on the city screen just near the whip (or near the angry total middle top) that display that number. As the turns go by, that number would count down from 10 (normal speed) to 1 and then disappear.

I will take a look at this to see if we can gather the required info ... will look at (highlighted the most likely candidates:

cycity.
32. VOID changeConscriptAngerTimer(INT iChange)
43. VOID changeHurryAngerTimer(INT iChange)
72. INT flatConscriptAngerLength()
73. INT flatHurryAngerLength()
117. INT getConscriptAngerTimer() <-- int () - returns the amount of time left on the conscript anger timer
122. INT getCulturePercentAnger()
168. INT getHurryAngerModifier()
169. INT getHurryAngerTimer() <-- int () - Anger caused by Hurrying timer (why the different description?)
185. INT getNoMilitaryPercentAnger()
197. INT getOvercrowdingPercentAnger(INT iExtra)
228. INT getReligionPercentAnger()
251. INT getWarWearinessPercentAnger()
266. INT hurryAngerLength(HurryType iHurry)
 
Suggestion: Does python know how long until the whip / draft anger leaves a city? If so, how about we put little numbers on the city screen just near the whip (or near the angry total middle top) that display that number. As the turns go by, that number would count down from 10 (normal speed) to 1 and then disappear.

That would be awesome if it is possible!!
 
MA, I'm sorry but it would be a MAJOR rebuilding of the 'Pedia to do that. It seems like alot of work for something somewhat trival.
 
re anger countdown in city ... easy!!! I'll add the ability to turn it off and on via our ini file. However, any comments re style, colour, etc?

Code:
				screen.setLabel( "ProductionInputText", "Background", szBuffer, CvUtil.FONT_RIGHT_JUSTIFY, iCityCenterRow1X - 6, iCityCenterRow2Y, -0.3, FontTypes.GAME_FONT, WidgetTypes.WIDGET_PRODUCTION_MOD_HELP, -1, -1 )
				screen.show( "ProductionInputText" )

				if ((pHeadSelectedCity.happyLevel() >= 0) or (pHeadSelectedCity.unhappyLevel(0) > 0)):
					if (pHeadSelectedCity.isDisorder()):
						szBuffer = u"%d%c" %(pHeadSelectedCity.angryPopulation(0), CyGame().getSymbolID(FontSymbols.ANGRY_POP_CHAR))
					elif (pHeadSelectedCity.angryPopulation(0) > 0):
						szBuffer = localText.getText("INTERFACE_CITY_UNHAPPY", (pHeadSelectedCity.happyLevel(), pHeadSelectedCity.unhappyLevel(0), pHeadSelectedCity.angryPopulation(0)))
					elif (pHeadSelectedCity.unhappyLevel(0) > 0):
						szBuffer = localText.getText("INTERFACE_CITY_HAPPY", (pHeadSelectedCity.happyLevel(), pHeadSelectedCity.unhappyLevel(0)))

# BUG - Anger Display - start
						izAngerTimer = pHeadSelectedCity.getHurryAngerTimer()
						if izAngerTimer < pHeadSelectedCity.getConscriptAngerTimer():
							izAngerTimer = pHeadSelectedCity.getConscriptAngerTimer()

						if izAngerTimer != 0:
							zsAnger = u"[%i]" %(izAngerTimer)
						else:
							zsAnger = ""

						szBuffer = u"%s %s" %(szBuffer, zsAnger)
# BUG - Anger Display - end

					else:
						szBuffer = localText.getText("INTERFACE_CITY_HAPPY_NO_UNHAPPY", (pHeadSelectedCity.happyLevel(), ))

					screen.setLabel( "HappinessText", "Background", szBuffer, CvUtil.FONT_LEFT_JUSTIFY, xResolution - iCityCenterRow1X + 6, iCityCenterRow2Y, -0.3, FontTypes.GAME_FONT, WidgetTypes.WIDGET_HELP_HAPPINESS, -1, -1 )
					screen.show( "HappinessText" )
 
You can see the whipping anger when you hold the mouse pointer over the whipping button. It tells you how long it would take for the whipping anger to disappear when you'd whip again. However, this version is much nicer.

My preference would be to do it in red as it is a bad thing and bad things are in red. :p

What happens when you've whipped twice in quick succession? Would it show something like [18] ? (at normal speed with 10 turns of unhappiness)

Could there be an alert to remind you once the whipping anger has decreased by 1 point? That might be useful as some players tend to continuously use the whip in some high food cities. You can use the reminder function for this, but an alert might be even easier.
 
@Roland ... yes, I know that you can see the whipping anger, but you see "for 19 turns" if you whipped last turn and have to deduct the 10 to get the counter (assuming normal speed). I haven't tested the double whip thing but I would assume "[18]" would be the display. I thought about red but it is a little hard to read sometimes ... will test.

Re reminder / alert ... good idea. We are toying iwth the option of adding a bunch of auto-reminder buttons around the place and this would be one of them. Maybe an alert when it got to 1 would be the go ... alert saying "City X is ready to whip next turn" or "City X is over its whip anger next turn".

Edit: ini file anger counter control added
 
Looks great, Ruff. Only comments would be
  • zsAnger -> szAnger
  • izAnger -> iAnger
  • Maybe change it to "(x Turns)" if that fits to match other places that show # of turns left.*
The prefix "sz" means "zero-terminated string" and "i" means "integer".

I think I remember looking at the C++ code and seeing that it does indeed add the timers up, just like when you hover over the whip button.

For example, whip and wait 5 turns. You have 5 turns left on the timer. All agree.

Whip again, the timer will say 15, but actually you'll have 2 angry for 5 followed by 1 angry for 5. I don't think that Python can get these actual individual values.

However, as Roland suggests, we could have an alert when the # of angry people from whipping/conscription changes, but only if the # of people is exposed to Python. I don't see it in the list Ruff posted.

BTW, what is flatHurryAngerLength()?

* You can copy the code to use the text translator to get the right text. I think you're familiar with this, but if not ask and I'll find the best place to copy. There are a few places in MainInterface, but I think some of them include more than just "(x Turns)".
 
However, as Roland suggests, we could have an alert when the # of angry people from whipping/conscription changes, but only if the # of people is exposed to Python. I don't see it in the list Ruff posted.

Couldn't you calculate the number of unhappy people from the whipping unhappiness counter? (if the number is not directly available)
 
The prefix "sz" means "zero-terminated string" and "i" means "integer".
:lol: I took the 'z' to mean temp, so 'zs' means temp string. Will fix.
BTW, what is flatHurryAngerLength()?
how do I know? I would assume it holds the '10' (normal speed). Will check.
You can copy the code to use the text translator to get the right text. I think you're familiar with this, but if not ask and I'll find the best place to copy. There are a few places in MainInterface, but I think some of them include more than just "(x Turns)".
errr ... what? Assuming you mean that we moved the 'turns' part to xml so we can use if for multilanguage. I think I should be able to track it down.
 
@Roland - I don't know if that works. Say you whip on turn 1 and again on turn 2. You'll have 2 angry for 9 turns and 1 angry for 1 more turn (10 turns total). I think the flat counter will say "19". So it's clear you have 2 angry.

Now wait 7 turns. You've burned off 8 of the first whip and 7 of the second, leaving 2 and 3 for a total of 5 in the flat counter. But you still have 2 angry. So you can't really tell I don't think.

@Ruff - I would have started by dumping those values to the screen and played around with a few cities. That's why I asked you in case you had done the same.

IIRC I created a localized XML text containing just the "(x Turns)" without anything in front. If not, it's easy to copy an existing one.
 
MA, I'm sorry but it would be a MAJOR rebuilding of the 'Pedia to do that. It seems like alot of work for something somewhat trival.

I assumed as much.
 
@Roland - I don't know if that works. Say you whip on turn 1 and again on turn 2. You'll have 2 angry for 9 turns and 1 angry for 1 more turn (10 turns total). I think the flat counter will say "19". So it's clear you have 2 angry.
Is that the way it works? I always thought it was 1 angry for 10 turns from the whip on turn 1 and 1 angry for 19 turns from the whip on turn 2. So you have 1 angry turn 1, 2 angry for turns 2 thru 10, 1 angry for turns 11 thru 19.

@Ruff - I would have started by dumping those values to the screen and played around with a few cities. That's why I asked you in case you had done the same.
Nope, I just went straight for the variable I thought it was and it was exactly what I was looking for. I didn't check the others.

I'm not sold on the 'turns' part, consider the city in revolt, it just says "(2)". The player is able to affect all of the situation where it does say 'turns' but turning things up or down.
 
@Roland - I don't know if that works. Say you whip on turn 1 and again on turn 2. You'll have 2 angry for 9 turns and 1 angry for 1 more turn (10 turns total). I think the flat counter will say "19". So it's clear you have 2 angry.

Now wait 7 turns. You've burned off 8 of the first whip and 7 of the second, leaving 2 and 3 for a total of 5 in the flat counter. But you still have 2 angry. So you can't really tell I don't think.

Whipping unhappiness doesn't work that way, it works a lot simpler.

If you whip on turn 1 and again on turn 2, then the counter says 19 and you'll have 9 turns of 2 unhappiness and 10 additional turns of 1 unhappiness. After 7 turns, the counter says 12 and you'll have 2 turns of 2 unhappiness left and the 10 additional turns of 1 unhappiness. It's an extremely simple formula.

The warning that whipping unhappiness has decreased should occur when the counter reaches a multiple of 10 (on normal speed).
 
@EF ref whip
Whip angries are counted by a single counter. The other bit of info needed is how many turns per whip. Number of angries is simply one divided by the other, rounded up.
In case the above is correct, it's likely from VoU's article. If it's wrong, it's probably just my imagination..

What this means is that if you crack the whip, play a turn, then crack it again, then play seven turns, you will have 12 left in the counter indicating (12/10 = 1.2) two angries. Play two more turns, and counter will be at 10 indicating one angry.
 
well - there you go, 3 posts within 5 mins of each other all containing very similar info. I suggest an alert along the lines as Roland suggested.
 
Wow, I guess it must be right then. :) I think it's actually more complicated and unfair, but it makes calculating the # of angries easy as pie.

I always thought that each time you whipped, you increased the # of unhappy people for ten turns. Whip four times on a single turn and you have 4 unhappy for 10 turns. What you're saying is that you'd have 4 for 10, 3 for 10, 2 for 10, and finally 1 for 10 ... 40 turns of unhappy people. Bogus!

Thanks for clarifying. So if a city has a non-zero angry timer, we fire an alert if it is evenly divisible by hurryAngerLength(HurryType.POPULATION). Actually, we also fire it if it hit zero on this turn, meaning we'd still have to keep track of all the cities that had non-zero timers last turn.

Code:
# untested psuedo-code
angryCities = set()
hurryLength = gc.getInfoTypeForString("HURRY_POPULATION").hurryPopulationLength() # look up actual method

def trackAngryCities:
    angryCities = set()
    pPlayer = gc.getActivePlayer()
    for i in pPlayer.numCities():
        pCity = pPlayer.city(i)
        if pCity.getHurryAngerTimer() > 0:
            angryCities.add(i)

def alertAngryCities:
    pPlayer = gc.getActivePlayer()
    for i in angryCities:
        pCity = pPlayer.city(i)
         iAngerTimer = pCity.getHurryAngerTimer()
        if iAngerTimer % hurryLength == 0:
            alert!!!

Call alertAngryCities() in onBeginPlayerTurn(). Call trackAngryCities() on game load and after calling alertAngryCities(). That's a rough outline that needs some work no doubt.
 
speaking of whipping ~ i mentioned this to ruff, but i think he put me on his ignore list ~

would it be possible to have an alert come up when it's possible to whip something? e.g., i'm waiting and waiting to whip a settler as soon as it is ready, but b/c i'm lazy, i don't want to check the city screen each turn. If an alert could come up saying something like: "The Settler in Rome can now be whipped for x pop" or even "bought for y gold" w/uhhh....emancipation?? i forget, i never use that function.
 
speaking of whipping ~ i mentioned this to ruff, but i think he put me on his ignore list ~

would it be possible to have an alert come up when it's possible to whip something? e.g., i'm waiting and waiting to whip a settler as soon as it is ready, but b/c i'm lazy, i don't want to check the city screen each turn. If an alert could come up saying something like: "The Settler in Rome can now be whipped for x pop" or even "bought for y gold" w/uhhh....emancipation?? i forget, i never use that function.
That is an 'alert'. I don't do alerts. I do unit naming and logging. Over to you EP. That said, I think there might be a python 'please whip me' function that we should be able to use.
 
There's one feature I would kill for- it would make the life of every SE player so much easier: An additional +/- for every kind of specs in city view that removes all specs of a certain kind and puts them into the citizen category/puts as many specs as possible in a certain category. Uber, that would be. :)
 
Top Bottom