Add ownerless ship with wrecked engines/turrets

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

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

Marc009
Posts: 4
Joined: Sat, 10. Dec 11, 18:40
x4

Add ownerless ship with wrecked engines/turrets

Post by Marc009 »

Hey Everybody,

I am trying to add some ownerless ships to the game for a new Story mod i am working on.
These Ships should not be fully functioning, but rather be repaird after claiming.

My issue is, that i cant figure out how to add a ship with non operational/wrecked turrets and engines.
I managed to add damaged turrets and engines, but i cant seem to get below 1% hull.

Any ideas?
User avatar
Marvin Martian
Posts: 3688
Joined: Sun, 8. Apr 12, 09:40
x4

Re: Add ownerless ship with wrecked engines/turrets

Post by Marvin Martian »

instead of set hull to "0" use <destroy_object />

Code: Select all

<find_object_component name="$PossibleElements" object="$Object" multiple="true" integrated="false">
	<match_parent macro="$Object.macro"/>
	<match_any>
		<match class="class.weapon"/>
		<match class="class.turret"/>
		<match class="class.launcher"/>
		<match class="class.engine"/>
		<match class="class.shieldgenerator"/>
	</match_any>
</find_object_component>
<do_for_each name="$todo" in="$PossibleElements">
	<destroy_object object="$todo" explosion="true"/>
</do_for_each >
explosion="false" will remove it without possibility to repair it afterwards
Marc009
Posts: 4
Joined: Sat, 10. Dec 11, 18:40
x4

Re: Add ownerless ship with wrecked engines/turrets

Post by Marc009 »

Great, thanks. Exactly what I was looking for ;)

Return to “X4: Foundations - Scripts and Modding”