Categories

FME – Carrier Ops

Carrier Ops script is part of MSFS Flight Model Expansion project.

It contains of FME.wasm gauge and custom aircraft changes divided on required and optional – required are necessary for normal script functionality, optional gives you ultimate experience. Please use F/A-18E “Super Warrior” mod for reference and files source as it always up to date.

To use Carrier Ops feature your users/customers need PBK Crew assets installed (do not include them into your package, just add this add-on in requirements).

FME is freeware royalty free script, you can use it in any freeware or payware project, as developer or enthusiast under MIT license:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

However, be careful publishing mods of aircraft made by other people – they can complain about copyrights violation.

Technical details

CarrierActivity gauge utilise SimConnect to receive information about nearby SimObjects, update their variables, update aircraft variables.

It rely on TAXI LIGHT ON variable, so script is idle if TAXI LIGHT ON is True.

Catapult script active while aircraft on the ground, velocity less than 5 m/s, nearby objects scanned once per 10 seconds in 350 m radius.

Tailhook script active while tailhook handle is activated, nearby objects scanned once per 5 seconds in 1750 m radius.

Source code release not planned at the moment, but you can request details about specific feature functionality.

Aircraft upgrade – required changes

1. Copy latest FME.WASM into panels folder, CARRIEROPS.xml into model folder, if you did not made SDK project – update JSON of the aircraft.

2. Set FME.WASM as aircraft gauge:

Open panel.cfg file in text editor and add at the bottom

[VCockpit49]
size_mm=1,1
pixel_size=1,1
texture=$DUMMY
background_color=0,0,0
htmlgauge00=WasmInstrument/WasmInstrument.html?wasm_module=FME.wasm&wasm_gauge=CarrierActivity,0,0,1,1,mode=0&scanInterval=1&scanRadius=0&aboardRadius=0&velocityCompensation=0&memory=0

This script will activate catapult and arresting gear, also animate deck crew.

3. Add tailhook collision point. Open flight_model.cfg file in text editor, find [CONTACT_POINTS] section.

Find max_number_of_points parameter, increment it on 1 (if it was 15, update it to 16)

max_number_of_points =16

Find last point parameter (like point.14), insert this line below:

point.15 = 1, -26.35, 0, -5.5, 10000, 0, 0.75, 0, 4, 4, 0, 0, 0, 9, 0, 0, 1

where 15 is last point ID plus 1

-26.35, 0, -5.5 are coordinates (in feet) of tailhook tip (forward/backward, left/right, bottom/top) in fully deployed position. If your aircraft has tailhook modelled, you can find coordinates by loading GLTF model into Blender with MSFS Import plugin. If aircraft has no tailhook available, you can use example coordinates, just ensure vertical coordinate (-5.5) is above ground or you will catch wire during taxiing.

4. Open model.CFG file in text editor (model folder).

If both withExterior_showInterior and withInterior_showExterior are true, you will need to edit only Interior XML (filename after interior parameter in the same file)

If withExterior_showInterior=true and withInterior_showExterior=false then you need to edit Interior file

If withExterior_showInterior=false and withInterior_showExterior=true then you need to edit Exterior file

If withExterior_showInterior=false and withInterior_showExterior=false then you need to edit both Interior and Exterior files

5. Open systems.cfg in text editor. Insert values at the end of page:

[TailHook]
has_tailhook = 1

6. Open model XML file(s) in text editor to add custom scripts for catapult and arresting wires simulation:

Find node

<Behaviors>
*a lot of code*
</Behaviors>

If it does not exists, add it right under LODS empty Behaviors node:

 ...</LODS>

 <Behaviors>

 </Behaviors>

Right above </Behaviors> insert this script:

