Question regarding 'cockpit reconfigure' files and mechanic menu.

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

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

Post Reply
dertien
Posts: 274
Joined: Tue, 22. Feb 05, 13:27
x2

Question regarding 'cockpit reconfigure' files and mechanic menu.

Post by dertien » Thu, 3. Aug 17, 20:29

Ok so basically I am trying to get the original cockpit to show up again in the purchaseable list of 'cockpit upgrades' when talking to an NPC Mechanic; the Reconfigure Cockpit option.

It has been omitted from X-Rebirth VR for performance reasons.

Anyway; changing the MD\setup.xml file changing this:

Code: Select all

...
<set_value name="md.$CockpitUpgradetraderLists" exact="
            [
                [
			[ware.spe_cockpit_fight, 1, 1, 100],
                    [ware.spe_cockpit_build, 1, 1, 100],
                    [ware.spe_cockpit_trade, 1, 1, 100]
                ]
            ]
        "/>
...
to this...

Code: Select all

<set_value name="md.$CockpitUpgradetraderLists" exact="
            [
                [
                    [ware.spe_cockpit_default, 1, 1, 100],
					[ware.spe_cockpit_fight, 1, 1, 100],
                    [ware.spe_cockpit_build, 1, 1, 100],
                    [ware.spe_cockpit_trade, 1, 1, 100]
                ]
            ]
        "/>
...in the two entries present in the file; it did not seem to add the option in the ingame menu; and only the three other cockpits can be chosen as a reconfigure option.

I checked the game's libraries\wares.xml file and the cockpit entry was not omitted there. Can someone tell my what I might be missing here?

Are there other files that relate to this option that have to be amended as well?

Thanks.

dertien
Posts: 274
Joined: Tue, 22. Feb 05, 13:27
x2

Post by dertien » Wed, 9. Aug 17, 23:36

There is definitely something broken there AFAIK.

The code is correct and the file works to make the cockpit show up on the Mechanic's list again if I repack the file with the changes from OP and drop the cat/dat combination as a 10.dat and 10.cat file in the root folder of XRVR (alongside 01.cat - 09.cat).

Renaming it and dropping it into its own folder, for example XRVR/Extensions/Recall_CockpitMk1,- named ext_01.cat and dat and it stops working completely; the purchase list again just shows the 3 cockpits with the one left out by ego omitted from the list as if the mod is not even there:

The content.xml file should make it load after all 3 ego dlc's but that is just not the case.

Does anyone have a faint idea what could be causing this?

