I'd like to have my mining laser (for the loot boxes) AND heavy laser AND railgun installed (cue Queen "I want it all").
I am quite close, I feel, but run into problems when it comes to actually installing the guns at the vendor.
I created these files:
assets\units\player\unit_player_ship.xml
Code: Select all
<add sel="/components/component[@name='unit_player_ship']/connections">
<connection name="conn_primaryweapon_extrarail" tags="primary_slot weapon_extrarail ">
<offset>
<position x="2.073881" y="2.620501" z="0.1136742"/>
</offset>
</connection>
<connection name="conn_primaryweapon_extrahvlaser" tags="primary_slot weapon_extrahvlaser ">
<offset>
<position x="-3.293781" y="-0.1444476" z="-2.879636"/>
</offset>
</connection>
</add>
Code: Select all
<add sel="/macros/macro/properties/weapons">
<slot ref="conn_primaryweapon_extrarail"/>
<slot ref="conn_primaryweapon_extrahvlaser"/>
</add>
<replace sel="/macros/macro/properties/upgrades/upgrade[@upgrade='weapon_player_railgun_mk1_macro']">
<upgrade upgrade="weapon_player_railgun_mk1_macro" tags="primary_slot weapon_extrarail" />
</replace>
<replace sel="/macros/macro/properties/upgrades/upgrade[@upgrade='weapon_player_beam_v2_macro']">
<upgrade upgrade="weapon_player_beam_v2_macro" tags="primary_slot weapon_extrahvlaser" />
</replace>
Code: Select all
<replace sel="//connection[@name='ShipConnection01']">
<connection name="ShipConnection01" tags="component weapon_extrarail">
<offset>
<position x="2.49535E-07" y="-2.531064E-02" z="-2.861023E-06"/>
</offset>
</connection>
</replace>
Code: Select all
<weaponcycle>
<slot ref="conn_primaryweapon_extrahvlaser"/>
<slot ref="conn_primaryweapon_extrarail"/>
<cycle index="1" ref="weapon_player_impulse_mk2_macro"/>
</slot>
<slot ref="conn_primaryweapon_mg">
<cycle index="4" ref="weapon_player_machinegun_mk1_macro"/>
</slot>
[....]
Code: Select all
<connection connection="conn_primaryweapon_impuls">
<component class="playerweapon" macro="weapon_player_impulse_mk2_macro" connection="shipconnection" lastshottime="0" ammunition="-1" id="[0x104bd]">
<offset>
<position x="-3.294" y="-0.1191" z="-2.88"/>
</offset>
<render>
<parameter flags="32" value="1" owner="[0x104bd]" name="light" subname="scale4" type="glow">
<persistent start="0" duration="-1" value="1" target="1"/>
</parameter>
</render>
<shootcontroller class="playerprimary" starttime="67.9718" angle="0.0872665"/>
</component>
</connection>
When I buy one the game stalls for a bit. If I open the trader again, the weapon had disappeared (they always have just one for sale), but the weapon isn't installed on my ship.
No weapon cycle entry in the savegame, nor the connection.
What do I miss?