1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Modder's Guide to Final Frontier Plus

Discussion in 'Civ4 - Final Frontier Plus' started by TC01, May 28, 2010.

  1. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    Nope. Small planet is fine. It has something to with:
    Code:
    screen.addModelGraphicGFC("SelectedPlanetGraphic", filename, xResolution - 220, g_iFFStartY + 46, 90, 90, WidgetTypes.WIDGET_GENERAL, 666, -1, -20, 30, 1.0)
    
    I cant find any reference to "SelectedPlanetGraphic" anywhere other then CvMainInterace.py
     
  2. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    The ""SelectedPlanetGraphic" is a label that this function uses to identify this specific graphic. The very next line hides that graphic via that label since this is in the setup phase of the operation. If it is supposed to be shown, depending on whether or not the main screen is currently in city mode, it will be unhidden later (via the line that says screen.show( "SelectedPlanetGraphic" ) down on line 4118 of the regular FFP version of the file).

    It is unlikely that the xResolution or g_iFFStartY variables are the problem, likewise for the WidgetTypes.WIDGET_GENERAL constant. That leaves the filename variable as the most likely culprit. Or, more specifically, what that is set to.

    You could put in a print statement immediately before that line to see what the filename variable is being set to. (Likewise for the others, just to be sure). A simple
    Code:
    print("filename='%s', xResolution=%d, g_iFFStartY=%d" % (filename, xResolution,  g_iFFStartY))
    would produce a line with that information in the PythonDbg.log file for every time the function holding this stuff is called (which should only be once, at the start of the game).
     
  3. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    So it is pointing to Planet_Small.nif
    Code:
    filename='Art/Terrain/Features/SolarSystem/Planet_Small.nif', xResolution=1366, g_iFFStartY=165
    
    That file does exist in that location and is current with FFP 1.81

    CIV4ArtDefines_Feature.xml reads:
    Code:
    <FeatureDummyNode>
               <Tag>FEATURE_MODEL_TAG_SMALL_PLANET</Tag>
    	   <Name>Art/Terrain/Features/SolarSystem/Planet_Small.nif</Name>
    </FeatureDummyNode>
    
    Could there be some reason it is not pointing to the assets folder?
     
  4. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    So apparently fixing the world builder bug also fixed the terrain bug, although I have no idea why!

    :borg:

    Thanks again for the help. i think I can handle it from here!
     
  5. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    OK. New one. I have no error log to go with this one.

    All of my buildings with a Religion prereq don't show up in the build menus even though I have the required religion on my planet.

    Any ideas?
     
  6. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    How does the building definition compare to buildings that require religions in FFP? (Or, for that matter, the older Star Trek mod.)

    In FFP the buildings other than the shrines whcih require a religion use only the PrereqReligion tag, not any of the other religion related tags. The Shrines use HolyCity (can only be built in holy city of specified religion) and ReligionType (which might be redundant) and also GlobalReligionCommerce (which is not related to being able to build the thing, it sets this building as getting the bonuses for every city that has the religion) and ReligionChanges (which is also not related to being able to build the thing, it increases the religion spread chance).
     
  7. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    The problem was that the special buildings <bvalid> was set to zero. I changed it to a one. Problem solved!
     
  8. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    What is the definition for SPECIALBUILDING_MUSEUM in CIV4SpecialBuildingInfos.xml?

    In that file it can specify a tech prereq which you might not have yet or an obsoleting tech which you might have. Also important is the bValid tag in there. All of the entries in the FFP version of this file have it set to 0 because no building actually uses the special building stuff. If SPECIALBUILDING_MUSEUM has bValid set to 0 then it deactivating the buildings that use it - it should either be set to 1 or there should be a project that sets it to be valid (which, without modding the projects, will activate them for everyone).

    In regular BtS the only special building type that has bValid set to 0 is the SPECIALBUILDING_BOMB_SHELTER which is set to valid by someone finishing the Manhattan Project (unlocking both nukes and this special building type for everyone).
     
  9. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    :crazyeye: I got it. Thanks. My apologies if this stuff seems really basic. :blush:
     
  10. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    I'm looking at CvAI.py and when I got to commerce I saw this:

    Code:
    #######################################################################
    			# Commerce
    			#######################################################################
    			
    			if (iBestWeightType == iCommerceWeightType):
    				
    				iFood = 0	 #Add to our food planets :)
    				
    				# Find the best planet to give us some Commerce
    				aiSizeFoodPlanetIndexList = pSystem.getSizeYieldPlanetIndexList(iFood)
    				
    				iPass = 0
    				
    				# Loop through the planets in the order of best to worst (for Food)
    				for iPlanetLoop in range(len(aiSizeFoodPlanetIndexList)):
    	
    					iPlanetFromList = aiSizeFoodPlanetIndexList[iPlanetLoop][2]	# CP - the list is lists of pop limit + food value + planet index
    					pPlanet = pSystem.getPlanetByIndex(iPlanetFromList)			#    - select in descending order of "size" and food-per-pop
    					
    					# Can only use planets in our radius
    					if (pPlanet.isPlanetWithinCulturalRange()):
    
    Why would you want to loop though by best to worse food? Wouldn't you want to loop through by best to worse money?
     
  11. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    On a separate note I'm up against this nasty bug. This one is scene shot worthy.


    So any ideas about that?

    It shows up about 100 turns in and crashes the game.
     
  12. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    First, you should know that the comments are misleading. Particularly the one right before the loop...

    The function call pSystem.getSizeYieldPlanetIndexList(iFood) does not actually return a list sorted by food output. It returns the planets sorted by size (the current population limit), biggest first. It uses the passed yield type when there are planets of the same size - those are sorted by the specified yield, highest to lowest also.

    Before I got my hands on it, it used getYieldPlanetIndexList which does sort only by the yield type. I added the getSizeYieldPlanetIndexList function and switched to using that.

    The reason for the change is that improving the biggest planets first gets you the most: adding a Mag-Lev Network gives +1 commerce per population point for the planet. If you add it to a size 1 planet you can only get +1 commerce/turn (unless you build another building to increase the population limit), but if you add it to a size 4 planet (size 3 + a building that gives +1 is already built there) you can get +4 commerce/turn from just that one building.

    That is in the section that is trying to increase the system's commerce output, but you still almost always want food. Therefore it is usually good for population to be assigned to planets that have high food. Also, increasing the commerce of a high commerce planet does nothing for the AI if the planet has little or no population assigned; planets with high food are likely to have population assigned.

    Technically, it might be better to loop over the planets in order from highest actual assigned population to lowest actual assigned population instead of using the limit. I can't really guess if that would help or not, but a higher population capacity planet at least has the potential to get you more from that one building. It should be reassigning the population of the system reasonably often, or gaining population at a reasonable rate, so the added value will tend to attract more population if it is interested in commerce during the assignment.

    Note that the immediately preceding section for production uses the same method. So do the food and population sections.
     
  13. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    The display gets that number via the planet object's getPopulationLimit function (in CvSolarSystem.py). There are only 3 things involved:

    1) the aiDefaultPopulationPlanetSizeTypes global array, defined near the end of that file

    2) the buildings on the planet, via the iPlanetPopCapIncrease values from CIV4BuildingInfos.xml (which default to 0 if not specified)

    3) the civics of the owning player, also via the iPlanetPopCapIncrease values from CIV4CivicInfos.xml

    I do not know if it deals with negative numbers well for items 2 or 3, so if you have one in there then that could be it. (I have never tried to use a negative value for this.)
     
  14. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    It was the civic! That explains why it was in the middle of the game.

    I had a line in one that was "<iPlanetPopCapIncrease/>". I never would have thought of that in a million years!
     
  15. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    The issue of today is that I copied my Star Trek Mod over to a new computer that doesn't have FFP and it doesn't want to run. I don't even get the loading splash screen.
    The mod folder is "Star Trek II" and it contains everything from the FFP folder. I changed the default theme paths in CIV4ArtDefines_Misc.xml and Civ4.thm as instructed in this forum. Am I missing something?

    EDIT: DUH!!!! I forgot the 3.19 patch with the new install. I'm sure that will solve it.
     
  16. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,410
    Location:
    Britain
    I've been going through the XML files and amending things for the B5 Mod and have noticed that I am unable to change the mouse over help text on the transports.

    The strategy text shows the text I want the mouse over/special abilities to show instead of the default text for a caravel.

    I've found these two entries in the Vanilla Civ IV that I believe generates the information on the screen shot.
    Code:
    	<TEXT>
    		<Tag>TXT_KEY_UNIT_CARGO_SPACE</Tag>
    		<English>[ICON_BULLET]Cargo Space: %d1_Num</English>
    		<French>[ICON_BULLET]Capacité d'emport : %d1_Num</French>
    		<German>[ICON_BULLET]Frachtraum: %d1_Num</German>
    		<Italian>[ICON_BULLET]Spazio di carico: %d1_Num</Italian>
    		<Spanish>[ICON_BULLET]Bodega: %d1_Num</Spanish>
    	</TEXT>
    	<TEXT>
    		<Tag>TXT_KEY_UNIT_CARRIES</Tag>
    		<English>[SPACE](Carries %s1_Name)</English>
    		<French>[SPACE](transporte : %s1_Name)</French>
    		<German>[SPACE](Befördert %s1_Name)</German>
    		<Italian>[SPACE](trasporta %s1_Name)</Italian>
    		<Spanish>[SPACE](%s1_Name)</Spanish>
    	</TEXT>
    All I need to be able to do is get this to generate the information I require. Any suggestions?
     
  17. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    Wouldn't that just be the <help/> tag in the Civ4unitInfos.xml ?
     
  18. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,410
    Location:
    Britain
    I've tried looking for an example of the <help/> tag in use but couldn't see one anywhere on the Caravel which is what i'm using as a base template.
     
  19. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    The text is generated in the DLL, via CvGameTextMgr::setUnitHelp. This creates the text that appears in the help pop-up and the properties list in the 'pedia.

    You can probably get the text you want just by changing one text key. From what it says I know that the list of units carried is based, in this case, on the SpecialUnit type the unit can carry: it can carry SPECIALUNIT_PEOPLE. In this case, the specific text key (as defined for that special unit type in CIV4SpecialUnitInfos.xml) is TXT_KEY_SPECIALUNIT_PEOPLE. The BtS definition for this is "Scouts, Explorers, Missionaries, Spies, Great People". If you redefine that text key in your mod to list the actual ships, as in the Strategy text, then it should show what you want.

    The Help tag can be used to add text, but is not normally used. Out of the units in FFP only the Doomesday Missile and 3 generations of Starbase use it.
     
  20. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,410
    Location:
    Britain
    After looking through the XML the file showed the following for Special people.

    Code:
    		<SpecialUnitInfo>
    			<Type>SPECIALUNIT_PEOPLE</Type>
    			<Description>TXT_KEY_SPECIALUNIT_PEOPLE</Description>
    			<bValid>1</bValid>
    			<bCityLoad>0</bCityLoad>
    			<CarrierUnitAIs>
    				<CarrierUnitAI>
    					<UnitAIType>UNITAI_SPY_SEA</UnitAIType>
    					<bUnitAI>1</bUnitAI>
    				</CarrierUnitAI>
    				<CarrierUnitAI>
    					<UnitAIType>UNITAI_MISSIONARY_SEA</UnitAIType>
    					<bUnitAI>1</bUnitAI>
    				</CarrierUnitAI>
    				<CarrierUnitAI>
    					<UnitAIType>UNITAI_ASSAULT_SEA</UnitAIType>
    					<bUnitAI>1</bUnitAI>
    				</CarrierUnitAI>
    			</CarrierUnitAIs>
    			<ProductionTraits/>
    		</SpecialUnitInfo>
    I have now amended this to show the following

    Code:
    		<SpecialUnitInfo>
    			<Type>SPECIALUNIT_PEOPLE</Type>
    			<Description>TXT_KEY_SPECIALUNIT_PEOPLE</Description>
    			<bValid>1</bValid>
    			<bCityLoad>0</bCityLoad>
    			<CarrierUnitAIs>
    				<CarrierUnitAI>
    					<UnitAIType>UNITAI_CITY_DEFENSE</UnitAIType>
    					<bUnitAI>1</bUnitAI>
    				</CarrierUnitAI>
    			</CarrierUnitAIs>
    			<ProductionTraits/>
    		</SpecialUnitInfo>
    This change doesn't appear to have made any difference to the text that is displayed in the civilopedia.
    View attachment 337146

    Have I changed it to the correct Unit AI?
     

Share This Page