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. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Same issue, except in a different chunk of code- turn this:

    Code:
    #Added in Final Frontier Worldbuilder: TC01
    			FinalFrontier = CvEventInterface.getEventManager()
    			pSystem = FinalFrontier.getSystemAt(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY())
    			for iPlanet in range(pSystem.getNumPlanets()):
    				pPlanet = pSystem.getPlanetByIndex(iPlanet)
    				pPlanet.setBonusType(-1)
    #End of Final Frontier Worldbuilder
    into this:

    Code:
    #Added in Final Frontier Worldbuilder: TC01
    			if self.m_pCurrentPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_SOLAR_SYSTEM'):
    				FinalFrontier = CvEventInterface.getEventManager()
    				pSystem = FinalFrontier.getSystemAt(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY())
    				for iPlanet in range(pSystem.getNumPlanets()):
    					pPlanet = pSystem.getPlanetByIndex(iPlanet)
    					pPlanet.setBonusType(-1)
    #End of Final Frontier Worldbuilder
     
  2. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,414
    Location:
    Britain
    Thanks TC01, hope that's the last of the problems i'll have, for a while anyway.
     
  3. TC01

    TC01 Chieftain

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Now, this needs to be updated with 1.7 stuff.

    I'll get to adding this more formally and verbosely to the first few posts in the next few days, hopefully. Off the top of my head, new stuff:

    BUG- No more CvGameUtils or CvFinalFrontierEvents! FinalFrontierEvents and FinalFrontierGameUtils are mostly the same as these two, but use the BUG event manager and

    FFMapscriptCore- findStartingPlot no longer exists in any of the FF+ mapscripts, but in this common module. More functions and things common to multiple mapscripts may end up here.

    Unit Attack/Defense Mods- Now, in addition to the <UnitCombatMod>, there are <UnitCombatAttackMod> and <UnitCombatDefenseMod>. Arrays go at the end of UnitInfo.

    Lead From Behind- Has an XML configuration file, documented in it's own thread.
     
  4. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,414
    Location:
    Britain
    Hi all, I've encountered a small problem whilst playtesting. I haven't tested with the Earth Alliance for quite some time but I've just noticed a problem that initially looks like it is repairable In-game. However even after correcting the error the error comes back which tells me there's a problem somewhere else. The error is with the City/Planet name Sol.

    View attachment 303884
    In the first screen shot I corrected it from the pl it shows to Sol.

    View attachment 303885
    The second screen shot shows that the name has changed over the course of a number of turns to a square symbol followed by pl.

    View attachment 303886
    The third screen shot shows it changed back to Sol.

    View attachment 303887
    The fourth shows the name has changed again to a square followed by ol. I have not noticed this happening on any other Race's city names that I have played.

    Currently playing with another Race and have used WB to see if the same problem exists with Sol when played by the AI and it would appear not, will check out another game playing as EA and see if the same thing happens.

    Any idea's on what is going on/wrong?
     
  5. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Very mysterious.

    The name is put on the screen in CvMainInterface.py,. THe name is appended to the text string to be displayed at line 3820 in the version in FFP 1.73 via code which looks like this:
    Code:
    szBuffer += u"%s: %d" %(pHeadSelectedCity.getName(), pHeadSelectedCity.getPopulation())
    This is just getting the city name from the DLL via the CyCity object's getName function (and then the population too).

    There is nothing after that that should be able to overwrite the string before it gets displayed.

    So unless B5 is doing something to the text displayed up there in that file, it appears to be either getting corrupted in the DLL or there is some B5 specific Python code that can change the city name. In B5 v2.5 Plus I don't see anywhere that it sets the city name in Python other than the Worldbuilder files (which are supposed to do that).

    I think you were using the FFP v1.72 DLL unmodified in the B5 v2.5 Plus you posted. What DLL are you using now, FFP 1.73?
     
  6. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,414
    Location:
    Britain
    Thanks for the response God-Emperor, I'm at work at the moment so can't confirm which DLL i have but I would think it is 1.73, I'll check when I get home.

    EDIT- It is the 1.73 DLL that I am now using.

    EDIT 2 - I've just playtested with the EA again and the problem has not repeated itself.

    In the mean time I have a Modding related question. The Cryogenic Granary didn't exist in FF but was introduced with either FF+ or Finaller Frontier. Having looked at this building a number of times I've come to the conclusion that this is one of those buildings that you only need to build once in a star system.

    My main reason for thinking this is that if the building retains, for example, 10% of the food after the population grows and you have six of them it still only retains 10% of the food not 60% if the effects were cumulative. Therefore, only one would be needed. The other benefit of the Crogenic Granary are +1 health which does seem to be cumulative. Could you please confirm as I can find no other notes/references to this building.
    Thanks in advance
     
  7. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    If you test it, I think you'll find that the Cryogenic Granary's 10% food retention is cumulative. If you have 2 you get to keep 20%, on up to 70% for 7 (which I think would be a waste of production, I usually build only 1 in most systems, 2 in some, and occasionally 3 - particularly in a system with the Workers' Memorial (no unhappy) or the Botanical Gardens (no unhealthy) or both). That is why it was set to 10% instead of the 50% that the regular BtS Granary has.

    Edit: In playing out a game I have realized that I probably underestimated the number of CG's I build - it's about 1 higher than I indicated, being more like 2 in most systems with 1 or 2 more in some.
     
  8. TiglathPileser

    TiglathPileser Chieftain

    Joined:
    Nov 25, 2010
    Messages:
    143
    Hi guys, wonderful mod. Just a quick question, would it be possible to improve wormholes so that trade networks (and in particular resource access) from neighbouring warp/jump lanes can pass through them?
     
  9. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,414
    Location:
    Britain
    Because I've reduced the percentage of food stored for the B5 Mod you need the full number of Cryo Granaries a system will allow. I guess I need to tinker a little more with the percentage of food stored to ensure it does store food as required.
     
  10. Kalina

    Kalina Just lurking...

    Joined:
    Sep 29, 2008
    Messages:
    507
    Location:
    Łódź, Poland
    Hello !

    I'm new to Final Frontier (Plus), so sorry if it was asked before.
    How is number of planets in solar system generated ? Is it possible to easily change it (I mean in XML or python) so it's 1-3 planets per solar system instead of 4-7 ?
     
  11. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    It iwould not be very difficult to do it in Python.

    But you might run afoul of the various requirements for systems - it would be difficult to meet them with fewer than 3 planets in a system, so you'd probably have to relax those a bit too (also in the Python). Currently it also specifically sets home systems to 6 in the Python too.

    The easiest adjustment would be to go into FinalFrontierEvents.py and go to line 32. It currently says
    Code:
    iPlanetQuantityTypePoor = 3
    If you change it to be 1 instead of 3 then the systems will be generated with 1 to 5 planets instead of the current 3 to 7 since this value is the minimum number of planets to which is added a random number from 0 to 4. (Except every civ's home system would still get 6.) You might end up taking considerably longer at game start to generate a set of valid star systems due to the minimum requirements (in the innermost influence zone, the planets you control before any border pop, a system must have a planet that has at least 2 food per population point, a total of at least 3 production, and have room for at least 2 population; home systems have more requirements).

    To do more reduction than that, changes would need to be made to the createRandomSystem function in CvSolarSystem.py.

    By the way, that iPlanetQuantityTypePoor is the only one of those 3 related values that is used. As for the other higher values and the possibility of increasing the planet count, which I'm sure someone is wondering about... I'm not even sure the others would generate valid star systems if used since the solar system model only has room for a specific number of planets. I looked at it a while back and don't remember for sure, but I think it actually has 8 attachment points for planets. Also the city screen only has locations to show 8. So the "Average" value's setting of 4 might work but I'm pretty sure there would be problems with the "Good" value of 6 (the createRandomSystem function does not limit the number to the actual valid maximum).
     
  12. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    So I attempted to import the FF+ (1.81) dll and Python into my STM2 mod and it caused the interface to disappear.

    Every thing seems to be working just fine for the most part. The game is playable. There is just no interface, not even invisible, just not there. Additionally, the stars and planets are gone as well although the orbit dashes remain. The other thing is that options is not selectable from the main menu.

    any ideas? Thanks.
     
  13. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    For one thing, FFP has some extra game options. I think something around 7 were added after the version Star Trek was based on. Star Trek itself also added several (at least 5, I think it is also something around 7) game options that are not in FFP. The options in the XML should match the ones available in the DLL: XML\GameInfo\CIV4GameOptionInfos.xml. You'll need to do a bit of merging if you want to retain some or all of the game options added by Star Trek - I know it makes use of one to flag scenarios for some purpose.

    Also, the FFP Python is BUG based and Star Trek's isn't. The custom code for Star Trek needs to be merged, either into the FFP files or adjusted and added to the BUG load mechanism. Some of how it works has been moved. For example, some functions relating to star systems were moved from the event manager to the CvSolarSystem.py file (the section at the beginning that starts with "FFPBUG additions" through "FFPBUG end of new stuff". Any place these functions are used in the Star Trek code will require some small adjustment.

    I hope you have the HidePythonExceptions set to 0 in your CivilizationIV.ini file so you can see when Python errors happen directly as pop-ups. If the interface is not showing up, there could be Python errors.

    I might think of some more stuff later, but this should get you started.
     
  14. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    Do you think it could be from using some of the older star trek map files (py)?
     
  15. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Yes. If you are using the FFP Python files then this will be an issue. If you are not, then it should not be.

    Assuming that you are...

    It looks like Star Trek adds the planets to the star systems in the map script. FFP (and regular FF) only add the star system feature there, the actual star systems are generated in the onGameStart event handler.

    The problem be be that a function the ST map scripts use has been moved because of the addition of BUG, which added complexities to using functions in the event manager file.

    In particular, it would be one of those functions moved to the CvSolarSystem.py which I mentioned in my previous post.

    Example: In the Star Trek version of SpiralGalaxy.py on line 534 it says
    Code:
    (CvEventInterface.getEventManager()).addSystem(pSystem)
    The addSystem function is no longer in that location or accessed that way. Since this map script directly includes CvSolarSystem.py into the local namespace this can now be done simply via code like this:
    Code:
    addSystem(pSystem)
    Much easier than before, actually.

    I would not be surprised if similar issues existed in all the Star Trek map scripts. I know they exist in the 3 that have the same names as the FPP mapscritps: this SpiralGalaxy.py mentioned above, Wormholes.py, and WormholeSpiralGalaxy.py. (I used WinMerge to compare them, so I am sure of them.)

    They also try to do this:
    Code:
    (CvEventInterface.getEventManager()).initMembers()
    This may not be a great idea if you are using the BUGified version of the Python from FFP. The event manager which the above references is not the FFP event manager, it is the BUG event manager and it probably doesn't have an initMember function. The star system related values which the above resets were moved to the CvSolarSystem.py file. There is a call to reset them, so I expect the equivalent would be this:

    Code:
    resetSystems()
    Also much simpler.
     
  16. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    Okay dokey. I decided to start from scratch.

    I changed the eras and followed every thing is this thread and I get this error:

    Spoiler :
    Code:
    Traceback (most recent call last):
    
      File "BugUtil", line 691, in <lambda>
    
      File "BugEventManager", line 570, in preGameStart
    
      File "CvAppInterface", line 70, in preGameStart
    
      File "CvScreensInterface", line 86, in showTechChooser
    
      File "CvTechChooser", line 231, in interfaceScreen
    
      File "CvTechChooser", line 243, in ConstructTabs
    
      File "CvTechChooser", line 280, in DrawTechChooser
    
      File "CvTechChooser", line 325, in placeTechs
    
      File "CvTechChooser", line 912, in setTechPanelShadowColor
    
      File "BugCore", line 147, in get
    
      File "BugCore", line 118, in _getOption
    
    ConfigError: Option NJAGC__Color_ERA_ENT not found in mod NJAGC
    ERR: Python function preGameStart failed, module CvAppInterface


    which is followed by a blank tech screen and no interface.

    There is some stuff in the XML log that looks thusly:
    Spoiler :
    Code:
    19962.870] Loading XML file xml\Technologies/CIV4TechInfos.xml
    [19962.886] Load XML file xml\Technologies/CIV4TechInfos.xml SUCCEEDED
    [19962.886] SetGlobalClassInfo (Civ4TechInfos/TechInfos/TechInfo)
    [19962.886] info type NONE not found, Current XML file is: xml\Technologies/CIV4TechInfos.xml
    


    Ideas?
     
  17. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    The "NJAGC__Color_ERA_ENT not found in mod NJAGC" refers to some stuff in the BUG configuration files.

    The XML file is: Config\Not Just Another Game Clock.xml
    There is also a Python file: Python\BUG\Tabs\BugNJAGCOptionsTab.py

    In spite of its name, its era related color definitions are used in some places other than just the clock, like for the era related shading in the tech tree.

    There is a related file with text definitions in the XML\Text folder: Not Just Another Game Clock Options.xml

    One of the disadvantages of BUG is that it has a habit of linking things to other things so you end up having to search everything for key words related to whatever you are working on to figure out what else is connected (in this case "_ERA" is a good search term, just "ERA" probably returns too many spurious things).

    Also era related, turned up by the above mentioned search, in GlobalDefinesAlt.xml (the very first entry) is a definition which points the name STANDARD_ERA at what I assume is the normal starting era.
     
  18. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    Thanks. That did fix the problem. But of course, I now have another one.

    After bringing in my buildings, units, tech, ect. I get a lock up at the start of play. I've checked all my XML over and over Again and it all seems alright and I don't get any XML errors or type mismatches. So I think the problem is python related at this point.

    NOTE: I've edited this post a couple times because I'm slowly whittling the bugs down.

    Error log:
    Spoiler :
    Code:
    Traceback (most recent call last):
    
      File "BugUtil", line 691, in <lambda>
    
      File "BugEventManager", line 570, in preGameStart
    
      File "CvAppInterface", line 74, in preGameStart
    
      File "CvScreensInterface", line 75, in showMainInterface
    
      File "CvMainInterface", line 1006, in interfaceScreen
    
    RuntimeError: unidentifiable C++ exception
    ERR: Python function preGameStart failed, module CvAppInterface
    Traceback (most recent call last):
    
      File "CvWBInterface", line 18, in writeDesc
    
      File "CvWBDesc", line 1927, in write
    
      File "CvWBDesc", line 476, in write
    
    RuntimeError: unidentifiable C++ exception
    ERR: Python function writeDesc failed, module CvWBInterface
    Traceback (most recent call last):
    
      File "CvScreensInterface", line 184, in showDawnOfMan
    
      File "CvDawnOfMan", line 167, in interfaceScreen
    
    AttributeError: 'NoneType' object has no attribute 'getButton'
    ERR: Python function showDawnOfMan failed, module CvScreensInterface
    


    I think it has to do with the map initialization but other then that I have no idea. What ever it is crashing the EXE after I enter the main game.

    I'm looking at this from CvMainInterace.py:
    Code:
    filename = ArtFileMgr.getFeatureArtInfo("ART_DEF_FEATURE_SOLAR_SYSTEM").getFeatureDummyNodeName(0, "FEATURE_MODEL_TAG_SMALL_PLANET")
    		screen.addModelGraphicGFC("SelectedPlanetGraphic", filename, xResolution - 220, g_iFFStartY + 46, 90, 90, WidgetTypes.WIDGET_GENERAL, 666, -1, -20, 30, 1.0)
    		screen.hide( "SelectedPlanetGraphic" )
    
    since my xml tags are there and unchanged from FFP, I don't see why this is giving me an issue.

    Next, I'm looking at this from CvWBdesc.py:
    Code:
    f.write("\tFlagDecal=%s\n" %(gc.getPlayer(idx).getFlagDecal().encode(fileencoding)))
    
    I'm pretty stuck with these. I've been searching the forums without much luck.


    v Fixed v

    Spoiler :
    I'm looking at this from CvDawnofMan.py:
    Code:
    # Fancy icon things
    		screen.addDDSGFC( "IconLeft", ArtFileMgr.getCivilizationArtInfo(gc.getCivilizationInfo(self.player.getCivilizationType()).getArtDefineTag()).getButton(), self.X_FANCY_ICON1 , self.Y_FANCY_ICON , self.WH_FANCY_ICON, self.WH_FANCY_ICON, WidgetTypes.WIDGET_GENERAL, -1, -1 )
    		screen.addDDSGFC( "IconRight", ArtFileMgr.getCivilizationArtInfo(gc.getCivilizationInfo(self.player.getCivilizationType()).getArtDefineTag()).getButton(), self.X_FANCY_ICON2 , self.Y_FANCY_ICON , self.WH_FANCY_ICON, self.WH_FANCY_ICON, WidgetTypes.WIDGET_GENERAL, -1, -1 )
    		
    
    ^I fixed this third one by commenting it out.^
     
  19. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    For the first one, check your XML and Art.

    In XML\Art\CIV4ArtDefines_Feature.xml you should have a definition for ART_DEF_FEATURE_SOLAR_SYSTEM. You can compare this file with theone from FFP to make sure
    it has everything. The specific thing it is looking for here, other than that definition itself, is that it should include a section that looks like this:
    Code:
    					<FeatureDummyNode>
    						<Tag>FEATURE_MODEL_TAG_SMALL_PLANET</Tag>
    						<Name>Art/Terrain/Features/SolarSystem/Planet_Small.nif</Name>
    					</FeatureDummyNode>
    That file under the Art folder (it is not Assets/XML/Art, just Assets/Art) must exist somewhere - either in the Art folder as specified or in a .FPK file that the game is loading. It is not in the FFPak1.FPK file - aside from the wormholes, none of the features are. On the other hand, the solar system feature is in the "Start Trek 0.FPK" file (along with at least most of the other terrain and feature related files).
     
  20. cpt.tripps.2012

    cpt.tripps.2012 Chieftain

    Joined:
    May 25, 2012
    Messages:
    176
    Well, I am doing this build from the FFP mod and not the Star Trek mod (starting from scratch w/ the FFP mod). My XML files for the features art def is the sameone as FFP and all the tags are there.

    So I am not using the Star Trek Pack files, Those have been unpacked and are just regular files in the directory. Maybe they are taking priority over the FFPak1.FPK file? I will unpack the FFP FPK and over write anything in my art files. Maybe that will do the trick. I'll keep you pasted.

    Thanks for the idea. I would have never thought of that on my own.
     

Share This Page