Help Wanted Ads

I have another question, How do I get some help text to act like a prerequisite, ie it is red if it is preventing you from building something?

Been wondering that myself so if you haven't got an answer by the time I sort that out in the text codes I'll let you know when I do.
 
If you mean just changing the color there are some tags you can put in the actual text definition in the text XML, which look something like "[COLOR_HIGHLIGHT_TEXT]highlight color[COLOR_REVERT] default color". If a thing can be one color if good and another if bad then it generally defines two different texts and picks which one to use in the game text manager. Example: TXT_KEY_MISC_NEG_GOLD_PER_TURN vs. TXT_KEY_MISC_POS_GOLD_PER_TURN.

Or you can build it in the DLL, putting it into the text string generated in the game text manager, which you can see by searching the source of that function for "color".

There are a number of predefined colors in CIV4ColorVals.xml (well, some 340 of them actually).
 
So no one knows if the dll has any getHero methods added to the global context object! That mans that the code for the Heroes screen can not have worked so must have been a work in progress and I can leave it until next year.
 
How are Heroes denoted in the xml definition on them? Is there a boolean tag to say isHero or something along those lines?

All i can see is that in the UnitsInfo:

<Combat>UNITCOMBAT_HERO</Combat>


EDIT:


From what i can see from the Sevopedia: which is weird:crazyeye:

Code:
###world units - part 2 - The_J
			SevoScreenEnums.PEDIA_WORLD_UNITS	: SevoPediaUnit.SevoPediaUnit(self),
			#~ SevoScreenEnums.PEDIA_WORLD_UNITS	: SevoPediaHero.SevoPediaHero(self),
###world units - part 2 - The_J

Code:
		self.szCategoryUnits		= localText.getText("TXT_KEY_PEDIA_CATEGORY_UNIT", ())
###world units - part 4
		self.szCategoryWorldUnits	= localText.getText("TXT_KEY_PEDIA_CATEGORY_HERO", ())

From the way it looks, it supposed to go to the units, and NOT the Heroes for some darn reason?:confused::crazyeye:
 
hmm... if I was to help in any way there I'd need to know a LOT more. But SO's code up there makes it appear that the original was defining heroes not by combat class but by world unit status (which would limit the unit to only 1 appearance ever in the game.) This also seems like a valid way to identify heroes provided that they are all considered world units also.

I get that DH was wanting a GC for getHero but what I don't know is under what parameters he's talking about. Are we cycling through all units that hasCombatType UNITCOMBAT_HERO and selecting the one called for by a given id on that list or something else?
 
1) I was asking if it existed already. Since the Python code in the SevopediaHeroes.py uses gc.getHeroInfo where ever you would expect gc.getUnitInfo. If te code is not in the dll then the that python screen was not being used. I could rewrite the python, keeping an indexed array where the hero index points to the unit index and just use gc.getUnitInfo.

2) Hero is defined as a world unit ie there can only be one as defined in the UnitClassInfos XML just like world wonders.

EditWhat are the numerical values for each of the properties (Crime, Disease, Pollution(Water) and Pollution(Air)). What I need is Minimum value, Maximum value, Below what value is OK, Above what value is Bad, Above what value is Very Bad. Hint: it is for something like the Revolution warning bar.
 
1) I was asking if it existed already. Since the Python code in the SevopediaHeroes.py uses gc.getHeroInfo where ever you would expect gc.getUnitInfo. If te code is not in the dll then the that python screen was not being used. I could rewrite the python, keeping an indexed array where the hero index points to the unit index and just use gc.getUnitInfo.

2) Hero is defined as a world unit ie there can only be one as defined in the UnitClassInfos XML just like world wonders.

EditWhat are the numerical values for each of the properties (Crime, Disease, Pollution(Water) and Pollution(Air)). What I need is Minimum value, Maximum value, Below what value is OK, Above what value is Bad, Above what value is Very Bad. Hint: it is for something like the Revolution warning bar.
1)Ah, I see what you want now. Hmm... I don't think it'd be problematic to simply use gc.getUnitInfo in that case.
2)Right, that was what SO's post seemed to imply (I'm aware of world units but I wasn't sure if all our heroes were denoted as such.)

THAT depends on the specific RESULT of the property, like a building that would auto build is given an iminimum and an imaximum and so on. I'm soon to go in and take a much deeper look into the structure of that system so I can harmonize with it better in my Disease mechanism so I can't get much more specific yet.
 
THAT depends on the specific RESULT of the property, like a building that would auto build is given an iminimum and an imaximum and so on. I'm soon to go in and take a much deeper look into the structure of that system so I can harmonize with it better in my Disease mechanism so I can't get much more specific yet.

City value. Eg Revolution Index has a value for the city. There is a maximum and minimum value the revolution index can have. If it goes above 50% then you should start worrying and do something, above 75% change you better get the troops in (numbers are not actual just examples).
 
Each property info has a range specified via the iOperationalRangeMin and iOperationalRangeMax values in teh XML. It can go out of the range, but the range specifies the low end where effects start to happen and a high end by which time the effects are as bad as they are going to get. Crime, in v27, has them at 0 and 1000. The "badness" is probably not well defined (i.e. it isn't just some function of the value) since it depends on the auto-build levels for buildings for the property and some of the buildings have mild effects and others stronger effects.

Thesetwo range values do not currently appear to be available to the Python. The only properties of the PropertyInfo that are defined for Python (in v27, I suppose more could be in the SVN) are getChar (to get the font symbol for the property) and isSourceDrain (I have no idea what the python does with this). These are defined in CyInfoInterface4.cpp.
 
Each property info has a range specified via the iOperationalRangeMin and iOperationalRangeMax values in teh XML. It can go out of the range, but the range specifies the low end where effects start to happen and a high end by which time the effects are as bad as they are going to get. Crime, in v27, has them at 0 and 1000. The "badness" is probably not well defined (i.e. it isn't just some function of the value) since it depends on the auto-build levels for buildings for the property and some of the buildings have mild effects and others stronger effects.

Thesetwo range values do not currently appear to be available to the Python. The only properties of the PropertyInfo that are defined for Python (in v27, I suppose more could be in the SVN) are getChar (to get the font symbol for the property) and isSourceDrain (I have no idea what the python does with this). These are defined in CyInfoInterface4.cpp.

Thank you. The values (current and change) must be available also since they show up in the city screen. I was just looking at seeing if I could put the properties on the main screen since I always forget to switch to look at them.
 
The current value and change and some other stuff are available from the CyProperties rather than the CyPropertyInfo. It's something like the difference between a unit info and a unit - the CyProperty Info would ve where to look for the base data, like the operational range values, if they were exposed to Python and the CyProperty is used to find out what the current values are.

I'm not sure where you'd put them on the main screen since they are per city and per plot, mostly. The current values (but not the current rate of change) show up on the hover help for plots and cities. You can also add columns for them to the domestic advisor screen so you can see the values for all your cities.

The code for showing them on the city screen is pretty clear, lines 4600-4612 in the v27 CvMainInterface.py file.
 
I was going to add fuel gauges in the city screen similar to the way Rev does. It wont happen until late Jan as I head of for the family get together in a couple of days.
 
Back
Top Bottom