(SOLVED!) Need help with a code bug that I can't seem to squash with the HAYABUSA

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

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

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

(SOLVED!) Need help with a code bug that I can't seem to squash with the HAYABUSA

Post by dertien »

Ok here goes,

I'm a bit lost with the following problem on the skunk overhaul Haybusa mod:

In both DLC's (TO and HOL) trying to purchase any weapons besides the beam lasers makes the circular menu (the conversational NPC menu) disappear. There are three files in the mod I know about which seem to be responsible for the display of the weapons choices when talking to mechanics:

md/setup.xml

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.$WeaponUpgradetraderLists']">
				<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, 0, 0, 0],
						[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]
						]
						]
						"/>
	</replace>
	<add sel="/mdscript[@name='Setup']/cues/cue[@name='WeaponTraderBasket2']/actions">
		<signal_cue cue="md.ArsenalWareUpdate.weaponbasket1"/>
	</add>
	<add sel="/mdscript[@name='Setup']/cues/cue[@name='WeaponTraderBasket3']/actions">
		<signal_cue cue="md.ArsenalWareUpdate.weaponbasket2"/>
	</add>
	
</diff>
The custom created file:
md/ArsenalWareUpdate.xml

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<!-- created by UniTrader, a must use for adding wares instead of replacing the ware list in setup.xml-->
<mdscript name="ArsenalWareUpdate" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://utnas/~unitrader/XRebirthxsds/md.xsd"> 
	<cues> 

		<cue name="OtherWareUpdate" checktime="5s" checkinterval="5s"> 
			<conditions> 
				<cue_is_complete cue="md.Setup.Start"/> 
			</conditions> 
			<actions> 
				<debug_text filter="general" text="'OtherWareUpdate signalled'"/>
				<append_to_list name="md.$DroneTraderLists.{1}" exact="[ware.drone_pmd_mk1, 4, 8, 100]" />
				<append_to_list name="md.$EngineUpgradetraderLists.{1}" exact="[ware.upg_pla_engine_hate_mkx, 1, 1, 10]" />
			</actions> 
		</cue> 

		<cue name="weaponbasket1"> 
			<conditions> 
				<event_cue_signalled/> 
			</conditions> 
			<delay exact="5s" />
			<actions> 
				<debug_text filter="general" text="'ArsenalWareUpdate1 signalled'"/>
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpe_mk2, 1, 1, 80]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_gauss_mk1, 1, 1, 40]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk1, 1, 1, 100]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk2, 1, 1, 60]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpc_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_csg_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk1, 1, 1, 75]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk2, 1, 1, 45]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_vulcan_mk1, 1, 1, 30]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_vulcan_mk2, 1, 1, 15]" />
			</actions> 
		</cue> 

		<cue name="weaponbasket2"> 
			<conditions> 
				<event_cue_signalled/>
			</conditions> 
			<delay exact="5s" />
			<actions> 
				<debug_text filter="general" text="'ArsenalWareUpdate2 signalled'"/>
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpe_mk2, 1, 1, 80]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_gauss_mk1, 1, 1, 40]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk1, 1, 1, 100]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk2, 1, 1, 60]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpc_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_csg_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk1, 1, 1, 75]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk2, 1, 1, 45]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_vulcan_mk1, 1, 1, 30]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_vulcan_mk2, 1, 1, 15]" />
			</actions> 
		</cue>

		<cue name="campaign start"> 
			<conditions> 
				<event_cue_signalled cue="md.Setup.GameStart" /> 
				<cue_is_complete cue="md.Setup.WeaponTraderBasket3" negate="true"/> 
			</conditions> 
			<actions> 
				<debug_text filter="general" text="'CampaignStartArsenalWare signalled'"/> 
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk1, 1, 1, 100]" /> 
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk2, 1, 1, 60]" /> 
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk3, 1, 1, 10]" /> 
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_vulcan_mk1, 1, 1, 30]" /> 
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_vulcan_mk2, 1, 1, 15]" /> 
			</actions> 
		</cue>

		<cue name="archangel"> 
			<conditions> 
				<event_cue_signalled/> 
				<!--<event_cue_signalled cue="md.GM_Collect_Crafted_Item.CompleteMission"/> --> 
			</conditions>
			<delay exact="5s" />
			<actions> 
				<!-- w.evans -->
				<do_all exact="md.$EngineUpgradetraderLists.{1}.count" counter="$i"> 
					<do_if value="md.$EngineUpgradetraderLists.{1}.{$i}.{1} == ware.upg_pla_engine_hate_mkx"> 
						<set_value name="$xrook_TraderListNum" exact="$i"/> 
						<break/> 
					</do_if> 
				</do_all> 
				<do_if value="$xrook_TraderListNum?"> 
					<set_value name="md.$EngineUpgradetraderLists.{1}.{$xrook_TraderListNum}.{4}" operation="add"/> 
					<do_if value="md.$EngineUpgradetraderLists.{1}.{$xrook_TraderListNum}.{4} gt 100"> 
						<set_value name="md.$EngineUpgradetraderLists.{1}.{$xrook_TraderListNum}.{4}" exact="100"/> 
					</do_if> 
				</do_if>
				<debug_text filter="general" text="'SUCCESS!! Archangel +1 ware chance'"/> 
			</actions> 
		</cue> 
		<!-- <cue name="Refresh" instantiate="true"> 
			<conditions> 
				<check_any> 
					<event_cue_completed cue="md.Setup.WeaponTraderBasket2"/> 
					<event_cue_completed cue="md.Setup.WeaponTraderBasket3"/> 
				</check_any> 
			</conditions> 
			<delay exact="5s"/> 
			<actions> 
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpe_mk2, 1, 1, 100]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_gauss_mk1, 1, 1, 40]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk1, 1, 1, 100]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk2, 1, 1, 60]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_bs_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpc_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_csg_mk3, 1, 1, 10]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk1, 1, 1, 75]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk2, 1, 1, 45]" />
				<append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_hail_mk3, 1, 1, 10]" />
			</actions> 
		</cue> -->
	</cues> 
