[Question] How to replace a line in plot_ep1 (Answered)

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

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

docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

[Question] How to replace a line in plot_ep1 (Answered)

Post by docwho83 »

______________________________________

Edit:

Thank you YorrickVander! fixed the issue


_______________________________________
I have try to do this with he normal replace code from a save before tradeship was created. I have made a modify Rahanas (energy & container) so I was wanting to make it the ship we get instead of stock.

Code: Select all

<diff>
<replace sel="/mdscript[@name='Plot_ep1_ch1']/cues/cue[@name='P2_Meet_Borman_Conv_2_End']/create_ship[@name='macro.units_size_l_kit_hybrid_02_macro']">
                     macro.units_size_l_kit_hybrid_02_mk5_macro
</replace>
</diff>
I have try to replace the whole cue 'p2_meet_borman_conv_2_end'

Code: Select all

<diff>
<replace sel="/mdscript[@name='Plot_ep1_ch1']/cues/cue[@name='P2_Meet_Borman_Conv_2_End']">
                   <cue name="P2_Meet_Borman_Conv_2_End">
                      <conditions>
                        <event_conversation_finished actor="$Yisha" outcome="P2_Meet_Borman_Conv_2"/>
                      </conditions>
                      <actions>
                        <start_script object="$Borman_Ship.pilot" name="'move.jump'">
                          <param name="destination" value="$Alb_FarOutSec_Zone29"/>
                          <param name="position" value="position.[0,0,0km]"/>
                          <param name="skipcharge" value="true"/>
                          <param name="ignorefuel" value="true"/>
                          <param name="nonstop" value="true"/>
                          <param name="forcejump" value="true"/>
                        </start_script>

                        <!--was previously units_size_l_kit_liquid_01_macro and units_size_l_kit_bulk_01_macro-->
                       <create_ship name="$TradeShip" macro="macro.units_size_l_kit_hybrid_02_mk5_macro" zone="$ALB_InnerworldSec_Zone12">
                          <owner exact="faction.player" overridenpc="true"/>
                          <pilot actor="null"/>
                          <defence actor="null"/>
                          <engineer actor="null"/>
                          <units>
                            <unit category="unitcategory.transport" mk="1" exact="50" />
							<unit category="unitcategory.welder" mk="1" amount="24"/>
                          </units>
                          <cargo>
                            <wares list="[ware.fuelcells]">
                              <fillpercent min="70" max="80"/>
                            </wares>
                          </cargo>
                          <position x="-5050m" y="1200m" z="17900m"/>
                          <rotation yaw="-128deg" pitch="-3deg"/>
                        </create_ship>
                        <set_object_min_hull object="$TradeShip" exact="5"/>

                        <create_mission cue="Part_2" name="{30301,1021}" description="{30301,1021}" difficulty="level.easy" faction="faction.heartofalbion" type="missiontype.plot" abortable="false">
                          <briefing>
                            <objective step="2" action="objective.flyto" object="$TradeShip"/>
                          </briefing>
                        </create_mission>
                        <set_objective cue="Part_2" step="2" action="objective.flyto" object="$TradeShip"/>
                      </actions>
                      <cues>
                        <cue name="P2_Fly_To_Trade_Ship_Conv_Init">
                          <delay exact="10s"/>
                          <actions>
                            <start_conversation priority="100" actor="$Yisha" conversation="P2_Fly_To_Trade_Ship_Conv"/>
                          </actions>
                        </cue>
</replace>
</diff>
This did not work either.

Can someone tell me what I am missing?
Last edited by docwho83 on Sun, 29. Jun 14, 21:29, edited 1 time in total.
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Untested and I'm not the greatest at xpath but :

Code: Select all

<replace sel="//cue[@name='P2_Meet_Borman_Conv_2_End']/actions/create_ship[@name='macro.units_size_l_kit_hybrid_02_macro']/@name">macro.units_size_l_kit_hybrid_02_mk5_macro</replace> 
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

Post by docwho83 »

@YorrickBander Thanks for the reply. Sadly dose not work.

I have try your code as posted and modify versions.

Code: Select all

