Freigeben über


Attach point .XML in .X files.

So we recently became aware of an issue that was preventing people from creating attach points in programs other than Gmax. We are encoding the XML blob used for attach points into a binary in the .X file, which makes it very difficult for people to decipher. And so, without further ado, the decoded XML blob for you to use to create attach points (NOTE: the pivot of the object that these are attached to is where the effect or object spawns, and the geometry of that object goes away):

For effects:

"<?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Attachpoint name="attachpt_EffectName"> <AttachedObject> <Effect effectName="EffectName" effectParams="EffectParams"/> </AttachedObject> </Attachpoint> </FSMakeMdlData>"

NOTE:attachPt_EffectName must be unique per attach instance (attachpt_navwhih01, attachpt_navwhih02, etc.) EffectName = Name of effect without the extension (fx_navred, fx_strobe, etc.) EffectParams = Same effect params you would use when placing an effect via XML (DAY=1, NIGHT=1, etc.)

For Library Objects:

"<?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Attachpoint name="attachpt_Name"> <AttachedObject> <LibraryObject name="ObjectGUID" scale="1.0"/> </AttachedObject> </Attachpoint> </FSMakeMdlData>"

ObjectGUID must be the standard XML GUID format that works in the current BGLComp.

For Platforms:

The geometry of the object goes away and a landable surface that is the same shape appears.

"<?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Platform name="platform_UniqueName" surfaceType="surfaceType" /> <NoCrash/> </FSMakeMdlData>"

surfaceType = #("CONCRETE","GRASS","WATER","GRASS_BUMPY","ASPHALT","SHORT_GRASS","LONG_GRASS","HARD_TURF","SNOW","ICE","URBAN",

"FOREST","DIRT","CORAL","GRAVEL","OIL_TREATED","STEEL_MATS","BITUMINUS","BRICK","MACADAM","PLANKS","SAND","SHALE","TARMAC",

"WRIGHT_FLYER_TRACK")

To remove crash boxes on an object:

"<?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <NoCrash/> </FSMakeMdlData>"

And to attach an empty attach point (like our beacons):

"<?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Attachpoint name="attachpt_UniqueName"> </Attachpoint> </FSMakeMdlData>"

And here's the block as it is in the .X file:

attachpt_RedLight01 would be the Attachpoint name="" from the various XML blobs above.

Frame frm-attachpt_RedLight01 {

PartData {

233;

60, 63, 120, 109, 108, 32, 118, 101, 114, 115,

105, 111, 110, 61, 34, 49, 46, 48, 34, 32,

101, 110, 99, 111, 100, 105, 110, 103, 61, 34,

73, 83, 79, 45, 56, 56, 53, 57, 45, 49,

34, 32, 63, 62, 32, 60, 70, 83, 77, 97,

107, 101, 77, 100, 108, 68, 97, 116, 97, 32,

118, 101, 114, 115, 105, 111, 110, 61, 34, 57,

46, 48, 34, 62, 60, 65, 116, 116, 97, 99,

104, 112, 111, 105, 110, 116, 32, 110, 97, 109,

101, 61, 34, 97, 116, 116, 97, 99, 104, 112,

116, 95, 82, 101, 100, 76, 105, 103, 104, 116,

48, 49, 34, 62, 32, 60, 65, 116, 116, 97,

99, 104, 101, 100, 79, 98, 106, 101, 99, 116,

62, 32, 60, 69, 102, 102, 101, 99, 116, 32,

101, 102, 102, 101, 99, 116, 78, 97, 109, 101,

61, 34, 102, 120, 95, 111, 98, 115, 108, 105,

103, 104, 116, 50, 34, 32, 101, 102, 102, 101,

99, 116, 80, 97, 114, 97, 109, 115, 61, 34,

34, 47, 62, 32, 60, 47, 65, 116, 116, 97,

99, 104, 101, 100, 79, 98, 106, 101, 99, 116,

62, 32, 60, 47, 65, 116, 116, 97, 99, 104,

112, 111, 105, 110, 116, 62, 60, 47, 70, 83,

77, 97, 107, 101, 77, 100, 108, 68, 97, 116,

97, 62, 0;

} // End PartData

FrameTransformMatrix {

1.000000, 0.000000, 0.000000, 0.0,

0.000000, 0.000000, -1.000000, 0.0,

0.000000, 1.000000, 0.000000, 0.0,

0.000000, 0.000000, -197.002335, 1.0;;

} // End FrameTransformMatrix

The information in the 'PartData' block is a decimal encoding of the ASCII for the .XML. Note that there is no geometry being output for the attach point, just a reference frame and a blob of data.

And there you have it! Good luck and enjoy!

 

And of course, the disclaimer (though if I got something wrong, I'll try to update it):

This posting is provided "AS IS" with no warranties, and confers no rights.

Comments

  • Anonymous
    January 01, 2003
    This is very helpful, although I am having issues getting it to work. My objective is to attach a landing light effect (fx_landing.fx) to a poly (named c_gear_landlite) in FSDS3. The model is saved as an .x file and then dragged onto MakeMDL.exe to create a new .mdl file. Here is the code as I've adjusted it, any suggestions would be appreciated. <?xml version="1.0" encoding="ISO-8859-1" ?>  <FSMakeMdlData version="9.0">    <Attachpoint name="attachpt_fx_landing_fx">      <c_gear_landlite>        <Effect effectName="fx_landing" effectParams="&gt;K:LANDING_GEAR_TOGGLE"/>            </c_gear_landlite>    </Attachpoint>  </FSMakeMdlData>

  • Anonymous
    March 19, 2007
    Very helpful but have a few questions -

  1. <AttachedObject> Leave as is, or the actual name of the object say in FSDS?
  2. PartData block - Right at the start of it where does the 233; come from? (I understand the rest)
  3. effectParams - can we use a: varibles i.e effectParams="(A: LIGHT_NAV, bool)0 &gt;" Basically want to use this method to attach fx_nav lights to folding wings. Thanks
  • Anonymous
    October 02, 2007
    Does this change for the FS-X x file format?