[GUIDE] How To : edit a docked ship out of a shipyard

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

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

seedee
Posts: 78
Joined: Sat, 16. Sep 06, 05:38
x4

[GUIDE] How To : edit a docked ship out of a shipyard

Post by seedee »

NEW SOLUTION FOUND !
(notepad++ strongly advised)


WARNING § Heavy Save file editing, it's a last resort thing, it could break your save ! § WARNING
PS : try reading between lines, use YOUR IDs, not mine. They're not the same from one save to one another
PS2 : it was at first a "cry for help" post because I was thinking I was stuck. In fact, I just did it wrong the first time around. Using Notepad++, make sure everything "folds" back right (each starting <xxxx> must have its </xxx> and vice versa)



I've got a already build ship completely stuck at a shipyard's dry dock that don't want to move and don't seem to do what it's supposed to do (upgrade turrets on a capped ship)
The ship is docked, and still is after 30mins of game running
On the "command menu" part, the ship only get "join my squad", when i make him join squad, "new order" and "assign to new leader" are greyed out, "leave my squad" is there but no reaction from the ship at all.

These things didn't work at all :
- fully restocking the station (yup, "cheated" lots of wares that the shipyard wanted and sold everything to it) to the point the shipyard had no more buying orders at all
- waiting, in sector and out of sector, before and after restocking
- EXTREME bumping action (well, i just got stuck in the freighter myself)
so, it wasn't time or ressources related

As i saved just when the ship docked and last save was 2days before (plus, i did not board my 2 titurels with trade AND builder drones) i decided to save my ship

All the methods i found around here didn't work for my situation




Now, THE FUN PART !

I started by searching things that were connected to the ship, so first i searched for

Code: Select all

owner="player" known
to stumble on my ship, i found the buildmodule_ships_ part real quick

you can do the search either way, searching for the ship with owner="player" known or the shipyard itself with buildmodule_ships_

here's the part : ("1st part")

Code: Select all

<connection connection="connection_buildmodule01" macro="connection_buildmodule01">
<component class="buildmodule" macro="buildmodule_ships_albion_xl_macro" connection="connection_component01" id="[0x2407]">
<build start="117959" type="build"/>
<connections>
<connection connection="connection_dockingbay01" macro="connection_dockingbay01">
<component class="dockingbay" macro="props_surf_ar_docks_size_xl_inv_macro" connection="connection_component01" seed="2848735014" id="[0x2408]">
<offset>
<rotation yaw="180"/>
</offset>
<connections>
<connection connection="dock#part_dummy">
<component class="ship_xl" macro="units_size_xl_cargo_hauler_2_macro" connection="dock" attacker="[0x1e7d]" attackmethod="hitbybullet" attacktime="111869" owner="player" knownto="player" id="[0x2409]">

cropped all the ships parameters, if you're wondering, ship has no position values between </listeners> and <hull xxx>
!!!!!!! >>>   Fold this part with notepad++ until step 4    <<< !!!!!!

</connection>
<connection connection="docking#part_dummy" id="[0x2429]">
<connected connection="[0x2421]"/>
</connection>
</connections>
</component>
</connection>
<connection connection="buildanchor" id="[0x242b]">
<connected connection="[0x2426]"/>
</connection>
</connections>
</component>
</connection>
note the buildmodule ID, here's mine is 0x2407, use your own !



then, i searched for the buildmodule_ships_ ID 0x2407 I had until i stumbled upon this : npc_ship that-i-believe-is-the-right-one part : ("2nd part")

Code: Select all