<replace sel="//cue[@name='P2_Meet_Borman_Conv_2_End']/actions/create_ship[@name='macro.units_size_l_kit_hybrid_02_macro']/@name">macro.units_size_l_kit_hybrid_02_mk5_macro</replace>
no

Code: Select all

<diff>
<replace sel="/mdscript[@name='Plot_ep1_ch1']/cues/cue[@name='P2_Meet_Borman_Conv_2_End']/actions/create_ship[@macro='macro.units_size_l_kit_hybrid_02_macro']">
< macro="macro.units_size_l_kit_hybrid_02_mk5_macro" >  
</replace>
</diff>
no

Code: Select all

<diff>
<replace sel="/mdscript[@name='Plot_ep1_ch1']/cues/cue[@name='P2_Meet_Borman_Conv_2_End']/actions[@name='create_ship']">
create_ship name="$TradeShip" macro="macro.units_size_l_kit_hybrid_02_mk5_macro" zone="$ALB_InnerworldSec_Zone12"  
</replace>
</diff>
no

Code: Select all

<diff>
<replace sel="/mdscript[@name='Plot_ep1_ch1']/cues/cue[@name='P2_Meet_Borman_Conv_2_End']/create_ship[@macro='macro.units_size_l_kit_hybrid_02_macro']">
macro="macro.units_size_l_kit_hybrid_02_mk5_macro" 
</replace>
</diff>
no

The issues I think is trying to replace a part of a line. Which should be able to be done. I try, I think, to replace the whole line. but I have not gotten errors from any of these codes. done both ways with diff code and without.
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

The dangers of late night posting... Yeah sorry that was a fail post indeed. Try this :

Code: Select all

<diff>
  <replace sel="//cue[@name='P2_Meet_Borman_Conv_2_End']/actions/create_ship[@name='$TradeShip']">
    <create_ship name="$TradeShip" macro="macro.units_size_l_kit_hybrid_02_mk5_macro" zone="$ALB_InnerworldSec_Zone12">
      <owner exact="faction.player" overridenpc="true"/>
      <pilot actor="null"/>
      <defence actor="null"/>
      <engineer actor="null"/>
      <units>
        <unit category="unitcategory.transport" mk="1" exact="50" />
      </units>
      <cargo>
        <wares list="[ware.fuelcells]">
          <fillpercent min="70" max="80"/>
        </wares>
      </cargo>
      <position x="-5050m" y="1200m" z="17900m"/>
      <rotation yaw="-128deg" pitch="-3deg"/>
    </create_ship>
  </replace>
</diff>
Not the most elegant but also gives your mod the finer control of everything on the changed ship in one entry.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

Post by docwho83 »

Thanks YorrickVander. That now has the ship showing up.

Issue now is that it comes up as a PMC ship even tho the owner is set to faction.player. Not sure why that is happening.
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

Post by docwho83 »

ok played with the code a bit more.

YAY it now comes up as a player owned ship as the mk5 type.

Thanks for the help YorrickVander. Other mods that modify plot_ep1 files had more information on the replace line so I was trying to make sure I had all the cues/cue correct.

All I needed was //cue[@name


end code is as follows.

Code: Select all

<diff> 
<replace sel="//cue[@name='P2_Meet_Borman_Conv_2_End']/actions/create_ship[@name='$TradeShip']">
<create_ship name="$TradeShip" macro="macro.units_size_l_kit_hybrid_02_mk5_macro" zone="$ALB_InnerworldSec_Zone12">
                          <owner exact="faction.player" overridenpc="true"/>
                          <pilot actor="null"/>
                          <defence actor="null"/>
                          <engineer actor="null"/>
                          <units>
                            <unit category="unitcategory.transport" mk="1" exact="50" />
							<unit category="unitcategory.welder" mk="1" exact="20" />
                          </units>
                          <cargo>
                            <wares list="[ware.fuelcells]">
                              <fillpercent min="70" max="80"/>
                            </wares>
                          </cargo>
                          <position x="-5050m" y="1200m" z="17900m"/>
                          <rotation yaw="-128deg" pitch="-3deg"/>
                        </create_ship>
</replace>
</diff>
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals

Return to “X Rebirth - Scripts and Modding”