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

Modmodding Q&A Thread

Discussion in 'Rhye's and Fall - Dawn of Civilization' started by Leoreth, Dec 14, 2013.

  1. Leoreth

    Leoreth Friend Next Door Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,995
    Gender:
    Male
    Location:
    Faraway
    Neither. "is" means that it is the same object instance, which is not always the case for instances representing the same player. "==" is not defined for CyPlayer instances so it falls back to "is" as well.

    To answer the question: kTriggeredData.ePlayer already is the player ID you are looking for, there is no need to go from there to CyPlayer first and then back to the player ID. But more generally, you can always get the player ID with CyPlayer.getID.
     
    MacAurther likes this.
  2. MacAurther

    MacAurther Chieftain

    Joined:
    Feb 2, 2013
    Messages:
    27
    Ah, of course! That was pretty silly of me. Thanks, Leoreth! :)

    In the case that I actually do need to go from CyPlayer to player ID, I thank you!
     
    Leoreth likes this.
  3. Cole98

    Cole98 AKA CerebralPolicy

    Joined:
    Feb 10, 2012
    Messages:
    135
    Gender:
    Male
    Location:
    Salmon Arm, Canada
    Will this period condition work?

    Code:
        if iEngland in [iCiv, iOwnerCiv]:
            #if England retains New York and Boston after American Revolution, New England is assigned to Canada
            if city.at(30,48) and city.at(31,50) and (year() < year(1800) and year() != year (1802)):
                setPeriod(iCanada, iPeriodCanadaExpanded)
            else:
                setPeriod(iCanada, -1)
     
  4. Leoreth

    Leoreth Friend Next Door Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,995
    Gender:
    Male
    Location:
    Faraway
    What event are you handling here?
     

Share This Page