[bug] playerreputation.xml - promotion mission - relationship changes while in same range cancels the promotion mission

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

Post Reply
kuertee
EGOSOFT
EGOSOFT
Posts: 789
Joined: Sun, 14. Dec 03, 13:05
x4

[bug] playerreputation.xml - promotion mission - relationship changes while in same range cancels the promotion mission

Post by kuertee » Sat, 27. Nov 21, 15:38

I think the promotion mission shouldn't get canceled when relationship points change but stay in the same relationship range.
I think it should only get canceled if the relationship points change decrease it below the relationship range.

e.g. in this example, i had a mission to get the ceremonyfriend licence. and it was canceled when my relationship points increased en route to the faction rep:
a cue listener in a mod reported that my relationship points changed from 0.0209435 to 0.0221435, a change of 0.0012.
the PlayerReputation cue reported as shown below. i.e. "was friendly and is now friendly delta=0.0012"

Code: Select all

[Scripts] 20694.11 *** Context:md.PlayerReputation.Base<inst:294c493>: Player's relationship with Godrealm of the Paranid was friendly and is now friendly delta=0.0012
[Scripts] 20694.11 *** Context:md.PlayerReputation.Base<inst:294c493>: Player's relationship with Godrealm of the Paranid remains as-is.
[Scripts] 20694.11 *** Context:md.PlayerReputation.ReputationChanged<inst:29382e2>: Removing promotion mission for Godrealm of the Paranid from 4 to 4
i think the intention was that PlayerReputation.Base would issue a new instance of the promotion mission.
but that doesn't happen because CalculateFactionRelation will report no change in the relationship range.
in my example above, CalculateFactionRelation set $RelationNew to 4 and $RelationOld to 4.
and this test in PlayerReputation.Base prevents a new promotion mission from getting issued.

Code: Select all

<do_if value="$RelationNew != $RelationOld">
here's the relevant code that cancels the promotion mission.
the comments, which are egosoft's, show that this was intentional.

Code: Select all

<cue name="ReputationChanged" instantiate="true">
  <conditions>
    <event_player_relation_changed />
    <check_value value="event.param == $Faction"/>
  </conditions>
  <actions>
    <set_value name="$NewValue"           exact="event.param2.{1}" />
    <set_value name="$OldValue"           exact="event.param2.{2}" />
    <include_actions ref="CalculateFactionRelation" comment="Calculate faction-relation index from faction-relation value, returns $RelationNew and $RelationOld"/>
    <!-- If the new reputation goes down to or below $RelationOldParam (reputation we had when we started the mission) then cancel the mission (no need for promotion) -->
    <do_if value="$RelationNew le $RelationOldParam">
      <debug_text text="'Removing promotion mission for ' + $Faction + ' from ' + $RelationNewParam + ' to ' + $RelationNew" chance="$DebugChance"/>
      <set_value name="md.$FactionData.{$Faction}.$PromotionActive" exact="false" comment="this removed the rank-dialog option at the faction-representative"/>
      <remove_mission cue="PromotionMission" type="aborted" />
      <cancel_cue cue="PromotionMission"/>
    </do_if>
    <!-- If the current reputation is different to what we are promoted to when we started the mission, we need to update briefing-texts (and remember the new value) -->
    <do_if value="$RelationNew != $RelationNewParam">
      <debug_text text="'Updating RelationNewParam' + $Faction + ' from ' + $RelationNewParam + ' to ' + $RelationNew" chance="$DebugChance"/>
      <set_value name="$RelationNewParam" exact="$RelationNew" />
    </do_if>
  </actions>
</cue>
I think the fix is to replace:

Code: Select all

<do_if value="$RelationNew le $RelationOldParam">
with:

Code: Select all

<do_if value="$RelationNew lt $RelationOldParam">
Mods: RPG: Reputations and Professions, Social Standings and Citizenships, Crime has Consequences, Alternatives to Death. Missions/NPCs: Emergent Missions, NPC Reactions, Mod Parts Trader, High-sec Rooms are Locked, Hacking Outcomes, More Generic Missions, Waypoint Fields for Deployment. Others: Auto-cam, Friendly Fire Tweaks, Teleport From Transporter Room, Wear and Tear. QoL: Trade Analytics, Loot Mining, Ship Scanner, Signal Leak Hunter, Station Scanner, Surface Element Targeting, etc.

Post Reply

Return to “X4: Foundations - Technical Support”