Relationships Last Extra Rounds - Resolved -

  • Relationships Last Extra Rounds

    Mentions a default relationship duration.

    I can not find where that default is set, closest I see is roundValue in relationshipInitialize, but that appears to be something else.

  • Admin

    @mahks POS2 XML:

        <!-- If this is set, it adds or subtracks from any conditions that require a relationship to last for X rounds -->
        <property name="Relationships Last Extra Rounds" value="0" editable="true">
          <number min="-1" max="2"/>

    Here is the only code that uses it:

      private boolean relationShipExistsLongEnnough(final Relationship r, final int relationshipsExistance) {
        int roundCurrentRelationshipWasCreated = r.getRoundCreated();
        roundCurrentRelationshipWasCreated += Properties.getRelationshipsLastExtraRounds(getData());
        return getData().getSequence().getRound() - roundCurrentRelationshipWasCreated >= relationshipsExistance;

    So it appears if that is set then its added to the "round a relationship was created" when checking conditions. I honestly have no idea what map uses that.

  • Moderators


    Typically relationships last 1 round and utilize endRound delegate to determine when that is. But the condition option (conditionAttachment option) for custom diplomacy is below.

    relationship     values: a relationship that needs to be present in the game: "player1:player2:relationship" (will set #rounds to -1 by default) OR "player1:player2:relationship:numberOfRoundsThisRelationshipMustExistForMinimum" for example: "Japan:China:War" or "Japan:China:War:-1" or "Japan:China:War:3".  It will accept "anyWar", "anyNeutral" and "anyAllied" as well.

    Some games use multi rounds relationships. They probably use the simple game property "relationship last extra rounds" to just add on versus creating new political actions using the condition ^^.

    Note the condition would likely be used to activate triggerAttachment option, such as below.

    relationshipChange	values: the change in relationship for these players, format: "player1:player2:oldRelation:newRelation" example: "Russians:Americans:coldWar:allOutWar" oldRelation may be "any", "anyWar", "anyNeutral", "anyAllied", or an actual relationshipType used in this xml. You can enter multiple relationshipChanges in the trigger and it will perform every change in the trigger which is valid.

  • @general_zod said in Relationships Last Extra Rounds:


    when set to -1 does that equal permanent?

    It says (will set #rounds to -1 by default)

  • Moderators


    Not sure, I always enter a value. @redrum would have to delve into code to give a definitive answer.

  • Admin

    @Mahks So relationship is part of a condition, so if its set to -1 then it means it'll essentially ignore duration unless "Relationships Last Extra Rounds" is set.

    Essentially this is what the condition checks:
    (currentRound - roundRelationshipWasCreated - "Relationships Last Extra Rounds") >= numberOfRoundsThisRelationshipMustExistForMinimum

    So if "Relationships Last Extra Rounds" isn't used then the -1 will make it so the duration check is always true.

Log in to reply