<cue id="3968" state="complete" time="10.2318">
<vars>
<value name="$BuildModule" type="component" value="[0x2407]"/>
<value name="$Buildplan" type="buildplan" value="3"/>
<value name="$WareList" type="list" value="2700"/>
<value name="$actor" type="component" value="[0x2433]"/>
<value name="$buildcost" type="largefloat" value="756429"/>
<value name="$component" type="component" value="[0x2409]"/>
<value name="$droneplan" type="list" value="2224"/>
<value name="$isbuildership" type="integer" value="1"/>
<value name="$selectedMacro" type="macro" value="units_size_xl_builder_ship_macro"/>
<value name="$sequence" type="string" value="1065"/>
<value name="$ship" type="component" value="[0x2409]"/>
<value name="$showed_cArch_buildermacros" type="integer" value="1"/>
<value name="$showed_cArch_selectUpgradesMenu" type="integer" value="1"/>
<value name="$showed_cArch_selectship" type="integer" value="1"/>
<value name="$soldship" type="component" value="[0x1ef9]"/>
<value name="$soldshipprice" type="money" value="1128526500"/>
<value name="$stage" type="largefloat"/>
<value name="$upgrade" type="integer" value="1"/>
<value name="$upgrade_buildlimit" type="integer"/>
</vars>
Things to note :
value name="$actor" ID, here mine is 0x2433, as always, use your own !



i then seached for the actor ID 0x2433, i found a npc part like what we can have with captains in ship, and this part, wich i believe is interesing : (script - "3rd part")

Code: Select all

<script id="2278" name="trade.shipyard" time="126406" index="2">
<command type="trade"/>
<vars>
<value name="$build_plan" type="buildplan" value="7"/>
<value name="$buildmodule" type="component" value="[0x242d]"/>
<value name="$debugchance" type="integer"/>
<value name="$defencenpc" type="component" value="[0x3a49b]"/>
<value name="$engineer" type="component" value="[0x3a498]"/>
<value name="$pilot" type="component" value="[0x3a495]"/>
<value name="$selected_macro" type="macro" value="units_size_l_kit_bulk_01_macro"/>
<value name="$ship" type="component" value="[0x1a186]"/>
<value name="$ship_docks" type="list" value="3666"/>
<value name="$shiptrader" type="component" value="[0x2433]"/>
</vars>
</script>
(more on that later)



now, what i did :
make a copy of your save elsewhere, and test your change each time
if the game don't load, you did something wrong !


1 ) into the 1st part, deleting :

Code: Select all

<connection connection="buildanchor" id="[0x242b]">
<connected connection="[0x2426]"/>
</connection>


2 ) cleaning up 2nd part to the point there's only :

Code: Select all

<cue id="3968" state="complete" time="10.2318">
<vars>
<value name="$WareList" type="list" value="2700"/>
<value name="$actor" type="component" value="[0x2433]"/>
</vars>


3 ) changing values in third part to look like an old trade that was finished a long time ago, like this one : (this is an example of what a finished shipyard order should look like)

Code: Select all

<script id="2386" name="trade.shipyard" time="5817.85" index="2">
<command type="trade"/>
<vars>
<value name="$build_plan" type="buildplan" value="1"/>
<value name="$buildmodule" type="component" value="[0x60a6]"/>
<value name="$debugchance" type="integer"/>
<value name="$defencenpc" type="component" value="[0x0]"/>
<value name="$engineer" type="component" value="[0x0]"/>
<value name="$pilot" type="component" value="[0x0]"/>
<value name="$selected_macro" type="macro" value="units_size_xl_cargo_hauler_3_macro"/>
<value name="$ship" type="component" value="[0x0]"/>
<value name="$ship_docks" type="list" value="490"/>
<value name="$shiptrader"/>
</vars>
hence, giving this 3rd part replacement :

Code: Select all

<script id="2278" name="trade.shipyard" time="126406" index="2">
<command type="trade"/>
<vars>
<value name="$build_plan" type="buildplan" value="7"/>
<value name="$buildmodule" type="component" value="[0x242d]"/>
<value name="$debugchance" type="integer"/>
<value name="$defencenpc" type="component" value="[0x0]"/>
<value name="$engineer" type="component" value="[0x0]"/>
<value name="$pilot" type="component" value="[0x0]"/>
<value name="$selected_macro" type="macro" value="units_size_l_kit_bulk_01_macro"/>
<value name="$ship" type="component" value="[0x0]"/>
<value name="$ship_docks" type="list" value="3666"/>
<value name="$shiptrader"/>
</vars>
</script>
lines to change : you should replace every ID between [] by 0x0 except $buildmodule, everything after $shiptrader should disappear (you can copy that line to be sure)