</mdscript>
and the wares file:

libraries/wares

Code: Select all

<diff>
	<add sel="/wares">
		<ware id="upg_pla_weapon_cpe_mk1" name="{20105,301}" description="{20105,302}" transport="equipment" size="medium" volume="1">
			<price min="42500" average="85000" max="127500" />
			<component ref="weapon_player_cpe_mk1_macro" amount="1" />
		</ware>
		<ware id="upg_pla_weapon_cpe_mk2" name="{20105,401}" description="{20105,402}" transport="equipment" size="medium" volume="1">
			<price min="200000" average="400000" max="600000" />
			<component ref="weapon_player_cpe_mk2_macro" amount="1" />
		</ware>

		<ware id="upg_pla_weapon_gauss_mk1" name="CPHIVI/MA Cannon" description="{20104,502}" transport="equipment" size="medium" volume="1">
			<price min="1275000" average="1700000" max="2550000" />
			<component ref="weapon_player_gauss_mk1_macro" amount="1" />
		</ware>

		<ware id="upg_pla_weapon_bs_mk1" name="{58794,05}" description="{58794,06}" transport="equipment" size="medium" volume="1">
			<price min="171000" average="190000" max="209000" />
			<component ref="weapon_player_bs_mk1_macro" amount="1" />
		</ware>
		<ware id="upg_pla_weapon_bs_mk2" name="{58794,07}" description="{58794,08}" transport="equipment" size="medium" volume="1">
			<price min="639000" average="710000" max="781000" />
			<component ref="weapon_player_bs_mk2_macro" amount="1" />
		</ware>
		<ware id="upg_pla_weapon_bs_mk3" name="{58794,09}" description="{58794,10}" transport="equipment" size="medium" volume="1">
			<price min="876000" average="1030000" max="1185000" />
			<component ref="weapon_player_bs_mk3_macro" amount="1" />
		</ware>

		<ware id="upg_pla_weapon_cpc_mk3" name="Plasma Cannon Mk3" description="{20104,302}" transport="equipment" size="medium" volume="1">
			<price min="759000" average="1012000" max="1265000" />
			<component ref="weapon_player_plasma_mk3_macro" amount="1" />
		</ware>

		<ware id="upg_pla_weapon_csg_mk3" name="Inertial Hammer Mk3" description="{20108,3002}" transport="equipment" size="medium" volume="1">
			<price min="815100" average="1254000" max="1692900" />
			<component ref="weapon_player_shotgun_mk3_macro" amount="1" />
		</ware>

		<ware id="upg_pla_weapon_hail_mk1" name="{58794,11}" description="{58794,12}" transport="equipment" size="medium" volume="1">
			<price min="208000" average="260000" max="312000" />
			<component ref="weapon_player_hail_mk1_macro" amount="1" />
		</ware>
		<ware id="upg_pla_weapon_hail_mk2" name="{58794,13}" description="{58794,14}" transport="equipment" size="medium" volume="1">
			<price min="728000" average="910000" max="1092000" />
			<component ref="weapon_player_hail_mk2_macro" amount="1" />
		</ware>
		<ware id="upg_pla_weapon_hail_mk3" name="{58794,15}" description="{58794,16}" transport="equipment" size="medium" volume="1">
			<price min="1976000" average="2470000" max="2964000" />
			<component ref="weapon_player_hail_mk3_macro" amount="1" />
		</ware>

		<ware id="drone_pmd_mk1" name="{58794,01}" description="{58794,02}" transport="container" size="medium" volume="1">
			<price min="11451" average="14314" max="17176" />
			<component ref="units_size_drone_poor_man_macro" amount="1" />
			<icon active="droneability_attack" video="units_size_drone_poor_man_macro" />
		</ware>

		<ware id="upg_pla_weapon_vulcan_mk1" name="{58794,17}" description="{58794,18}" transport="equipment" size="medium" volume="1">
			<price min="733500" average="815000" max="896500" />
			<component ref="weapon_player_vulcan_mk1_macro" amount="1" />
		</ware>
		<ware id="upg_pla_weapon_vulcan_mk2" name="{58794,19}" description="{58794,20}" transport="equipment" size="medium" volume="1">
			<price min="1003500" average="1115000" max="1226500" />
			<component ref="weapon_player_vulcan_mk2_macro" amount="1" />
		</ware>

		<ware id="upg_pla_engine_hate_mkx" name="{58794,21}" description="{58794,22}" transport="equipment" size="medium" volume="1">
			<price min="19170000" average="21300000" max="23430000" />
			<component ref="engine_player_archangel_hate_macro" amount="1" />
		</ware>
	</add>