Here is the working code packed into a cat/dat file and saved as 10.cat/10.dat and dropped into the root folder.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<mdscript name="Setup" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>

    <cue name="Debugging">
      <actions>
        <!--Activate RML debugging-->
        <set_value name="md.$RML_Debugging" exact="1"/>
      </actions>
    </cue>

    <!--NOTE: This is currently for any module which is not ep1-->
    <cue name="Debug_Jumpgates" onfail="cancel">
      <conditions>
        <check_value value="false" comment="disable"/>
        <check_value value="player.module" exact="'ep1'" negate="true"/>
        <check_value value="player.module" exact="'ep1open'" negate="true"/>
      </conditions>
      <actions>
        <!--Activate jumpgates for testing-->
        <find_object groupname="$Gates" class="class.gate" multiple="true" space="player.galaxy"/>
        <do_all exact="$Gates.count" counter="$Counter">
          <set_value name="$Gate" exact="$Gates.{$Counter}"/>
          <do_if value="not $Gate.isactive and $Gate.exit.exists">
            <debug_text text="'DEBUG: Activating Jumpgate between ' + $Gate.cluster.knownname + ' and ' + $Gate.exit.cluster.knownname" filter="general"/>
            <set_object_active object="$Gate" activate="true"/>
          </do_if>
        </do_all>
      </actions>
    </cue>

    <cue name="GameLoaded" instantiate="true">
      <conditions>
        <event_game_loaded />
      </conditions>
      <actions>
        <set_value name="stat.savegames_loaded" operation="add" />
      </actions>
    </cue>

    <cue name="Start" version="18">
      <actions>
        <set_value name="$RandomOfferLocations" exact="true"/>
        <!-- $list.{md.$RandomIdx} will be either $list.{1} or $list.random, depending on $RandomOfferLocations -->
        <set_value name="md.$RandomIdx" exact="1"/>
        <do_if value="$RandomOfferLocations">
          <set_value name="md.$RandomIdx" exact="'random'"/>
        </do_if>
        <set_value name="md.$MaxMissionOfferDistance" exact="60km"/>
        <set_value name="md.$InteractiveMissionOfferTimeout" exact="10s"/>
        <!-- Notification probabilities -->
        <set_value name="md.$yisha_often"     exact="50" />
        <set_value name="md.$yisha_sometimes" exact="25" />
        <set_value name="md.$yisha_rarely"    exact="5" />
        <!-- Init player money stat -->
        <set_value name="stat.money_player" exact="player.money / 1Cr" />

        <create_list name="md.$TradeMissionStations"/>

        <!-- Trader definitions -->
        <!-- Warelist Entry: [ware, min, max, chance]
             ware = ware id,
             min, max = minimum and maximum amount in stock,
             chance = chance that there will be stock, indepent of min and max -->
        <set_value name="md.$EngineUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_engine_bal_mk1, 1, 1, 100],
                    [ware.upg_pla_engine_spe_mk2, 1, 1, 80],
                    [ware.upg_pla_engine_man_mk2, 1, 1, 80],
                    [ware.upg_pla_engine_spe_mk3, 1, 1, 60],
                    [ware.upg_pla_engine_bal_mk3, 1, 1, 60],
                    [ware.upg_pla_engine_man_mk3, 1, 1, 60],
                    [ware.upg_pla_engine_spe_mk4, 1, 1, 40],
                    [ware.upg_pla_engine_bal_mk4, 1, 1, 40],
                    [ware.upg_pla_engine_man_mk4, 1, 1, 40],
                    [ware.upg_pla_engine_spe_mk5, 0, 0, 0],
                    [ware.upg_pla_engine_bal_mk5, 0, 0, 0],
                    [ware.upg_pla_engine_man_mk5, 0, 0, 0]
                ]
            ]
        "/>
        <set_value name="md.$ShieldUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_shield_bal_mk1, 2, 2, 100],
                    [ware.upg_pla_shield_cap_mk2, 2, 2, 80],
                    [ware.upg_pla_shield_rec_mk2, 2, 2, 80],
                    [ware.upg_pla_shield_cap_mk3, 2, 2, 60],
                    [ware.upg_pla_shield_bal_mk3, 2, 2, 60],
                    [ware.upg_pla_shield_rec_mk3, 2, 2, 60],
                    [ware.upg_pla_shield_cap_mk4, 2, 2, 40],
                    [ware.upg_pla_shield_bal_mk4, 2, 2, 40],
                    [ware.upg_pla_shield_rec_mk4, 2, 2, 40],
                    [ware.upg_pla_shield_cap_mk5, 0, 0, 0],
                    [ware.upg_pla_shield_bal_mk5, 0, 0, 0],
                    [ware.upg_pla_shield_rec_mk5, 0, 0, 0]
                ]
            ]
        "/>
        <set_value name="md.$WeaponUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_weapon_ie_mk1, 1, 1, 100],
                    [ware.upg_pla_weapon_ie_mk2, 0, 0, 0],
                    [ware.upg_pla_weapon_pe_mk1, 0, 0, 0],
                    [ware.upg_pla_weapon_pe_mk2, 0, 0, 0],
                    [ware.upg_pla_weapon_sg_mk1, 1, 1, 100],
                    [ware.upg_pla_weapon_sg_mk2, 0, 0, 0],
                    [ware.upg_pla_weapon_mg_mk1, 1, 1, 100],
                    [ware.upg_pla_weapon_mg_mk2, 0, 0, 0],
                    [ware.upg_pla_weapon_mg_mk3, 0, 0, 0],
                    [ware.upg_pla_weapon_ml_mk1, 1, 1, 100],
                    [ware.upg_pla_weapon_ml_mk2, 0, 0, 0],
                    [ware.upg_pla_weapon_ml_mk3, 0, 0, 0],
                    [ware.upg_pla_weapon_hept, 0, 0, 0],
                    [ware.upg_pla_weapon_pe_charging_mk1, 0, 0, 0],
                    [ware.upg_pla_weapon_railgun_mk1, 0, 0, 0]
                ]
            ]
        "/>
        <set_value name="md.$ScannerUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_scanner_mk1, 1, 1, 100],
                    [ware.upg_pla_scanner_mk2, 1, 1, 100],
                    [ware.upg_pla_scanner_mk3, 1, 1, 100]
                ]
            ]
        "/>
        <set_value name="md.$SoftwareUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_software_tc_mk1, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk2, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk3, 1, 1, 100],
                    [ware.upg_pla_software_trc_mk1, 1, 1, 100],
                    [ware.upg_pla_software_trc_mk2, 1, 1, 100],
                    [ware.upg_pla_software_ec_mk1, 1, 1, 100]
                ]
            ]
        "/>
        <set_value name="md.$CockpitUpgradetraderLists" exact="
            [
                [
                    [ware.spe_cockpit_default, 1, 1, 100],
					[ware.spe_cockpit_fight, 1, 1, 100],
                    [ware.spe_cockpit_build, 1, 1, 100],
                    [ware.spe_cockpit_trade, 1, 1, 100]
                ]
            ]
        "/>
        <set_value name="md.$ArchitectDroneList" exact="
            [
                [ware.drp_cargolifter],
                [ware.drp_interceptor_mk1],
                [ware.drp_interceptor_mk2],
                [ware.drp_intrepid_mk1],
                [ware.drp_intrepid_mk2],
                [ware.drp_overrun_mk1],
                [ware.drp_overrun_mk2]
            ]
        "/>
        <set_value name="md.$ArchitectDroneList2" exact="
            [
                [ware.drp_construction]
            ]
        "/>
        <!-- DO NOT add transport or mining drones here, will be added by the script if appropriate -->
        <set_value name="md.$ShiptraderDroneList" exact="
            [
                [ware.drp_assault],
                [ware.drp_construction],
                [ware.drp_interceptor_mk1],
                [ware.drp_interceptor_mk2],
                [ware.drp_intrepid_mk1],
                [ware.drp_intrepid_mk2],
                [ware.drp_overrun_mk1],
                [ware.drp_overrun_mk2]
            ]
        "/>

        <!-- Hire Fee Entry: [entitytype, minfee, maxfee] -->
        <set_value name="md.$HireFees" exact="
            [
                [entitytype.pilot, 11000, 33000],
                [entitytype.commander, 27000, 81000],
                [entitytype.manager, 48000, 144000],
                [entitytype.marine, 19000, 57000],
                [entitytype.engineer, 13000, 39000],
                [entitytype.architect, 36000, 108000],
                [entitytype.defencecontrol, 58000, 174000],
                [entitytype.specialistagriculture, 122000, 366000],
                [entitytype.specialistpowerstorage, 168000, 504000],
                [entitytype.specialistfood, 157000, 471000],
                [entitytype.specialistchemical, 185000, 555000],
                [entitytype.specialistprecision, 195000, 585000],
                [entitytype.specialistweapons, 220000, 660000],
                [entitytype.specialistpharmaceuticals, 147000, 441000],
                [entitytype.specialistmetals, 145000, 435000],
                [entitytype.specialistgeophysics, 128000, 384000],
                [entitytype.specialistsurfacesystems, 232000, 696000],
                [entitytype.specialistpowersupply, 210000, 630000],
                [entitytype.specialistaquatics, 115000, 345000]
            ]
        "/>

        <find_cluster name="md.$Maelstrom" macro="macro.cluster_a_macro"/>
        <find_cluster name="md.$Albion" macro="macro.cluster_b_macro"/>
        <find_cluster name="md.$Omicron_Lyrae" macro="macro.cluster_c_macro"/>
        <find_cluster name="md.$DeVries" macro="macro.cluster_d_macro"/>
      </actions>
      <patch sinceversion="2" state="complete">
        <set_value name="md.$CockpitUpgradetraderLists" exact="
            [
                [
                    [ware.spe_cockpit_default, 1, 1, 100],
					[ware.spe_cockpit_fight, 1, 1, 100],
                    [ware.spe_cockpit_build, 1, 1, 100],
                    [ware.spe_cockpit_trade, 1, 1, 100]
                ]
            ]
        "/>
      </patch>
      <patch sinceversion="4" state="complete">
        <set_value name="md.$SoftwareUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_software_tc_mk1, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk2, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk3, 1, 1, 100]
                ]
            ]
        "/>
      </patch>
      <patch sinceversion="5" state="complete">
        <set_value name="md.$ShiptraderDroneList" exact="
            [
                [ware.drp_assault],
                [ware.drp_construction],
                [ware.drp_interceptor_mk1],
                [ware.drp_interceptor_mk2],
                [ware.drp_intrepid_mk1],
                [ware.drp_intrepid_mk2],
                [ware.drp_overrun_mk1],
                [ware.drp_overrun_mk2]
            ]
        "/>
      </patch>
      <patch sinceversion="6" state="complete">
        <append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_ml_mk3, 0, 0, 0]"/>
        <append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hept, 0, 0, 0]"/>
        <debug_text text="'Patching new weapons to weapon traders.'" filter="scripts"/>
      </patch>
      <patch sinceversion="7" state="complete">
        <set_value name="md.$SoftwareUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_software_tc_mk1, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk2, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk3, 1, 1, 100],
                    [ware.upg_pla_software_trc_mk1, 1, 1, 100],
                    [ware.upg_pla_software_trc_mk2, 1, 1, 100]
                ]
            ]
        "/>
      </patch>
      <patch sinceversion="10" state="complete">
        <do_all exact="md.$WeaponUpgradetraderLists.{1}.count" counter="$i">
          <do_if value="md.$WeaponUpgradetraderLists.{1}.{$i}.{1}" exact="ware.upg_pla_weapon_mg_mk2">
            <set_value name="md.$WeaponUpgradetraderLists.{1}.{$i + 1}" exact="[ware.upg_pla_weapon_mg_mk3, 0, 0, 0]" operation="insert"/>
            <break/>
          </do_if>
        </do_all>
      </patch>
      <patch sinceversion="13" state="complete">
        <set_value name="md.$SoftwareUpgradetraderLists" exact="
            [
                [
                    [ware.upg_pla_software_tc_mk1, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk2, 1, 1, 100],
                    [ware.upg_pla_software_tc_mk3, 1, 1, 100],
                    [ware.upg_pla_software_trc_mk1, 1, 1, 100],
                    [ware.upg_pla_software_trc_mk2, 1, 1, 100],
                    [ware.upg_pla_software_ec_mk1, 1, 1, 100]
                ]
            ]
        "/>
      </patch>
      <patch sinceversion="15" state="complete">
        <append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_pe_charging_mk1, 0, 0, 0]"/>
        <append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_railgun_mk1, 0, 0, 0]"/>
        <debug_text text="'Patching new weapons to weapon traders.'" filter="scripts"/>
      </patch>
      <patch sinceversion="18" state="complete">
        <do_if value="not md.$WeaponUpgradetraderLists.{1}.indexof.{[ware.upg_pla_weapon_pe_charging_mk1, 0, 0, 0]}">
          <debug_text text="'adding missing weapon entry for ' + ware.upg_pla_weapon_pe_charging_mk1"/>
          <append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_pe_charging_mk1, 0, 0, 0]"/>
        </do_if>
        <do_if value="not md.$WeaponUpgradetraderLists.{1}.indexof.{[ware.upg_pla_weapon_railgun_mk1, 0, 0, 0]}">
          <debug_text text="'adding missing weapon entry for ' + ware.upg_pla_weapon_railgun_mk1"/>
          <append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_railgun_mk1, 0, 0, 0]"/>
        </do_if>
      </patch>
      <cues>
        <!-- Send a signal to interested cues at game start: Only if this is a new game, not when resetting the MD -->
        <!-- Use the following condition: -->
        <!-- <event_cue_signalled cue="md.Setup.GameStart" /> -->
        <cue name="GameStart" onfail="cancel">
          <conditions>
            <check_age max="20s" />
          </conditions>
          <!-- Short delay so that the other root cues already exist when this cue completes -->
          <delay exact="1s" />
          <actions>
            <signal_cue cue="this" />
          </actions>
        </cue>
      </cues>
    </cue>

    <cue name="WeaponTraderBasket2">
      <conditions>
        <event_cue_signalled/>
      </conditions>
      <actions>
        <debug_text text="'WeaponTraderBasket2 signalled'"/>
        <set_value name="md.$WeaponUpgradetraderLists" exact="
              [
                  [
                      [ware.upg_pla_weapon_ie_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_ie_mk2, 0, 0, 0],
                      [ware.upg_pla_weapon_pe_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_pe_mk2, 0, 0, 0],
                      [ware.upg_pla_weapon_sg_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_sg_mk2, 0, 0, 0],
                      [ware.upg_pla_weapon_mg_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_mg_mk2, 0, 0, 0],
                      [ware.upg_pla_weapon_mg_mk3, 0, 0, 0],
                      [ware.upg_pla_weapon_ml_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_ml_mk2, 0, 0, 0],
                      [ware.upg_pla_weapon_ml_mk3, 0, 0, 0],
                      [ware.upg_pla_weapon_hept, 0, 0, 0],
                      [ware.upg_pla_weapon_pe_charging_mk1, 0, 0, 0],
                      [ware.upg_pla_weapon_railgun_mk1, 0, 0, 0]
                  ]
              ]
            "/>
      </actions>
    </cue>

    <cue name="WeaponTraderBasket3">
      <conditions>
        <event_cue_signalled/>
      </conditions>
      <actions>
        <debug_text text="'WeaponTraderBasket3 signalled'"/>
        <set_value name="md.$WeaponUpgradetraderLists" exact="
              [
                  [
                      [ware.upg_pla_weapon_ie_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_ie_mk2, 1, 1, 100],
                      [ware.upg_pla_weapon_pe_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_pe_mk2, 1, 1, 100],
                      [ware.upg_pla_weapon_sg_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_sg_mk2, 1, 1, 100],
                      [ware.upg_pla_weapon_mg_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_mg_mk2, 1, 1, 100],
                      [ware.upg_pla_weapon_mg_mk3, 0, 0, 0],
                      [ware.upg_pla_weapon_ml_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_ml_mk2, 1, 1, 100],
                      [ware.upg_pla_weapon_ml_mk3, 0, 0, 0],
                      [ware.upg_pla_weapon_hept, 0, 0, 0],
                      [ware.upg_pla_weapon_pe_charging_mk1, 0, 0, 0],
                      [ware.upg_pla_weapon_railgun_mk1, 0, 0, 0]
                  ]
              ]
            "/>
      </actions>
    </cue>

    <cue name="EquipmentTraderBasket2" version="3">
      <conditions>
        <event_cue_signalled/>
      </conditions>
      <actions>
        <debug_text text="'EquipmentTraderBasket2 signalled'"/>
        <set_value name="player.entity.$UseEquipmentLists2" exact="true" />
      </actions>
      <patch sinceversion="2" state="complete">
        <do_if value="player.debug">
          <do_if value="player.entity.inventory.{ware.inv_timewarp}.count gt 1">
            <!--Debug - Remove down to 1-->
            <remove_inventory entity="player.entity" ware="ware.inv_timewarp" exact="player.entity.inventory.{ware.inv_timewarp}.count - 1"/>
          </do_if>
        </do_if>
        <do_else>
          <!--Remove all-->
          <debug_text text="'Removing SETA from player inventory'" filter="savegame"/>
          <remove_inventory entity="player.entity" ware="ware.inv_timewarp" exact="player.entity.inventory.{ware.inv_timewarp}.count"/>
        </do_else>
      </patch>
      <patch sinceversion="3" state="complete">
        <set_value name="player.entity.$UseEquipmentLists2" exact="true" />
      </patch>
    </cue>

    <cue name="PostChapter3Jobs" version="5">
      <conditions>
        <event_cue_signalled/>
      </conditions>
      <actions>
        <debug_text text="'PostChapter3Jobs signalled'"/>

        <!--Chapter 1 Jobs-->
        <set_job_active job="'sos_fighter_patrol_cluster'" activate="true"/>
        <set_job_active job="'sos_fighter_heavy_raid_leader'" activate="true"/>
        <set_job_active job="'sov_xl_destroyer_hq'" activate="true"/>

        <!--Chapter 2 Jobs-->
        <set_job_active job="'can_chapter2_light_patrol_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_light_frigate_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_light_destroyer_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_light_trader_energy_medium_sector18'" activate="false"/>
        <set_job_active job="'can_chapter2_light_trader_water_medium_sector18'" activate="false"/>
        <set_job_active job="'can_chapter2_medium_trader_agricultural_medium_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_medium_trader_energy_medium_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_medium_trader_water_medium_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_medium_trader_energy_large_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_medium_trader_water_large_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_medium_trader_agricultural_large_sector18'" activate="true"/>
        <set_job_active job="'can_chapter2_medium_trader_food_large_sector18'" activate="true"/>

        <set_job_active job="'hoa_chapter2_light_patrol_sector18'" activate="false"/>
        <set_job_active job="'hoa_chapter2_light_frigate_sector18'" activate="false"/>
        <set_job_active job="'hoa_chapter2_light_carrier_sector18'" activate="false"/>
        <set_job_active job="'hoa_chapter2_medium_patrol_sector18'" activate="true"/>
        <set_job_active job="'hoa_chapter2_medium_frigate_sector18'" activate="true"/>
        <set_job_active job="'hoa_chapter2_medium_carrier_sector18'" activate="true"/>

        <set_job_active job="'pmc_chapter2_medium_patrol_sector17'" activate="false"/>
        <set_job_active job="'pmc_chapter2_medium_carrier_sector17'" activate="true"/>
        <set_job_active job="'pmc_chapter2_medium_destroyer_sector17'" activate="false"/>
        <set_job_active job="'pmc_chapter2_heavy_patrol_sector17'" activate="false"/>
        <set_job_active job="'pmc_chapter2_heavy_carrier_sector17'" activate="false"/>
        <set_job_active job="'pmc_chapter2_heavy_destroyer_sector17'" activate="false"/>

        <set_job_active job="'rei_chapter2_light_patrol_sector17'" activate="true"/>
        <set_job_active job="'rei_chapter2_light_patrol_sector18'" activate="false"/>
        <set_job_active job="'rei_chapter2_light_patrol_sector19'" activate="false"/>
        <set_job_active job="'rei_chapter2_light_patrol_sector20'" activate="true"/>
        <set_job_active job="'rei_chapter2_medium_patrol_sector19'" activate="true"/>

        <set_job_active job="'led_special_construction_trader'" activate="true"/>
        <set_job_active job="'masstraffic_devries_cluster_civilian'" activate="true"/>

        <!--Chapter 3 Jobs-->
        <set_job_active job="'jss_special_construction_trader'" activate="true"/>

        <set_job_active job="'rya_fighter_patrol_cluster'" activate="true"/>
        <set_job_active job="'rya_fighter_patrol_sector02'" activate="true"/>
        <set_job_active job="'rya_destroyer_sector02'" activate="true"/>
        <set_job_active job="'rya_destroyer_sector02_hq'" activate="true"/>
        
        <!--Post Chapter 3 Jobs-->
        
        <!--Disabled as Xenon Albion jobs will be handled by the Xenon incursion missions-->
        <!--<set_job_active job="'xen_destroyer_albion'" activate="true"/>
        <set_job_active job="'xen_fighter_patrol_albion'" activate="true"/>
        <set_job_active job="'xen_destroyer_albion_diff_01'" activate="true"/>
        <set_job_active job="'xen_destroyer_albion_diff_02'" activate="true"/>
        <set_job_active job="'xen_fighter_patrol_albion_diff_01'" activate="true"/>
        <set_job_active job="'xen_fighter_patrol_albion_diff_02'" activate="true"/>-->

        <set_job_active job="'masstraffic_albion_sector04_police_pmc'" activate="false"/>
        <set_job_active job="'masstraffic_albion_sector05_police_pmc'" activate="false"/>
        <set_job_active job="'masstraffic_albion_sector06_police_pmc'" activate="false"/>
        <set_job_active job="'masstraffic_albion_sector07_police_pmc'" activate="false"/>

        <set_job_active job="'masstraffic_albion_sector04_police_hoa'" activate="true"/>
        <set_job_active job="'masstraffic_albion_sector05_police_hoa'" activate="true"/>
        <set_job_active job="'masstraffic_albion_sector06_police_hoa'" activate="true"/>
        <set_job_active job="'masstraffic_albion_sector07_police_hoa'" activate="true"/>

        <set_job_active job="'pmc_fighter_patrol_cluster'" activate="false"/>
        <set_job_active job="'pmc_carrier_cluster'" activate="false"/>
      </actions>
      <patch sinceversion="2" state="complete">
        <debug_text text="'activating sos_fighter_heavy_raid_leader'"/>
        <set_job_active job="'sos_fighter_heavy_raid_leader'" activate="true"/>
      </patch>
      <!--<patch sinceversion="3" state="complete">
        <debug_text text="'activating sos_fighter_heavy_raid_leader_reduced'"/>
        <set_job_active job="'sos_fighter_heavy_raid_leader_reduced'" activate="true"/>
      </patch>-->
      <patch sinceversion="4" state="complete">
        <debug_text text="'activating sov_xl_destroyer_hq and rya_destroyer_sector02_hq'"/>
        <set_job_active job="'sov_xl_destroyer_hq'" activate="true"/>
        <set_job_active job="'rya_destroyer_sector02_hq'" activate="true"/>
      </patch>
    </cue>

    <library name="RemovePlayerWeapons">
      <actions>
        <!-- Remove lasers -->
        <remove_weapon object="player.primaryship" macro="macro.weapon_player_impulse_mk1_macro" slot="tag.primary_slot"/>
        <remove_weapon object="player.primaryship" macro="macro.weapon_player_plasma_mk1_macro" slot="tag.primary_slot"/>
        <remove_weapon object="player.primaryship" macro="macro.weapon_player_shotgun_mk1_macro" slot="tag.primary_slot"/>
        <remove_weapon object="player.primaryship" macro="macro.weapon_player_machinegun_mk1_macro" slot="tag.primary_slot"/>
        <remove_weapon object="player.primaryship" macro="macro.weapon_player_mining_mk1_macro" slot="tag.primary_slot"/>
        <!-- Remove all ammo -->
        <deplete_ammo object="player.primaryship" />
      </actions>
    </library>

    <cue name="Open_Jumpgates_Lib">
      <conditions>
        <event_cue_signalled/>
      </conditions>
      <actions>
        <find_cluster name="$Maelstrom" macro="macro.cluster_a_macro"/>
        <find_cluster name="$Albion" macro="macro.cluster_b_macro"/>
        <find_cluster name="$Omicron_Lyrae" macro="macro.cluster_c_macro"/>
        <find_cluster name="$DeVries" macro="macro.cluster_d_macro"/>

        <find_object groupname="$Gates" class="class.gate" space="$Albion" destination="$DeVries"/>
        <find_object groupname="$Gates" class="class.gate" space="$DeVries" destination="$Omicron_Lyrae"/>
        <find_object groupname="$Gates" class="class.gate" space="$Maelstrom" destination="$Omicron_Lyrae"/>

        <do_all exact="$Gates.count" counter="$Counter">
          <set_value name="$Gate" exact="$Gates.{$Counter}"/>
          <do_if value="not $Gate.isactive and $Gate.exit.exists">
            <debug_text text="player.module + ': Activating Jumpgate between ' + $Gate.cluster.knownname + ' and ' + $Gate.exit.cluster.knownname"/>
            <set_object_active object="$Gate" activate="true"/>
          </do_if>
        </do_all>
        <remove_value name="$Maelstrom"/>
        <remove_value name="$Albion"/>
        <remove_value name="$Omicron_Lyrae"/>
        <remove_value name="$DeVries"/>
        <remove_value name="$Gates"/>
      </actions>
    </cue>

    <cue name="V1_14__Patch_Player_Engineer">
      <actions>
        <find_object name="$PlayerProperty" owner="faction.player" class="[class.ship_l, class.ship_xl, class.station]" space="player.galaxy" multiple="true"/>
        <do_all exact="$PlayerProperty.count" counter="$Counter">
          <do_if value="$PlayerProperty.{$Counter}.engineer">
            <debug_text text="'Starting engineer.ai on entity ' + $PlayerProperty.{$Counter}.engineer + ' ' + $PlayerProperty.{$Counter}.engineer.knownname + ' on ' + $PlayerProperty.{$Counter}.knownname + ' in ' + $PlayerProperty.{$Counter}.zone.knownname"/>
            <start_script object="$PlayerProperty.{$Counter}.engineer" name="'engineer.ai'"/>
          </do_if>
        </do_all>
      </actions>
    </cue>

    <!--Start new trade.ship.ranged on job ships which were previously running trade.ship-->
    <!--param2 == Entity-->
    <cue name="V1_25__Patch_Ranged_Trade_Ships" instantiate="true">
      <conditions>
        <event_object_signalled object="player.galaxy" param="'V1_25__Patch_Ranged_Trade_Ships'"/>
      </conditions>
      <delay exact="1s"/>
      <actions>
        <debug_text text="'Starting script (trade.ship.ranged) on entity ' + event.param2 + ' ' + event.param2.knownname + ' [' + event.param2.ship.knownname + ']'"/>
        <start_script object="event.param2" name="'trade.ship.ranged'">
          <param name="minbuy" value="0"/>
          <param name="maxbuy" value="0"/>
          <param name="minsell" value="1"/>
          <param name="maxsell" value="1"/>
        </start_script>
      </actions>
    </cue>

    <!-- cleanup ships stuck with shiptrader_docking, but the shiptrader forgot about them -->
    <cue name="V4_10__Patch_Shiptrader_Docking">
      <delay exact="1min" />
      <actions>
        <!-- find all player ships engaged in shiptrader docking -->
        <create_group groupname="md.$V4_10__Patch_ShiptraderDockingShips" />
        <find_ship name="$playerships" class="class.ship" multiple="true" space="player.galaxy" trueowner="faction.player" recursive="true" />
        <do_all exact="$playerships.count" counter="$i">
          <do_if value="@$playerships.{$i}.pilot.$shiptrader_docking">
            <add_to_group groupname="md.$V4_10__Patch_ShiptraderDockingShips" object="$playerships.{$i}" />
          </do_if>
        </do_all>
        
        <!-- find all shiptraders -->
        <create_group groupname="md.$V4_10__Patch_Shiptraders" />
        <find_station name="$shipyards" space="player.galaxy" multiple="true">
          <match_content class="class.buildmodule" />
        </find_station>
        <do_all exact="$shipyards.count" counter="$i">
          <find_object_component groupname="md.$V4_10__Patch_Shiptraders" object="$shipyards.{$i}" entitytype="entitytype.shiptrader" multiple="true" />
        </do_all>
        <find_station name="$shipyards" space="player.galaxy" multiple="true" productsize="ship" />
        <do_all exact="$shipyards.count" counter="$i">
          <find_object_component groupname="md.$V4_10__Patch_Shiptraders" object="$shipyards.{$i}" entitytype="entitytype.smallshiptrader" multiple="true" />
        </do_all>
        
        <!-- signal shiptraders to check ships in the list -->
        <signal_objects group="md.$V4_10__Patch_Shiptraders" param="'V4_10__Patch_Shiptrader_Docking'" />

        <!-- handle remaining ships -->
        <do_all exact="md.$V4_10__Patch_ShiptraderDockingShips.count" counter="$i">
          <debug_text text="'Found ship ' + md.$V4_10__Patch_ShiptraderDockingShips.{$i}.knownname + ' (' + md.$V4_10__Patch_ShiptraderDockingShips.{$i} + ') that is docking for a shiptrader but no responsible shiptrader was found. Recovering ship now.'" />
          <do_if value="md.$V4_10__Patch_ShiptraderDockingShips.{$i}.docklink">
            <signal_cue_instantly cue="md.Setup.V4_10__Patch_Shiptrader_Docking_Cleanup" param="[md.$V4_10__Patch_ShiptraderDockingShips.{$i}, md.$V4_10__Patch_ShiptraderDockingShips.{$i}.pilot.$shiptrader_docking.component.station]" />
          </do_if>
          <do_else>
            <remove_value name="md.$V4_10__Patch_ShiptraderDockingShips.{$i}.pilot.$shiptrader_docking" />
            <start_script object="md.$V4_10__Patch_ShiptraderDockingShips.{$i}.pilot" name="'player.default'"/>
            <do_if value="md.$V4_10__Patch_ShiptraderDockingShips.{$i}.buildingmodule">
              <clear_buildmodule buildmodule="md.$V4_10__Patch_ShiptraderDockingShips.{$i}.buildingmodule" />
            </do_if>
          </do_else>
        </do_all>

        <remove_value name="$playerships" />
        <remove_value name="$shipyards" />
        <remove_value name="md.$V4_10__Patch_ShiptraderDockingShips"/>
        <remove_value name="md.$V4_10__Patch_Shiptraders"/>
      </actions>
    </cue>

    <cue name="V4_10__Patch_Shiptrader_Docking_Cleanup" instantiate="true">
      <conditions>
        <event_cue_signalled />
      </conditions>
      <actions>
        <set_value name="$param" exact="event.param" />
      </actions>
      <cues>
        <cue name="DockingShip_Docked">
          <conditions>
            <event_object_docked object="$param.{1}" dock="$param.{2}" />
          </conditions>
          <delay exact="1s" />
          <actions>
            <remove_value name="$param.{1}.pilot.$shiptrader_docking" />
            <start_script object="$param.{1}.pilot" name="'player.default'"/>
            <do_if value="$param.{1}.buildingmodule">
              <clear_buildmodule buildmodule="$param.{1}.buildingmodule" />
            </do_if>
            <remove_value name="$param" />
          </actions>
        </cue>
      </cues>
    </cue>

  </cues>
