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

Rapa Nui for 600 AD start

Discussion in 'Rhye's and Fall Modmods' started by AnotherPacifist, Aug 9, 2009.

  1. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    So now that Rhye has fixed the bug where Moai Statues get destroyed on capture, there is a reason to put them where they rightfully belong, i.e. the island west of Chile with the goody hut. Quote from Wikipedia:
    So founding date can be anywhere from 700 to 1200 AD.

    I tried to add a city manually with an American start but I can't add it, so when I tried to do it starting the the Chinese and saved the map, on restart it gave the initial civs double units. Does somebody know how to do it in Python?
     
  2. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    I think the really tiny population is a good reason not to have a city there that would inevitably reach size 4-5. But I can write a line if you'd like them to spawn as an independent city mid-game.
     
  3. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Try the following. In Barbs.py add after line 71:
    Code:
    lRapaNui = [20, 15, 211, 0] #900AD
    Then add after original line 285:
    Code:
                    self.foundCity(iNative, lRapaNui, "Rapa Nui", iGameTurn, 1, -1, -1)
    Then add after original line 323:
    Code:
                            if (lCity == lRapaNui):
                                    gc.getCity((lCity[0], lCity[1])).setNumRealBuilding(con.iMoaiStatues,1)
    I haven't tested this so use discretion. i.e. make a copy of your original Barbs.py file.
     
  4. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    Thanks for the code. But it didn't work, I found it's actually
    lRapaNui = [20, 16, 211, 0] #900AD

    and the Moai didn't appear. Where am I supposed to put the 3rd piece of code? (can you give me the lines right before it)
     
  5. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Try right at the end of the foundCity code, so the function ends with the 2 new lines.
     
  6. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    Sorry, still no luck with Moai.

    Are you sure it's setNumRealBuildings rather than setHasRealBuilding? From the victory.py code, a TA is constructed with this:

    Code:
    capital = gc.getPlayer(iPlayer).getCapitalCity()
     capital.setHasRealBuilding(con.iTriumphalArch, True)
     
  7. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,434
    Location:
    Ireland
    Sure, try that. It's possible that the code I provided you with only works for certain kinds of buildings, but it normally works.
     
  8. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    No, got You've been defeated! I wrote Rhye to get a little bit of help.
     
  9. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    Thanks to Rhye who gave me the following code:

    if (self.getCity((lCity[0], lCity[1])).getName() == "Rapa Nui"):
    self.getCity((lCity[0], lCity[1])).setHasRealBuilding(con.iMoaiStatues, True)

    in foundCity
    right above return True

    but it still doesn't work!
     
  10. 3Miro

    3Miro Deity

    Joined:
    Apr 23, 2008
    Messages:
    3,480
    Location:
    Knoxville USA
    Look into My Games\Beyond the Sword\PythinErr2.log, if the code has not been set up properly, you should see a message (or something about a possible error). Python is picky about indentations and such.
     
  11. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    That piece of Rhye's code was deemed not kosher with syntax. I'm never touching python again. A few spaces made me go to "You've been defeated" rather than just no Rapa Nui. Can somebody please help? It shouldn't be that hard.
     
  12. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    OK, so it seems you have to have EXACTLY the same indentation as the previous line, otherwise any extraneous spaces will be counted as syntax errors. I'm now running a simulation with the Americans.
    Thanks Rhye, Panopticon and 3Miro.
     
  13. AnotherPacifist

    AnotherPacifist Deity

    Joined:
    Sep 21, 2007
    Messages:
    4,878
    So as expected, because the AI is stupid enough not to build a harbor, Rapa Nui stayed at size 1 (which is appropriate) in 1776. When I added an American galleon with 3 rifles in it, I conquered Rapa Nui the next turn and the Moai Statues stayed intact. Would be a nice addition to having historically correct wonders, since it did not change gameplay essentially (Europe was dominated by Germany, France vassalized to Turkey and so did the Amerindians and Mali, while Arabia and China and Japan were happily chugging along).

    If I remember correctly from Wikipedia, the island was discovered by the Dutch in 1722, and then annexed by Chile later on. Would be nice to also add Hawaii around 500 AD and include 3 islands to be colonized by either the Americans, Dutch or English as part of their UHVs, to make more use of the vast Pacific (mostly ignored by both the human and AI).
     

Share This Page