Edit XML to remove a ship.

The place to discuss scripting and game modifications for X4: Foundations.

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

Post Reply
photomankc
Posts: 232
Joined: Wed, 16. Jul 14, 15:01

Edit XML to remove a ship.

Post by photomankc » Thu, 30. May 19, 16:00

After the 2.5 update a couple of my XL ships from the Rise of the Ossian Raider mod were bugged out. They would not upgrade or resupply at any shipyard or equipment dock. They would simply remain in the dock for hours with the "Change Equipment" command "Executing". Also any attempt to transfer wares would hang up the command queue with "critical" and you could not delete it. I suspected this might be something to do with them being built prior to the update so my only option seemed to be to sell them off and re-purchase new ships. That did indeed fix the issues with changing equipment and the new replacement ships work just fine.

However, now I see that my selling them back has given them to the faction to operate as patrol ships. I'm concerned that this will lead to them getting parked into shipyard or Eq dock and blocking it forever with a resupply that never complete. I would like to destroy these ships but now they belong to the Argon. In looking through the XML, it's HHHHUUUGGGEEEE and I'm not at all sure what makes up all of the 'ship'. If possible I'd like to just edit them out completely if anyone knows how to get all the XML bits properly removed?

Alternatively, I wondered if it might not be easier to just make them mine again so I can properly dispose of them via firing squad. I see each has a "Component Class" entry line that includes

Code: Select all

owner="argon"
. If I just change that back to "player" will that be enough to give them back to me so I can destroy them without repercussions? That seems the option with the least chance for breaking things.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Edit XML to remove a ship.

Post by euclid » Fri, 31. May 19, 03:39

Hi photomankc,

You could use a script to remove the ships but it may be a better idea to ask for a fix in the corresponding mod thread of the "Rise f the Ossian Raider" especially since the author of this mod is aware of the problem.
However, if you still prefer to remove the ships via script then use

Code: Select all

 <destroy_object object="$MyTarget" explosion="false"/> 
I recommend a short MD script that offer that choice (Yes/No) when changing target, i.e. a condition

Code: Select all

<event_player_changed_target>
and then start a conversation

Code: Select all

<start_conversation actor="player.computer" conversation="DestroyMyTarget" type="unqueued" />
with

Code: Select all

$MyTarget=param
and the choices

Code: Select all

<add_player_choice text="'Destroy Target'" section="destroy"/>
<add_player_choice text="Do NOT destroy Target'" section="cleanup"/> 
Hope that helps.

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

photomankc
Posts: 232
Joined: Wed, 16. Jul 14, 15:01

Re: Edit XML to remove a ship.

Post by photomankc » Fri, 31. May 19, 19:11

Thanks for that! I'm interested in learning a bit more how to do some of this stuff. That helps.

I ended up just going "Leroy Jenkins" on it. I brought the fleet over and we just attacked and destroyed it when it ventured away from help. I was at relation level 30 and now I'm at 29. Not much of a hit for blowing up the King's Battleship but that's fine for my purposes this time around. No more threat of that sucker corking up a shipyard. I got my nose pretty bloodied by my old ship too. Kind of cool to have to face off with that missile spitting monster!

I'm fairly sure that any attempt to hand-edit out the ship would be a complete failure. Also I learned it was not just as simple as changing the owner to "player" so that's not a solution either.

Thanks again for the script hints though!

Post Reply

Return to “X4: Foundations - Scripts and Modding”