</mdscript>

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

Post by UniTrader » Thu, 10. Aug 17, 00:32

your MD file is not a patch to the existing one. it should be merged into the md file, which may confuse the heck out of the game because of the many double cues.. if you put this file into a subst_01.cat/dat instead of the ext_01 it should work because that one is used for replacing core files (any file in fact ;) ) but i discourage this method if no better Options (like Patching are available..
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 ;)

dertien
Posts: 274
Joined: Tue, 22. Feb 05, 13:27
x2

Post by dertien » Thu, 10. Aug 17, 00:49

Hey Unitrader,

Thanks for the quick reply.

Thanks for pointing that out, and I did read that in the manual as well, and have already tried it. Still no dice however.

I did not pack this using a double extension folder, the file itself is simply residing in the md folder.

like so


md/Setup.xml


Packing this using the GUI and naming it as you say... subst_01.cat and putting this in the Extensions/Recall_CockpitMk01 will not produce the results expected.

Will try this again, now but have been fiddling with this file since 5 this afternoon :oops:

dertien
Posts: 274
Joined: Tue, 22. Feb 05, 13:27
x2

Post by dertien » Thu, 10. Aug 17, 01:12

UniTrader.... I hate to say this, but it works, it must have been your required input here... this is voodoo man! :)

I did use the subst method, with exactly the same name and it failed before... WTH?

