MP Fallback models

Revision as of 15:56, 1 August 2018 by Stuart (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Revision as of 15:56, 1 August 2018 by Stuart (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MP Fallback models allow an aircraft developer to set what aircraft model be used to render their aircraft over MP if a user doesn't have their aircraft installed.

Using a fallback model with your aircraft

To make use of this feature, simply set /sim/model/fallback-model-index in the aircraft-set.xml file to one of the indexes in /AI/Aircraft/fallback_models.xml.

This is then transmitted over the MP system and used by other clients.

For example;

<sim>
  <model>
    <fallback-model-index>6</fallback-model-index>
...

will use the Cub model, as index 6 refers to it in fallback_models.xml:

<PropertyList>

<!-- Default aircraft.  Will also be used if an AI model is not found -->
<model n="0" type="string">/Models/Geometry/glider.ac</model>

<!-- 1-50   Single engine GA aircraft -->
<model n="1" type="string">AI/Aircraft/c172/c-fgfs.xml</model>
<model n="2" type="string">AI/Aircraft/c177/c177-g-brdo.xml</model>
<model n="3" type="string">AI/Aircraft/c182/Models/c182-ai.xml</model>
<model n="4" type="string">AI/Aircraft/c182rg/Models/c182rg-ai.xml</model>
<model n="5" type="string">AI/Aircraft/Cessna208Caravan/Models/Cessna208-ai.xml</model>
<model n="6" type="string">AI/Aircraft/Cub/Models/Cub-ai.xml</model>

...

</PropertyList>

Testing fallback models

The easiest way to test if a fallback model is working is by using two instances of flightgear connecting locally with each other for MP. To do this you first need to ensure that you have no FG_AIRCRAFT paths set (this ensures that flightgear will use the FGDATA AI/Aircraft).

Then start two separate instances, e.g.

# Instance loading the aircraft (in this case the spitfire)
fgfs --multiplay=out,10,127.0.0.1,5000 --multiplay=in,10,127.0.0.1,5001 --callsign=Test1 --disable-fullscreen --aircraft=spitfireVb --airport=EG32 --geometry=800x600 --fg-aircraft=/home/stuart/FlightGear/fgaddon/Aircraft

# Instance loading the ufo to view the above aircraft
fgfs --multiplay=out,10,127.0.0.1,5001 --multiplay=in,10,127.0.0.1,5000 --callsign=Test2 --disable-fullscreen --aircraft=ufo --airport=EG32 --geometry=1280x1000 --altitude=100 --offset-distance=0.1

See also

External links

Forum topics

Mailing list treads