<Include RelativeFile="CARRIEROPS.xml"/>
<Component ID="CARRIEROPS">
	<UseTemplate Name="TOUCHINGCLOUD_CARRIEROPS">
		<LAUNCHBAR_POS_VAR>L:LAUNCHBAR POSITION</LAUNCHBAR_POS_VAR>
		<LAUNCHBAR_POSITION_X>0</LAUNCHBAR_POSITION_X>
		<LAUNCHBAR_POSITION_Y>-1.45</LAUNCHBAR_POSITION_Y>
		<LAUNCHBAR_POSITION_Z>4.5</LAUNCHBAR_POSITION_Z>
		<RESET_TRIM_FLAPS>0</RESET_TRIM_FLAPS>
		<SUPRESS_AFTERBURNER>1</SUPRESS_AFTERBURNER>
		<CATAPULT_FORCE_ADJUST>1</CATAPULT_FORCE_ADJUST>
		<NOSE_WHEEL_PAYLOAD_STATION>2</NOSE_WHEEL_PAYLOAD_STATION>
		
		<TAILHOOK_POS_VAR>A:TAILHOOK POSITION</TAILHOOK_POS_VAR>
		<TAILHOOK_COLLISION_POINT>3</TAILHOOK_COLLISION_POINT>
		<TAILHOOK_FORCE_ADJUST>1</TAILHOOK_FORCE_ADJUST>
		<TAILHOOK_LENGTH>1.86131</TAILHOOK_LENGTH>
		<TAILHOOK_POSITION_X>-0.06</TAILHOOK_POSITION_X>
		<TAILHOOK_POSITION_Y>-0.535654</TAILHOOK_POSITION_Y>
		<TAILHOOK_POSITION_Z>-6.49867</TAILHOOK_POSITION_Z>
		<TAILHOOK_ANGLE>-40</TAILHOOK_ANGLE>
	</UseTemplate>
</Component>

LAUNCHBAR_POS_VAR – launchbar position variable

LAUNCHBAR_POSITION_X LAUNCHBAR_POSITION_Y LAUNCHBAR_POSITION_Z – launchbar tip coordinate (in meters) while fully deployed (front wheel rotation ignored)

RESET_TRIM_FLAPS – set trim and flaps in takeoff position before catapult launch, then reset it after take off

SUPRESS_AFTERBURNER – script will not allow afterburner while aircraft fixed on catapult

CATAPULT_FORCE_ADJUST – catapult acceleration modifier

NOSE_WHEEL_PAYLOAD_STATION – number of payload station for kneel simulation

TAILHOOK_POS_VAR – tailhook position variable

TAILHOOK_COLLISION_POINT – tailhook contact point we added previously. 3 is the number of the “wheel”, if your aircraft has more than three wheels, update this number. Wheels numeration started with 0, so if aircraft has 4 wheels, TAILHOOK_COLLISION_POINT will be 4

TAILHOOK_FORCE_ADJUST – arresting effectiveness modifier

TAILHOOK_LENGTH – distance between tailhook tip and root points

TAILHOOK_POSITION_X TAILHOOK_POSITION_Y TAILHOOK_POSITION_Z -tailhook root coordindates (in meters)

TAILHOOK_ANGLE – deployment angle (compare to longitudinal axis)

All values in meters, you can take them from Blender after load exterior GLTF

7. In Interior model XML configure tailhook handle and launchbar switch (you need to know node and animation name of the interactive elements, use Blender with import plugin to find them). If these switches already animated, you need to remove old XML code for these nodes.

*all code below in modern templates form, and need to be copied inside of <Behaviors> </Behaviors>

Tailhook handle (replace LANDING_Gear_Lever_Hook with proper node name and animation):

<UseTemplate Name="ASOBO_Handling_Base_Template">
<NODE_ID>LANDING_Gear_Lever_Hook</NODE_ID>
<PART_ID>LANDING_Gear_Lever_Hook</PART_ID>
<ANIM_NAME>LANDING_Gear_Lever_Hook</ANIM_NAME>
<ANIM_CODE>(A:TAILHOOK HANDLE, percent) (A:WATER RUDDER HANDLE POSITION, percent) max</ANIM_CODE>

<IE_NAME>Lever_TailHook</IE_NAME>
<INTERACTION_TYPE>Switch</INTERACTION_TYPE>
<TOOLTIP_TITLE>@TT_Package.TAIL_HOOK_TITLE</TOOLTIP_TITLE>
<TT_DESCRIPTION_ID>@TT_Package.TAIL_HOOK_ACTION</TT_DESCRIPTION_ID>
<TT_VALUE_ON>@TT_Package.GT_STATE_EXTENDED</TT_VALUE_ON>
<TT_VALUE_OFF>@TT_Package.GT_STATE_RETRACTED</TT_VALUE_OFF>
<TT_VALUE_ONOFF_IS_DYNAMIC>False</TT_VALUE_ONOFF_IS_DYNAMIC>
<SET_STATE_EXTERNAL>p0 (&gt;K:SET_TAIL_HOOK_HANDLE) (A:WATER RUDDER HANDLE POSITION, percent) 100 != (&gt;A:WATER RUDDER HANDLE POSITION, bool)</SET_STATE_EXTERNAL>
<GET_STATE_EXTERNAL>(A:TAILHOOK HANDLE, percent) (A:WATER RUDDER HANDLE POSITION, percent) max</GET_STATE_EXTERNAL>
<WWISE_EVENT_1>tailhook_switch_on</WWISE_EVENT_1>
<WWISE_EVENT_2>tailhook_switch_off</WWISE_EVENT_2>
</UseTemplate>