</diff>

Adding the necessary lines to setup.xml file from the latest (cat/dat 9) has not helped. I changed the values of the 'hept', 'pe_charging' and railgun_mk1 to 1,1,100 because I assumed that they would then show in OL/AL as well. That didn't work.

Cheating in the weapons with Simoom's Lantern works fine though, and they show up at the correct places on the model.

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.$WeaponUpgradetraderLists']">
				<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, 0, 0, 0],
						[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, 1, 1, 100],
						[ware.upg_pla_weapon_ml_mk3, 1, 1, 100],
						[ware.upg_pla_weapon_hept, 1, 1, 100],
						[ware.upg_pla_weapon_pe_charging_mk1, 1, 1, 100],
						[ware.upg_pla_weapon_railgun_mk1, 1, 1, 100]
						]
						]
						"/>
	</replace>
	<add sel="/mdscript[@name='Setup']/cues/cue[@name='WeaponTraderBasket2']/actions">
		<signal_cue cue="md.ArsenalWareUpdate.weaponbasket1"/>
	</add>
	<add sel="/mdscript[@name='Setup']/cues/cue[@name='WeaponTraderBasket3']/actions">
		<signal_cue cue="md.ArsenalWareUpdate.weaponbasket2"/>
	</add>
	
</diff>
Buying either vanilla or custom weapons works in all sectors except for HOL and TO. I can only purchase the beam laser and the gauss rifle in TO or HOL without having the menu disappear. Can someone please shed some light on why this is happening and how I can solve it ?

Thank you.
Last edited by dertien on Tue, 19. Jul 16, 14:28, edited 1 time in total.
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13485
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid »

Just guessing but HoL and TO have their own wares.xml which may overwrite things.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
dertien
Posts: 283
Joined: Tue, 22. Feb 05, 13:27
x2

Post by dertien »

Hi Euclid, thanks for your post

IMHO I don't imagine the wares.xml file having anything to do with it for two reasons:

- The wares.xml files from both dlc's do not contain any references regarding weapons (I checked both for the text 'pla_weapon' and got 0 results using notepad++)

- Since the <diff> tag was used in the mod, together with <add> and only the custom weapons were added to the wares file nothing should be overwritten.

Another strange thing is this:

When visiting mechanics in HOL and TO, I have also noticed that the custom modded weapons (which are defined as <add> in the wares.xml file of the mod in a <diff> tag) do not get added to the 3 'for sale baskets' where they should when you visit the mechanic.
However...
The mod comes with a special engine. That engine gets added to the mechanics 'for sale basket' in HOL and TO when changing the values to 1,1,100 in the ArsenalWareUpdate.xml file.

Why the weapons don't follow the same logic (the list is as good as empty in HOL and TO) when set to 1,1,100 (weapon always available for sale) and get added to the baskets is beyond me.
Last edited by dertien on Sun, 17. Jul 16, 22:32, edited 1 time in total.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

HOL and TO have seperate Availability Lists. look in the respective Setup MD file ;)
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: 283
Joined: Tue, 22. Feb 05, 13:27
x2

Post by dertien »

