Modding qwestion about tolerance

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Andy_MB
Posts: 72
Joined: Fri, 24. Jul 15, 17:47
x4

Modding qwestion about tolerance

Post by Andy_MB » Mon, 26. Feb 18, 11:22

There is a problem: the PMC station has a relationship with the player +30. The color on the map is blue. Behaves aggressively towards the player!
Code from save.file:

Code: Select all

<connections>
            <connection connection="playerdockcon" macro="playerdockcon">
              <component class="dockingbay" macro="dockingbay_player_admin_macro" connection="connection02" seed="392942677" id="[0x7809013]">
                <listeners>
                  <listener listener="[0x6000c97]" event="killed"/>
                </listeners>
                <connections>
                  <connection connection="npcconnection">
                    <component class="npc" macro="character_ar_male_pilot_macro" connection="commandroomslot" name="Íèë Áðàêñ" owner="plutarch" knownto="player" page="10101" id="[0x8825d2f]">
                        ...
                      <skills>
                        ...
                      </skills>
                      <entity type="defencecontrol" control="1" customconversation="1"/>
                      <relations>
                        <booster faction="heartofalbion" relation="-1" time="1286524.652" delay="540" decayrate="0.02"/>
                      </relations>
                      <tolerance>
                        <booster faction="player" value="-0.75" time="876328.887" delay="5" decayrate="0.25"/>
                        <booster faction="heartofalbion" value="-1" time="1286521.54" delay="5" decayrate="0.25"/>
                        <booster faction="beryll" value="-0.25" time="387827.562" delay="5" decayrate="0.25"/>
                        <booster faction="nolimits" value="-0.025" time="34235.102" delay="5" decayrate="0.25"/>
                        <booster faction="xenon" value="-0.075" time="1217935.876" delay="5" decayrate="0.25"/>
                        <booster faction="sovereignsyndicate" value="-1" time="1219104.394" delay="5" decayrate="0.25"/>
                      </tolerance>
1. How to find stations that have a <connection> -> <tolerance> - <booster faction="player" ...

Code: Select all

   <find_station known="true" mayattack="player.primaryship" name="$stations_w_tolerance" multiple="true" space="player.cluster" tag="tolerance, boost, faction.player">
     ...              
    </find_station>

or find exact $NPC - defencecontrol  - at dockingbay macro="dockingbay_player_admin_macro" ?
Is tolerance a blackboard connected to this $NPC?

2. How to fix tolerance (temporary change of aggressive behavior towards the player)?

Code: Select all

set_relation_boost
reset_relation_boost
set_faction_relation

How to apply this?
Thanks for any tips!
_____________

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13097
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer » Mon, 26. Feb 18, 12:13

There isn't a find filter for the relation boosts, so I expect the easiest way to find those stations would be adding all potential stations into a list and comparing their relation to the player to the relation their faction usually has towards the player.

Code: Select all

  <find_station name="$Stations" space="player.galaxy" multiple="true"/>
  <do_all exact="$Stations.count" counter="$i">
    <set_value name="$Station" exact="$Stations.{$i}"/>
    <do_if value="$Station.relationto.{faction.player} lt $Station.owner.relationto.{faction.player}">
      <!--this station has a worse relation to the player than its faction does-->
    </do_if>
  </do_all>
And then, the reset_relation_boost action probably does what you want, setting it back to the faction relation.

Andy_MB
Posts: 72
Joined: Fri, 24. Jul 15, 17:47
x4

Post by Andy_MB » Mon, 26. Feb 18, 14:25

Thank you so much!
As far as I understand, there is no need to regulate the relationship between the player and the defense officer...
I already wrote the code and was going to check!

Code: Select all

            <find_station name="$stations_w_tolerance" multiple="true" space="player.galaxy"/>
              <do_all exact="$stations_w_tolerance.count" counter="$i">
                <find_dock_location container="$stations_w_tolerance.{$i}" name="$Admin_dock" multiple="true" dockpopulationtype="dockpopulationtype.administrative"/>
                <do_all exact="$Admin_dock.count" counter="$d">
                  <find_object_component name="$NPCs_D" multiple="true" class="class.npc" object="$Admin_dock.{$d}.component" comment="ищем среди офицеров обороны">
                    <match entitytype="entitytype.defencecontrol" controlentity="true" />
                    <match_relation faction="faction.player" comparison="ge" relation="neutral" comment="собираем всех, кто не агресивен к нам, чтобы удалить бустеры толерантности" />
                  </find_object_component>
                  <do_all exact="$NPCs_D.count" counter="$n">
                    <reset_tolerance_boost object="$NPCs_D.{$n}" faction="faction.player"/>
                  </do_all>
                </do_all>
              </do_all> 
_____________

Andy_MB
Posts: 72
Joined: Fri, 24. Jul 15, 17:47
x4