Launchbar switch (replace Switch_LAUNCHBAR_LeftPanel with proper node name and animation):

<UseTemplate Name="ASOBO_Handling_Base_Template">
<NODE_ID>Switch_LAUNCHBAR_LeftPanel</NODE_ID>
<ANIM_NAME>Switch_LAUNCHBAR_LeftPanel</ANIM_NAME>
<ANIM_CODE>(L:LAUNCHBAR SWITCH, Boolean) ! 100 *</ANIM_CODE>
<PART_ID>Switch_LaunchBar</PART_ID>
<DONT_APPEND_ID>True</DONT_APPEND_ID>
<IE_NAME>Lever_LaunchBar</IE_NAME>
<INTERACTION_TYPE>Switch</INTERACTION_TYPE>
<TOOLTIP_TITLE>@TT_Package.LAUNCH_BAR_TITLE</TOOLTIP_TITLE>
<TT_DESCRIPTION_ID>@TT_Package.LAUNCH_BAR_ACTION</TT_DESCRIPTION_ID>
<TT_VALUE_ON>@TT_Package.GT_STATE_EXTENDED</TT_VALUE_ON>
<TT_VALUE_OFF>@TT_Package.GT_STATE_RETRACTED</TT_VALUE_OFF>
<TT_VALUE_ONOFF_IS_DYNAMIC>False</TT_VALUE_ONOFF_IS_DYNAMIC>
<SET_STATE_EXTERNAL>(L:LAUNCHBAR SWITCH, Boolean) ! (&gt;L:LAUNCHBAR SWITCH, Boolean)</SET_STATE_EXTERNAL>
<GET_STATE_EXTERNAL>(L:LAUNCHBAR SWITCH, Boolean)</GET_STATE_EXTERNAL>
<WWISE_EVENT_1>launchbar_switch_on</WWISE_EVENT_1>
<WWISE_EVENT_2>launchbar_switch_off</WWISE_EVENT_2>
</UseTemplate>

8. If model has animated tailhook and/or launchbar, configure their animation in Exterior model XML. If these elements already animated, you need to remove old XML code for these nodes.

Tailhook (replace hook with proper animation name):

<Component ID="Hook">
<UseTemplate Name="ASOBO_GT_Anim">
<ANIM_NAME>hook</ANIM_NAME>
<ANIM_CODE>(A:TAILHOOK POSITION, Percent)</ANIM_CODE>
<ANIM_LAG>500</ANIM_LAG>
</UseTemplate>
</Component>

Launchbar (replace c_launch_bar with proper animation name):

<Component ID="Launch_bar">
<UseTemplate Name="ASOBO_GT_Anim">
<ANIM_NAME>c_launch_bar</ANIM_NAME>
<ANIM_CODE>(L:LAUNCHBAR POSITION, Percent)</ANIM_CODE>
</UseTemplate>
</Component>

Aircraft upgrade – optional changes

To simulate kneeling during catapult launch and downforce during arresting, you can add additional payload to the front wheel

1. Open flight_model.cfg, find section [WEIGHT_AND_BALANCE]

2. Add new line after last station_load

station_load.3 =1, 12.25, 0, 0, Catapult, 1

where .3 is last payload ID incremented on 1

12.25 is longitudinal position of the front gear (feet)

3. Increase number of max_number_of_stations (if it was 2 update it to 3)

4. Open edited model XML files(s), set value for NOSE_WHEEL_PAYLOAD_STATION

<NOSE_WHEEL_PAYLOAD_STATION>4</NOSE_WHEEL_PAYLOAD_STATION>

were 4 is ID of new payload plus 1

Have some questions?

Your email address will not be published.

Email and website fields are optional.