what you should expect loading your save here :
game loads, builder NPC seems free, you can order a ship, the ship ordered should build and even move away just fine (on the condition that the yard is stocked with wares)

as for my own ship, the titurel (yes, that's the ship that's stuck)
... he's still stuck - yours should be too.

here is a screeny of the scene, for giggles :
"but i want my titurel back too !"
so i thought, "i could try editing the ship out of the buildmodule"



WARNING $ This part gets tougher

4 ) "editing the ship out"
so i cut/pasted the whole ship ref in a notepad file
cuting from :

Code: Select all

<connection connection="dock#part_dummy">
<component class="ship_xl" macro="units_size_xl_cargo_hauler_2_macro" connection="dock" attacker="[0x1e7d]" attackmethod="hitbybullet" attacktime="111869" owner="player" knownto="player" id="[0x2409]">
<listeners>
<listener listener="[0x1e7d]" event="killed"/>
<listener listener="[0x23b5]" event="killed"/>
<listener listener="[0x240d]" event="killed"/>
to :

Code: Select all

<component class="radar" macro="radar_ship_xl_fallback_01_macro" connection="ship" id="[0x2427]">
<connections/>
</component>
</connection>
</connections>
</component>
</connection>
just before

Code: Select all

<connection connection="docking#part_dummy" id="[0x2429]">
<connected connection="[0x2421]"/>
</connection>
</connections>
</component>
</connection>
with notepad++, clicking on <connection connection="dock#part_dummy"> and going all the way down to where the red line finishes help. A LOT. this way, you start selecting the text from the end of the line where the red line finishes (included) and you go up until you come accross the <connection connection="dock#part_dummy"> line again. Cut, Paste in an other notepad file for safe keeping.

(i had the luck to have an unused XL shipyard in the same save, so i opened it for reference / comparison)
1st part became this

Code: Select all

<connections>
<connection connection="connection_buildmodule01" macro="connection_buildmodule01">
<component class="buildmodule" macro="buildmodule_ships_albion_xl_macro" connection="connection_component01" id="[0x2407]">
<build start="117959" type="build"/>
<connections>
<connection connection="connection_dockingbay01" macro="connection_dockingbay01">
<component class="dockingbay" macro="props_surf_ar_docks_size_xl_inv_macro" connection="connection_component01" seed="2848735014" id="[0x2408]">
<offset>
<rotation yaw="180"/>
</offset>
<connections/>
</component>
</connection>
</connections>
</component>
</connection>
</connections>
in fact, you should delete this part :

Code: Select all

<connection connection="docking#part_dummy" id="[0x2429]">
<connected connection="[0x2421]"/>
</connection>
and then make sure everything folds back correctly


game loads, you can still order a ship and it build without issue, as expected, the titurel is no more !
(i like this ship, it's big, it haz guns, it haz a huge universal cargobay unlike the scaldis, and it haz tit in his name :D )




5 ) trying to paste the ship somewhere so icanhaz it back :

I searched for one of my other ships that was idle (not part of my squad, not affected to any manager / captain, no trade order, no nothing, just sitting there, the crew enjoying the emptiness of space with some spacefuel and spaceweed)
oh, and a ship that would be OOS from me when i'd load, too, to not have collision issues

I think the most important part here is having a location that is not in your zone.

I then pasted the whole ship part just before that ship
between :

Code: Select all

</component>
</connection>
(or whatever, something that is the end or the thing before your ship) and :

Code: Select all