Post by Andy_MB » Mon, 26. Feb 18, 14:34

Xenon_Slayer wrote:There isn't a find filter for the relation boosts, so I expect the easiest way to find those stations would be adding all potential stations into a list and comparing their relation to the player to the relation their faction usually has towards the player.
Perhaps this will not work, since the relationship is not established with the player. As can be seen from save_file, object.relations are established only with "heartofalbion"! There no seted object.relations w/ player !

Code: Select all

<relations>
                        <booster faction="heartofalbion" relation="-1" time="1286524.652" delay="540" decayrate="0.02"/>
                      </relations>
                      <tolerance>
                        <booster faction="player" value="-0.75" time="876328.887" delay="5" decayrate="0.25"/>
                        <booster faction="heartofalbion" value="-1" time="1286521.54" delay="5" decayrate="0.25"/>
                        <booster faction="beryll" value="-0.25" time="387827.562" delay="5" decayrate="0.25"/>
                        <booster faction="nolimits" value="-0.025" time="34235.102" delay="5" decayrate="0.25"/>
                        <booster faction="xenon" value="-0.075" time="1217935.876" delay="5" decayrate="0.25"/>
                        <booster faction="sovereignsyndicate" value="-1" time="1219104.394" delay="5" decayrate="0.25"/>
                      </tolerance>
_____________

Andy_MB
Posts: 72
Joined: Fri, 24. Jul 15, 17:47
x4

Post by Andy_MB » Mon, 26. Feb 18, 14:44

perhaps

Code: Select all

<find_station name="$Stations" space="player.galaxy" multiple="true"/>
  <do_all exact="$Stations.count" counter="$i">
    <set_value name="$Station" exact="$Stations.{$i}"/>
    <do_if value="$Station.relationto.{faction.player} == $Station.owner.relationto.{faction.player}">
      <reset_tolerance_boost object="$Station" faction="faction.player"/>
    </do_if>
  </do_all>
_____________

Andy_MB
Posts: 72
Joined: Fri, 24. Jul 15, 17:47
x4

Post by Andy_MB » Mon, 26. Feb 18, 15:23

The script from the last message worked correctly
Result:

Code: Select all

<relations>
<booster faction="heartofalbion" relation="-1" time="1286524.652" delay="540" decayrate="0.02"/>
</relations>
<tolerance>
<booster faction="heartofalbion" value="-1" time="1286521.54" delay="5" decayrate="0.25"/>
<booster faction="beryll" value="-0.25" time="387827.562" delay="5" decayrate="0.25"/>
<booster faction="nolimits" value="-0.025" time="34235.102" delay="5" decayrate="0.25"/>
<booster faction="xenon" value="-0.075" time="1217935.876" delay="5" decayrate="0.25"/>
<booster faction="sovereignsyndicate" value="-1" time="1219104.394" delay="5" decayrate="0.25"/>
</tolerance>
but this station is still shooting me(skunk)! :(
I was in the zone. Departed and returned(OOZ). The effect is the same.
_____________

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 26. Feb 18, 16:23

what scripts/mods are you using? maybe something is messing ul the behavior... Also did you try to make the Station red an then waited until it cooled down? maybe the target list is messed up and didnt remove you when it should have...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Andy_MB
Posts: 72
Joined: Fri, 24. Jul 15, 17:47
x4

Post by Andy_MB » Mon, 26. Feb 18, 17:34

UniTrader wrote:what scripts/mods are you using? ...

version="430" start="ep1"
1."Vanfim's galaxy"
2. Home of Light
3. ego_dlc_teladi_outpost
4. id="ws_756867957" name="Mercenary"
5. id="Yat_impr_upated" name="YAT AI improved version V4.01 from 25.09.2016"

In the station, of course, an error (most likely in the quest for the "transfer" of this station from beryll to PMC in ep1)
_____________

Andy_MB
Posts: 72
Joined: Fri, 24. Jul 15, 17:47
x4

Post by Andy_MB » Mon, 26. Feb 18, 21:44

Вот это работает!
This code works (reset script defencenpc):

Code: Select all

            <find_station name="$Stations" space="player.galaxy" multiple="true"/>
            <do_all exact="$Stations.count" counter="$i">
              <set_value name="$Station" exact="$Stations.{$i}"/>
              <do_if value="$Station.relationto.{faction.player} == $Station.owner.relationto.{faction.player}">
                <reset_tolerance_boost object="$Station" faction="faction.player"/>
                <reset_relation_boost object="$Station" faction="faction.player"/>
                <set_value name="$actor" exact="$Station.defencenpc"/>
                <abort_scripts entity="$actor" />
                <start_script name="'fight.attack.object.station'" object="$actor" />
                <remove_value name="$actor"/>
              </do_if>
            </do_all>
Thanks to everyone!!!
_____________

Return to “X Rebirth - Scripts and Modding”