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

New Python RFC Like Style Game?

Discussion in 'Civ4 - Creation & Customization' started by Louis the XIV, Jan 13, 2021.

  1. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    818
    Gender:
    Male
    Location:
    Court of Versailles
    I had an idea and am curious if it will work, I'm going to test it out as soon as I get to my PC but before I do I was just wanted to ask if something like this would actually be possible.
    So my idea is to make a variable called Turn which = 0.
    And under the def onTurnEnd function I put Turn += 1, so every time the player ends the turn the variable Turn gets +1 added to it.
    So here is the main idea, I make a statement which is if Turn == 10 or whatever I want then lets say CIVILIZATION_FRANCE gets 1 settler and a warrior at coordinates x and y.
    The only problem would be where should I put the if Turn == 10 statement. Maybe under def onBeginTurn?
    Well tell me your thoughts about this idea!
     
    PiR likes this.
  2. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    883
    You can use gc.getGame().getGameTurn() instead of counting turns yourself.
     
    Louis the XIV likes this.
  3. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    4,149
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Wouldn't it be better to check the game date instead of turns? So you wouldn't have problems with differen game speed.
     
  4. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    818
    Gender:
    Male
    Location:
    Court of Versailles
    Of course! That would be much better!
    Is there like a gc.GetDate.()GetGameDate function?
    Thanks! That would be easier
     
  5. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    883
    Maybe getGameTurnYear()? There is a python reference here, if you don't know already.
     
    PiR and Louis the XIV like this.

Share This Page