<connection connection="ships">
<component class="ship_l" macro="units_size_l_kit_container_01_macro" connection="space" owner="player" knownto="player" id="[0x1f50]">
<listeners>

Then, I replaced these in the pasted part : (it's at the beginning)

Code: Select all

connection connection="dock#part_dummy">
<component class="ship_xl" macro="units_size_xl_cargo_hauler_2_macro" connection="dock" attacker="[0x1e7d]" attackmethod="hitbybullet" attacktime="111869" owner="player" knownto="player" id="[0x2409]">
to that :

Code: Select all

<connection connection="ships">
<component class="ship_xl" macro="units_size_xl_cargo_hauler_2_macro" connection="space" owner="player" knownto="player" id="[0x2409]">
Tried to load, game loaded.
and the ship was actually in the same zone as the copied ship, only it was in the middle of it
still, the commands were still greyed out, but, ship started to move...
only to get back in the shipyard dock...

"stupid captain, don't get into the shipworkers trap AGAIN !"




6 ) searching for solutions / ideas

searched for ship ID 0x2409, only "listeners" from crew and another one from a huge list came back, nothing to see there, move along !

I searched into the captain NPC things, compared it to the one in the idle ship, found and deleted this :
to go there, click on the starting line of what you paster, then search for type="commander"

Code: Select all

<blackboard>
<value name="$shiptrader_docking" type="componentslot" value="7"/>
</blackboard>
game loaded, ship loaded, and boosted towards me, YAY !

after 8hours of struggling, my ship is finally free from the evil shipworkers !

by the way, sorry if i did any mispellings / mistakes, i'm not an english native speaker

THANKS TO :
werewolves?
for his post in another thread wich guided me for some things (NPC_SHIP thingy, i knew where to look) and buildanchor thingy, too
Orion1632
Posts: 1334
Joined: Sun, 14. Dec 03, 09:55
x4

Post by Orion1632 »

Thanks a lot man.
LordFartAway
Posts: 1
Joined: Mon, 25. Apr 11, 16:00

Post by LordFartAway »

Hi guys, I had the same problem with one of my capital ships. I tried to adapt the script, but without success. ;)
But I found a much simpler solution. I hired a new captain and gave it the command over the ship in the dock. Tada, the ship was moving out of the dock.
So the main problem with the dock in previous versions seem to be fixed, but the command script of the captain might need some review.

To be precise:
- go to the shiptraders name
- find the id=[
- search the shiptraders id until you find the entry like stated above
<vars>
<value name="$BuildModule" type="component" value="[0x2407]"/>
<value name="$Buildplan" type="buildplan" value="3"/>
<value name="$WareList" type="list" value="2700"/>
<value name="$actor" type="component" value="[0x2433]"/>
<value name="$buildcost" type="largefloat" value="756429"/>
<value name="$component" type="component" value="[0x2409]"/>
<value name="$droneplan" type="list" value="2224"/>
<value name="$isbuildership" type="integer" value="1"/>
<value name="$selectedMacro" type="macro" value="units_size_xl_builder_ship_macro"/>
<value name="$sequence" type="string" value="1065"/>
<value name="$ship" type="component" value="[0x2409]"/>
<value name="$showed_cArch_buildermacros" type="integer" value="1"/>
<value name="$showed_cArch_selectUpgradesMenu" type="integer" value="1"/>
<value name="$showed_cArch_selectship" type="integer" value="1"/>
<value name="$soldship" type="component" value="[0x1ef9]"/>
<value name="$soldshipprice" type="money" value="1128526500"/>
<value name="$stage" type="largefloat"/>
<value name="$upgrade" type="integer" value="1"/>
<value name="$upgrade_buildlimit" type="integer"/>
</vars>
- delete all but
<value name="$WareList" type="list" value="2700"/>
<value name="$actor" type="component" value="[0x2433]"/>
And if the ship is still in dock, then exchange the captain. That's how it worked for me.

Cherio!

Return to “X Rebirth - Scripts and Modding”