help with editing weapons

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

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

User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

i replaced the <part name="part_plasmaemitter"> inside the props_wps_plasmaemitter_player.xml
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

need help with this, im trying to make my new weapons buyable

Setup.xml

Code: Select all

	<replace sel="/mdscript/cues/cue[@name='WeaponTraderBasket2']/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, 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_cpe_mk1, 1, 1, 100]
					[ware.upg_pla_weapon_cpe_mk2, 1, 1, 100]
					[ware.upg_pla_weapon_gauss_mk1, 1, 1, 50]
                ]
            ]
        "/>
	</replace>
the result is

Code: Select all

[General] ======================================
[=ERROR=] ERROR: The Upgrade Trader warelist does not contain ALL playership upgrades - Florian
[General]
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Missed a couple of commas in the end. :)
xrook wrote:

Code: Select all

	[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]
	[ware.upg_pla_weapon_cpe_mk2, 1, 1, 100]
	[ware.upg_pla_weapon_gauss_mk1, 1, 1, 50]
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

still same result, can anyone give me the rundown on how to add new weapons on the mechanic? i might be missing something

EDIT:

Code: Select all

[General] ======================================
[=ERROR=] Skipping MD file extensions\Skunk_Overhaul\md\Setup.xml: Script name 'Setup' already found in file md\setup.xml
[General] ======================================
[General] ======================================
[=ERROR=] ERROR: The Upgrade Trader warelist does not contain ALL playership upgrades - Florian
[General] ======================================
User avatar
alexalsp
Posts: 1896
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp »

Code: Select all

<replace sel="/mdscript[@name='Setup']/cues/cue[@name='WeaponTraderBasket2']/actions/set_value[@name='md.$WeaponUpgradetraderLists']">
        <set_value name="md.$WeaponUpgradetraderLists" exact=" 
            [ 
                [ 
                      [ware.upg_pla_weapon_ie_mk1, 2, 2, 100], 
                      [ware.upg_pla_weapon_ie_mk2, 2, 2, 100], 
                      [ware.upg_pla_weapon_pe_mk1, 2, 2, 100], 
                      [ware.upg_pla_weapon_pe_mk2, 2, 2, 100], 
                      [ware.upg_pla_weapon_sg_mk1, 2, 2, 100], 
                      [ware.upg_pla_weapon_sg_mk2, 2, 2, 100], 
                      [ware.upg_pla_weapon_mg_mk1, 2, 2, 100], 
                      [ware.upg_pla_weapon_mg_mk2, 2, 2, 100], 
                      [ware.upg_pla_weapon_mg_mk3, 2, 2, 100], 
                      [ware.upg_pla_weapon_ml_mk1, 2, 2, 100], 
                      [ware.upg_pla_weapon_ml_mk2, 2, 2, 100], 
                      [ware.upg_pla_weapon_ml_mk3, 2, 2, 100], 
                      [ware.upg_pla_weapon_hept, 2, 2, 100],
                      [ware.upg_pla_weapon_cpe_mk1, 2, 2, 100],
                      [ware.upg_pla_weapon_cpe_mk2, 2, 2, 100],
                      [ware.upg_pla_weapon_gauss_mk1, 2, 2, 100] 
                ] 
            ] 
        "/> 
   </replace>
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

i really, really need someone to slap me in the face... i literally did the same mistake as my first post
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

slap!

Don't worry about it. Happens all the time.

Got it working?
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

yup
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

i couldnt wrap it around my head why lasers cant lock on to targets like normal weaponry
User avatar
Lander1979
Posts: 1017
Joined: Mon, 4. Aug 14, 05:18
x4

Post by Lander1979 »

Interesting progress you are making here, some of your discoveries may have a drastic impact to the Katana Mod, where I was attempting to make dual and quad weapons systems, but was never able to sync them (I have currently run out of steam for modding atm, so feel free to take a look at Katana Mod and release something if you feel inclined to do so).
0101...0011...0011...0101...2!
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

i did check out your mod, i wanted to know what xml files needed to edit. it turns out that the only thing i need was to replace the source geometry then just reposition everything else

