1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Cannot build planetary improvements

Discussion in 'Civ4 - Star Trek Mod' started by CainStar, Sep 21, 2011.

  1. CainStar

    CainStar Chieftain

    Joined:
    Aug 15, 2007
    Messages:
    200
    This is my 3-4 game and I'm playing as Cardassians. So I had a random event 'Nuclear meltdown' in one of my systems and thus the planet which the improvement was build on is destroyed(goes 0/0 population). But now for some reason I cannot build any planetary improvements in any of my systems, and the ones that had improvements under construction stop also. Is there away fix this? :confused: :confused: :confused:
     
  2. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    This was reported by deanej over in the Final Frontier Plus bug thread. I have verified that there is indeed a bug in the meltdown related stuff (and still a bug in the general nuke effects). A fix will be posted over there later tonight.

    There is no easy in-game fix for an existing game at this point - if you have a save from before it happened (like an autosave) then you should be able to continue from there after a fix is made to the Python and XML.

    What has happened in your game is that due to the meltdown some random selection of buildings may have been destroyed by the DLL for the "city" (as far as the DLL is concerned it is a city, not a star system) across the entire system (not just on one planet, since the DLL knows nothing about planets) which is not reflected in the planet data (stored in Python), and buildings of the type that had the meltdown were also destroyed in the DLL but not necessarily in the Python planet data. Ont he Python side, only the buildings on one planet int he system are destroyed (with luck this can make the data match, but evidently not in this case). Having a mismatch between what buildings the DLL things there are and what the Python thinks there are is what causes the "can't build any buildings" problem.

    Currently, this issue can be avoided only by luck: if no building has ever been built in the system except on the one planet that starts with free buildings then it would not happen (since that planet would be the one wiped out, which removes the buildings on the planet from both the Python and DLL's data), otherwise it is would require pure luck that no building of a type built anywhere else in the system but not on that first planet is wiped out by the random chance used by the DLL.

    The fix will stop the DLL from destroying any buildings itself when this happens - it will all be done in the Python code, which can deal with the planets and won't have this problem.
     
  3. CainStar

    CainStar Chieftain

    Joined:
    Aug 15, 2007
    Messages:
    200
    Ok thanks for the reply.....btw if somebody is experiencing the same problem as I was, and it seems even thou you reload your savegame and the "random" event keeps happening, simply use WB and remove both power improvements for few turns and then add again with WB.
     
  4. deanej

    deanej Chieftain

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
    Incidentally I'm gonna use this as an opportunity to see if I can make the installer a little more robust. I don't know if it will be possible (since I use Inno and not something more advanced) but I'll see.
     
  5. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    A fix has been posted over in FFP/Bug Thread, in case you didn't notice (or even if you did).
     
  6. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    I have posted a re-fix of the meltdown code over in FFP/Bug Thread.

    New and improved! Now with at least two fewer circumstances under which it will fail to solve the "can no longer build buildings" issue. (With a little luck that will bring it down to 0 such circumstances.)

    I also implemented the same fixes in the onNukeExplosion event handler, which also had them (which is why the onMeltdown callback did since I copied that code from there).

    And, as an added bonus, I made the posted onMeltdown code compatible with pre-BUG versions of FPP and related mods - the code I posted yesterday had a compatibility issue.
     
  7. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Yes, I have just posted a re-re-fix of the meltdown code.

    Advantage to this version: it should, I hope, actually work as intended. No failure due to an undefined variable if the there is a resource on the planet. No applying damage to every ship the player owns instead of just the ones on the star system's plot. Plus an adjusted cannotConstruct function to stop buildings from being built on disabled planets unless they are set to be nuke immune.

    I really really hope this is the last time I have to fix this code. Really.
     
  8. jfby

    jfby Chieftain

    Joined:
    Jun 17, 2008
    Messages:
    196
    I apologize God-Emperor, but is there an 'easy' way to manage the files in the Civ IV Star Trek mod to integrate the changes? Thank you!
     
  9. deanej

    deanej Chieftain

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
    Wait for me to get around to repackaging the installer might be the best bet. The easiest changed I had was changing the buildings... since Star Trek doesn't have any buildings not tied to a planet, I was able to use a fine and replace tool. Python took a bit longer (and I had to tweak the onNukeExplosion one).
     
  10. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Oops. Let me guess: the line with the FFPBUG comment needed a "self." prefix on the getSystemAt function?
     
  11. deanej

    deanej Chieftain

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
  12. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Ah. I didn't check the Star Trek code for mod-specific things, so missing that doesn't surprise me. (Amongst other things, there are just so many Star Trek mods to check so I didn't even try.)

    I was hoping it wasn't some bug I missed.
     
  13. deanej

    deanej Chieftain

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
    Fortunately that was the only difference; most of Star Trek's python is similar to FF+ since there's less hardcoding. The scenarios add python mainly to the turn start events though there's a couple of exceptions.
     

Share This Page