Thanks for pointing that out. There is indeed for HOL a SETUP_DLC2.xml file that changes relevant code regarding weapon lists. I haven't looked at the TO file yet, because the HOL gamestart puts you in control immediately unlike the TO one where you need to converse with the security patrol, so it's easier to load that game.

Trying ammend the code did not work. Still only vanilla weapons seem to make it into the baskets:

Here is the part of the original code from ego in the SETUP_DLC2.xml file which I think is relevant to the mechanics:

Code: Select all

<mdscript name="Setup_DLC2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>
    <cue name="Start" checktime="0.1s" checkinterval="0.5s" version="2">
      <conditions>
        <cue_is_complete cue="md.Setup.Start"/>
      </conditions>
      <actions>
        <!--Find clusters-->
        <find_cluster name="md.$ClusterL" macro="macro.cluster_l_macro"/>
        <find_cluster name="md.$ClusterM" macro="macro.cluster_m_macro"/>
        <find_cluster name="md.$ClusterN" macro="macro.cluster_n_macro"/>
        <set_value name="md.$DLC2_Clusters" exact="[md.$ClusterL, md.$ClusterM, md.$ClusterN]"/>

        <signal_cue cue="SetupWeaponUpgradeTrader"/>
      </actions>
      <patch sinceversion="2">
        <set_value name="md.$DLC2_Clusters" exact="[md.$ClusterL, md.$ClusterM, md.$ClusterN]"/>
      </patch>
    </cue>

    <cue name="Patch_WeaponUpgradeTrader" onfail="cancel">
      <conditions>
        <check_age min="10s"/>
      </conditions>
      <actions>
        <signal_cue cue="SetupWeaponUpgradeTrader"/>
      </actions>
    </cue>

    <cue name="SetupWeaponUpgradeTrader" namespace="this">
      <conditions>
        <event_cue_signalled/>
      </conditions>
      <actions>
        <do_if value="not md.$WeaponUpgradetraderLists_BySpace?">
          <set_value name="md.$WeaponUpgradetraderLists_BySpace" exact="[]"/>
        </do_if>
        <set_value name="$DLC2WeaponLists" exact="[
                  [
                      [ware.upg_pla_weapon_ie_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_ie_mk2, 0, 1, 30],
                      [ware.upg_pla_weapon_pe_mk1, 0, 1, 50],
                      [ware.upg_pla_weapon_pe_mk2, 0, 1, 50],
                      [ware.upg_pla_weapon_sg_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_sg_mk2, 0, 1, 50],
                      [ware.upg_pla_weapon_mg_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_mg_mk2, 0, 1, 30],
                      [ware.upg_pla_weapon_mg_mk3, 0, 0, 10],
                      [ware.upg_pla_weapon_ml_mk1, 1, 1, 50],
                      [ware.upg_pla_weapon_ml_mk2, 0, 1, 30],
                      [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, 1, 50],
                      [ware.upg_pla_weapon_railgun_mk1, 0, 1, 50]
                  ]
              ]"/>
        <set_value name="$ClusterL_List" exact="[md.$ClusterL, $DLC2WeaponLists.clone]"/>
        <append_to_list name="md.$WeaponUpgradetraderLists_BySpace" exact="$ClusterL_List"/>
        
        <set_value name="$ClusterM_List" exact="[md.$ClusterM, $DLC2WeaponLists.clone]"/>
        <append_to_list name="md.$WeaponUpgradetraderLists_BySpace" exact="$ClusterM_List"/>
        
        <set_value name="$ClusterN_List" exact="[md.$ClusterN, $DLC2WeaponLists.clone]"/>
        <append_to_list name="md.$WeaponUpgradetraderLists_BySpace" exact="$ClusterN_List"/>
      </actions>
      <!--To patch '$TheList':
        1 - update $TheList in the <actions> node to the new values
        2 - increment the cue version
        3 - increment the sinceverstion below. This will:
            - remove $TheList from md.$WeaponUpgradetraderLists_BySpace via the <patch> node
            - force the cue via the <patch> node-->

      <!--<patch sinceversion="2" state="complete" comment="Increment this patch node when $DLC2WeaponLists has changed">
        <remove_value name="md.$WeaponUpgradetraderLists_BySpace.{md.$WeaponUpgradetraderLists_BySpace.indexof.{$ClusterL_List}}"/>
        <remove_value name="md.$WeaponUpgradetraderLists_BySpace.{md.$WeaponUpgradetraderLists_BySpace.indexof.{$ClusterM_List}}"/>
        <remove_value name="md.$WeaponUpgradetraderLists_BySpace.{md.$WeaponUpgradetraderLists_BySpace.indexof.{$ClusterN_List}}"/>
        <force_cue cue="SetupWeaponUpgradeTrader"/>
      </patch>-->
      <cues>
        <!--A cue to keep the parent alive for possible patching in the future.-->
        <cue name="SetupWeaponUpgradeTrader_KeepAlive">
          <conditions>
            <event_cue_signalled/>
            <check_value value="false"/>
          </conditions>
        </cue>
      </cues>
    </cue>