Also I don't understand how the diff button works (in the XR cat tool GUI window top right), loading up two files (old file and new file) and then pressing it does nothing at all, or am I missing something here.

I tried with both files in the same folder and different names, and also both files same name, but the diff button (although selectable) does not create a new file. Have you used this before?

dertien
Posts: 274
Joined: Tue, 22. Feb 05, 13:27
x2

Post by dertien » Thu, 10. Aug 17, 01:34

Hey UniTrader...

Thanks again for your input. I had coded a more elegant solution which now seems to work as well:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="/mdscript[@name='Setup']/cues/cue[@name='Start']/actions/set_value[@name='md.$CockpitUpgradetraderLists']">
	<set_value name="md.$CockpitUpgradetraderLists" exact="
            [
                [
                    [ware.spe_cockpit_default, 1, 1, 100],
		[ware.spe_cockpit_fight, 1, 1, 100],
                    [ware.spe_cockpit_build, 1, 1, 100],
                    [ware.spe_cockpit_trade, 1, 1, 100]
                ]
            ]
        "/>	
	</replace>
	
	<replace sel="/mdscript[@name='Setup']/cues/cue[@name='Start']/patch[@value='md.$CockpitUpgradetraderLists']/@value">
			<set_value name="md.$CockpitUpgradetraderLists" exact="
            [
                [
                    [ware.spe_cockpit_default, 1, 1, 100],
		[ware.spe_cockpit_fight, 1, 1, 100],
                    [ware.spe_cockpit_build, 1, 1, 100],
                    [ware.spe_cockpit_trade, 1, 1, 100]
                ]
            ]
        "/>
</replace>
</diff>

Post Reply

Return to “X Rebirth - Scripts and Modding”