i also released the mod, its called 'skunk overhaul' in nexus
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

is there a debug menu ingame where i could see how much damage im dealing per shot?

or a list where i could see my damage per shot on paper?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

Isn't this value defined in the bullet file itself?
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 ;)
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

i wanted to see and record live results since im experimenting with weapons

but right now im concerned about how i patched the setup.xml, wont it cause incompatibilities with other mods??

is there a way to specifically add it inside without replacing the entire thing?

as you can see i have no idea with what im doing

Code: Select all

	<add sel="/mdscript[@name='Setup']/cues/cue[@name='Start']">
		<patch sinceversion="2" state="complete">
			<do_all exact="md.$WeaponUpgradetraderLists.{1}.count" counter="$i">
					<set_value name="md.$WeaponUpgradetraderLists.{1}.{$i + 1}" exact=
					"
					[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]
					" operation="insert"/>
					<break/>
			</do_all>
		</patch>
	</add>
	<add sel="/mdscript[@name='Setup']/cues/cue[@name='WeaponTraderBasket2']">
		<patch sinceversion="" state="complete">
			<do_all exact="md.$WeaponUpgradetraderLists.{1}.count" counter="$i">
					<set_value name="md.$WeaponUpgradetraderLists.{1}.{$i + 1}" exact="[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]" operation="insert"/>
					<break/>
			</do_all>
		</patch>
	</add>
	<add sel="/mdscript[@name='Setup']/cues/cue[@name='WeaponTraderBasket3']">
		<patch sinceversion="2" 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_cpe_mk1, 1, 1, 100]" operation="insert"/>
					<break/>
				</do_if>
			</do_all>
		</patch>
	</add>
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

noone? it will cause problems to future mods that add wares to the game you know, i have my own drone now but i just cant add it to wares because i have 'repair laser drone' mods installed, so i cant just <replace> his <replace>

there should be a set standard on how modders will add wares into the game
User avatar
Marvin Martian
Posts: 3614
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian »

Code: Select all

        <do_all exact="md.$WeaponUpgradetraderLists.{1}.count" counter="$i"> 
               <set_value name="md.$WeaponUpgradetraderLists.{1}.{$i + 1}" exact="[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]" operation="insert"/> 
               <break/> 
         </do_all> 
here you need on do_all the reverse="true", because your {$i + 1} == {2}

so even better try

Code: Select all

          <set_value name="md.$WeaponUpgradetraderLists.{1}.{md.$WeaponUpgradetraderLists.{1}.count + 1}" exact="[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]" operation="insert"/> 
or do i understand your code wrong?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

the best method i found was to modify the trader baskets after they are created.

for that write a new MD-Script which waits for the start cue to be completed and then adds the Wares to the Trader Lists:

Code: Select all

<mdscript name="Xrook_Add_Weapons" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://utnas/~unitrader/XRebirthxsds/md.xsd">
  <cues>
    <cue name="Start" checktime="5s" checkinterval="5s">
      <conditions>
        <cue_is_complete cue="md.Setup.Start"/>
      </conditions>
      <actions>
        <append_to_list name="md.$WeaponUpgradetraderLists.{1}" exact="[ware.upg_pla_weapon_cpe_mk1, 1, 1, 100]"
      </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]"
      </actions>
    </cue>
  </cues>
</mdscript>
note that when setting up the initial List or updating it during the Plot there is a short gap where your Weapon is not in the List and Traders created during this time wont have the related Weapon in stock - you have to switch Zones once to generate Trades who take these changes into account
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 ;)
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

@marvin i got that code inside the setup.xml itself and thought maybe i could modify to make it add my wares :lol:

Code: Select all

      <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>
thx, ill try both, one by one
you guys should put it on the stickied XML Patch Guide
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

@unitrader
your code worked perfectly, though the second cue created a duplicate so i disabled that part by '<!--' whatever this is called

any modders who adds wares should use your code as a standard and should be stickied
User avatar
xrook
Posts: 205
Joined: Fri, 31. Jul 15, 01:25

Post by xrook »

what determines how much missile ammunition a unit can have?

Return to “X Rebirth - Scripts and Modding”