Making the Guillemot's engines not rotate.

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

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

dertien
Posts: 283
Joined: Tue, 22. Feb 05, 13:27
x2

Making the Guillemot's engines not rotate.

Post by dertien »

Hello,

The Guillemot Sentinel is a great ship, but the constantly rotating engines kinda screw it for me from cockpit view, so I was wondering if I could simply turn off the rotation of the front engines and have them aligned to the hull.

Was trying to get this to work with the following code (with help from SirFrancisDrake) but this does not work:

Code: Select all

<?xml version="1.0"?>
<diff>
	<remove sel="//components/component/connections/connection[@name='Connection54']/restriction">
				<restriction type="rotation_x"/>
	</remove>
	<remove sel="//components/component/connections/connection[@name='Connection55']/restriction">
				<restriction type="rotation_x"/>

	</remove>
</diff>


removing the restriction's rotation should work, but somehow the code gets ignored:

debug log:

[=ERROR=] 0.00 No matching node for path '//components/component/connections/connection[@name='Connection54']/restriction' in patch file 'extensions\Guillemot_no_rotating_engines\assets\units\size_s\ship_tel_s_scout_02'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//components/component/connections/connection[@name='Connection55']/restriction' in patch file 'extensions\Guillemot_no_rotating_engines\assets\units\size_s\ship_tel_s_scout_02'. Skipping node.

Any ideas anyone?

Please share.
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Making the Guillemot's engines not rotate.

Post by DeadAirRT »

Neither of your xpaths are valid since Connection54 is for the airlock and there is no Connection55. Your diff path is also incomplete since it is trying to skip the "restrictions" node to get to "restriction" unless the way you did it is some advanced way I'm not familiar with.

Connection49 and Connection50 have part_rotator for the attached engines which I'm assuming you want.

<remove sel="/components/component/connections/connection[@name='Connection49']/restrictions">
<remove sel="/components/component/connections/connection[@name='Connection50']/restrictions">

even with that fixed, I have no clue if that will actually do what you want but good luck.
dertien
Posts: 283
Joined: Tue, 22. Feb 05, 13:27
x2

Re: Making the Guillemot's engines not rotate.

Post by dertien »

Thank you for your reply.

You were right about my xpath, it was indeed missing the 'S' on the 'restrictionS' node. Thank you for pointing that out.

The 'ship_tel_s_scout_02.xml' XML file I was editing was situated in Cat01 and was not an accurate reflection of the updated one in Cat.07, which you pointed out had the engine nodes on connection 50 and 49 instead of on 54 and 55.

here it is. https://www.mediafire.com/file/pxo2kf1j ... s.zip/file

The engines needed an offset which is done as well in the file above.

Code: Select all

<connection name="Connection49" tags="part platformcollision  ">
				<offset>
					<position x="5.6" y="0" z="8.9"/>
				</offset>
and

Code: Select all

<connection name="Connection50" tags="part platformcollision  ">
			<offset>
					<position x="-5.6" y="0" z="8.9"/>
				</offset>
The following code seems to do what it should

Code: Select all

<?xml version="1.0"?>
<diff>
	<remove sel="/components/component/connections/connection[@name='Connection49']/restrictions"></remove>
	<remove sel="/components/component/connections/connection[@name='Connection50']/restrictions"></remove>

<add sel="//components/component/connections/connection[@name='Connection49']">
				<offset>
					<position x="5.6" y="0" z="8.9"/>
				</offset>
</add>
<add sel="//components/component/connections/connection[@name='Connection50']">
				<offset>
					<position x="-5.6" y="0" z="8.9"/>
				</offset>
</add>
</diff>
Thanks for helping me get rid of the 'rotating engines'

Godspeed.

Return to “X4: Foundations - Scripts and Modding”