and the SETUP_DLC2.xml I made which resides in Skunk_Overhaul/md folder:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="/mdscript[@name='Setup_DLC2']/cues/cue[@name='SetupWeaponUpgradeTrader']/actions/set_value[@name='$DLC2WeaponLists']">
				<set_value name="$DLC2WeaponLists" 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, 1, 1, 100],
                      [ware.upg_pla_weapon_ml_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_ml_mk2, 1, 1, 100],
                      [ware.upg_pla_weapon_ml_mk3, 1, 1, 100],
                      [ware.upg_pla_weapon_hept, 1, 1, 100],
                      [ware.upg_pla_weapon_pe_charging_mk1, 1, 1, 100],
                      [ware.upg_pla_weapon_railgun_mk1, 1, 1, 100]
                  ]
              ]"/>
	</replace>
	<add sel="/mdscript[@name='Setup_DLC2']/cues/cue[@name='SetupWeaponUpgradeTrader']/actions">
		<signal_cue cue="md.ArsenalWareUpdate.weaponbasket1"/>
	</add>	
</diff>
The code above should change the availability of the vanilla weapons (make them all available) and add the custom weapons from the arsenalwareupdate file. Neither happens, so I am kind of wondering whether the file gets loaded at all... For testing purposes I am running the game in windowed mode and I load a new game (not from gamesave) to test out things.

Since that didn't work I tried to remove the patched mechanics with the new name so the mechanics from the vanilla game in the setup.xml file could take over again...

No dice : here is the code:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<remove sel="/mdscript[@name='Setup_DLC2']/cues/cue[@name='Start']/actions/signal_cue[@cue='SetupWeaponUpgradeTrader']"></remove>	
	<remove sel="/mdscript[@name='Setup_DLC2']/cues/cue[@name='Patch_WeaponUpgradeTrader']"></remove>	
	<remove sel="/mdscript[@name='Setup_DLC2']/cues/cue[@name='SetupWeaponUpgradeTrader']"></remove>
</diff>
I don't know what to do now.

Since the Skunk_Overhaul folder is lower in the folder list than the Ego_DLC2 one, this will load mine instead of the one in the DLC right ? Or do I need to put these files in a special folder because the DLC's are residing in the extensions folder themselves ?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

to change load order put a
<dependency id="ego_dlc_2" optional="true"/>
in your content.xml, as i did here:
https://github.com/UniTrader/XFleetFest ... ontent.xml

also you might need the "double extensions"-Trick to modify DLC/Mod Files - not entirely sure if its required for DLC but i think it was...
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: 283
Joined: Tue, 22. Feb 05, 13:27
x2

Post by dertien »

Hi Unitrader,

Thank you for nursing me through this, I was able to find a workaround. All custom weapons from the original Skunk_Overhaul are now available and for sale at the mechanics in both DLC's, and I managed to add 3 weapons of the 4 new ones released by Ego. It seems that there is a finite number of weapons one can add, so the compromise was to scrap a few custom weapons and replace them with the new vanilla weapons.

So for the benefit of anyone who needs to know about this:

The double extension method was indeed necessary (as unitrader suggested above) to mod files that change the DLC's, so I made a new folder in the Skunk_Overhaul folder called extensions/ego_dlc_2/md and ego_dlc_teladi_outpost/extensions/md/ where both setup files of each DLC reside.

Then I added the lines he suggested to the content file like so:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<content id="" name="Skunk Overhaul" description="Player ship mod overhaul" author="Miguel, dertien" version="83015" date="8/30/2015" sync="false" lastupdate="9/28/2015">
  <text language="44" name="Skunk Overhaul" description="Player ship mod overhaul" author="Miguel, dertien"/>
  <dependency id="ego_dlc_2" optional="true"/>
  <dependency id="ego_dlc_teladi_outpost" optional="true"/>
</content>
Finally I ammended the startup code in both files that deals with the traders and added that to both startup files:

- for Home Of Light: Skunk_Overhaul/extensions/ego_dlc_2/md/Setup_DLC2.xml
- for Teladi Outpost: Skunk_Overhaul/ego_dlc_teladi_outpost/extensions/md/Setup_Teladi_Outpost.xml

P.S. Thanks again Unitrader, I owe you one ;)

Return to “X Rebirth - Scripts and Modding”