• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Experimental how to: Adding an effect to a specific part

Heretic

Resource contributor
Messages
6,830
Country
germany
THIS IS EXPERIMENTAL AND ABSOLUTELY NOT FOR THE FAINT OF HEART! YOU HAVE BEEN WARNED!

Unless it's already common knowledge, here's a short how-to on how to add an effect to a specific part in a hierarchy. This is especially useful for adding lights to flexing wings or moving parts.

I've successfully managed to attach a nav and strobe light to each flexing wingtip of an aircraft with this procedure, using nothing else but Notepad2 and MCX.

You really need to be comfortable with editing very large text files, finding stuff in MCX' hierarchy editor and, of course, adding effects in the attached object editor. A text editor with syntax highlighting, especially for bracket pairs is almost mandatory.

Well, here it goes...


1) Add an attached effect (e.g. nav light; fx_navgre) effect at the model origin. Note the effect name in the hierarchy viewer, e.g. effect06

2) Export model from MCX in .x file format

3) In MCX' hierarchy editor, find the nav light casing or wingtip geometry or other suitable geometry in the hierarchy editor

4) Note the first value from the "Bounding box - min" matrix minus the last digit, e.g. 3402.55 when 3402.556 is shown in MCX

5) CTRL+F your way through the exported .x file until you find this value and note the numbers of the parts in which the value can be found, e.g. "part90", "part 102", etc...

7) Note the second value from the "Bounding box - min" matrix minus the last digit, e.g. 67.20 when 67.201 is shown in MCX

8) CTRL+F your way through the exported .x file until you find this value and note the part number(s) that the value is found in, e.g. "part98", "part100", "part 102", etc...

9) Note the third value from the "Bounding box - min" matrix minus the last digit, e.g. -689.37 when -689.375 is shown in MCX

10) CTRL+F your way through the exported .x file until you find this value and note the part number(s) that the value is found in, e.g. "part64", "part90",..., "part 102", etc...

11) In this example, part 102 shares all 3 coordinates, so part 102 is most likely the target part you're looking for

12) Find the effect in the .x file by searching for "effect06". You will find "Mesh attpt_effect06". Scroll up until you see the associated "Frame frm_partNN {" line.

13) Mark the entire "Frame ..." entry for the part FROM THE BEGINNING OF THE "Frame..." LINE DOWN TO AND INCLUDING THE CLOSING "}"

14) Cut. Paste these lines into a temporary file, if it makes you feel safer.

15) Find the CLOSING "}" bracket for the "FRAME frm_part102" entry (syntax highlighting in Notepad2!) and paste the "Frame ..." entry for the effect into the space ABOVE it

16) Save the edited .x file and import it into MCX

17) Check the hierarchy editor. The effect should at least be in the hierarchy near the desired part.

18) Repeat the cutting an pasting in the .x file until you have pasted your effect into the "Frame ..." entry of the desired parent part.

19) Now open the attached object editor in MCX and move the effect to the desired location by altering its coordinates. Note that you will have to use very large, two or three digit values. Use trial&error to position the effect.

21) If so desired, add visibility conditions in the hierarchy editor.

20) Repeat the procedure for any other effects that you wish to add to the parent part or the model. Note that the parts are being renumbered after export!

21) Compile the model and check it out in FSX once you're done.


The hardest part is actually finding the parent part in the .x file and remembering to cut and paste the right amount of lines into the right location.


Hope it's useful to someone.
 
It is very generous of you as a developer to post this.
 
Thanks Bjoern! It is a bit of a hassle to find the right coordinates for the effect attach point but once done it works perfectly. Great to have a solution for landing lights attached to gear doors or nav lights attached to folding wings.
 
Thanks for the expanded animation library in return, Henk. :)



- Edit:

Regarding finding the right coordinates, enabling the wireframe and attached effect display in the viewport and orienting yourself on the geometry coordinates in the bounding box matrix of the parent part will make things a bit easier.


I've just successfully added two landing light, two nav light and two strobe light effects to a flexing wing.

You have to be, however, really, really careful when working in the .x file as a missed curly bracket/brace will inevitably mess up the model.
A text editor with bracket highlighting, or, better usable indentation, is a real life saver!
 
Last edited:
More tips for finding a certain part in an .x file:
  • Find each part in the .x file that is using the same material by searching for the name of the texture as stated in the hierarchy editor and then comparing the number of triangles. The number of triangles is stated as a single number with a semicolon at the beginning of the second data block in the "mesh partNN{ ..." definition, e.g. "255;" followed by the triangle/face definitions from the next line onward, e.g. "3; 2, 1, 0;,".
  • If a part is animated, you can also find the animation in the .xanim file, and find the "partName", e.g. "node293" stated in the animation's "<AnimStream...>" tag.
 
hi Bjoern i think i am missing something.
after reimporting the X i got these errors "could not find linked animation for node NN"
Is a whole "FRAME" line with the effect composed like this: ?
Code:
Frame frm_part432 {
    PartData {
    286;
    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, 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, 86, 105, 115, 105, 98, 105, 108, 105, 116, 121, 32, 110, 97, 109, 101, 61, 34, 99, 117, 115, 116, 111, 109, 95, 118, 105, 115, 95, 76, 73, 71, 72, 84, 32, 76, 65, 78, 68, 73, 78, 71, 95, 49, 49, 34, 62, 60, 47, 86, 105, 115, 105, 98, 105, 108, 105, 116, 121, 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, 108, 97, 110, 100, 105, 110, 103, 95, 56, 34, 62, 60, 65, 116, 116, 97, 99, 104, 101, 100, 79, 98, 106, 101, 99, 116, 62, 60, 69, 102, 102, 101, 99, 116, 32, 101, 102, 102, 101, 99, 116, 78, 97, 109, 101, 61, 34, 102, 120, 95, 108, 97, 110, 100, 105, 110, 103, 34, 32, 101, 102, 102, 101, 99, 116, 80, 97, 114, 97, 109, 115, 61, 34, 48, 34, 47, 62, 60, 47, 65, 116, 116, 97, 99, 104, 101, 100, 79, 98, 106, 101, 99, 116, 62, 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;
    }
    FrameTransformMatrix {
    0.000120, 0.710280, -0.703919, 0.000000,
    0.999998, 0.001296, 0.001478, 0.000000,
    0.001962, -0.703918, -0.710278, 0.000000,
    1.053891, -0.138506, -0.319660, 1.000000;
    }   
    Mesh attachpt_landing_8 {
    3;
    -1.00000; 0.00000; 0.00000;,
    1.00000; 0.00000; 0.00000;,
    0.00000; 1.00000; 0.00000;;
    1;
    3; 2, 1, 0;;
        MeshMaterialList {
        1;
        1;
        0;
            Material mat1456 {
            1.000000; 1.000000; 1.000000; 1.000000;;
            0.000000;
            0.000000; 0.000000; 0.000000;;
            0.000000; 0.000000; 0.000000;;
                FS10Material {
                1.000000; 1.000000; 1.000000; 1.000000;;
                0.000000; 0.000000; 0.000000;;
                64.000000;
                1.000000; 1.000000;
                1.000000;
                0;
                0;
                0;
                0; 0; 0;
                0; 0; 0.000;
                64.000000;
                "One"; "Zero";
                    BlendDiffuseByBaseAlpha  {
                    0;
                    }
                    BlendDiffuseByInverseSpecularMapAlpha  {
                    0;
                    }
                    AllowBloom  {
                    1;
                    }
                    BloomData {
                    0;
                    0;
                    }
                    SpecularBloomFloor  {
                    0.900000;
                    }
                    EmissiveData  {
                    "AdditiveNightOnly";
                    }
                    AlphaData  {
                    0;
                    0.000000;
                    "Never";
                    0;
                    1.000000;
                    }
                    EnhancedParameters  {
                    0;
                    0;
                    0;
                    0;
                    0;
                    0;
                    }
                    BaseMaterialSkin {
                    0;
                    }
                    DoubleSidedMaterial {
                    0;
                    }
                    BlendConstantSetting {
                    0;
                    }
                    ForceTextureAddressWrapSetting {
                    0;
                    }
                    ForceTextureAddressClampSetting {
                    0;
                    }
                    ZBiasValue {
                    0.000000;
                    }
                    BaseMaterialSpecular {
                    1;
                    }
                    NoSpecularBloom {
                    0;
                    }
                    EmissiveBloom {
                    0;
                    }
                    AmbientLightScale  {
                    1.000000;
                    }
                }
            }
        }
        MeshNormals {
        3;
        0.00000; 0.00000; 1.00000;,
        0.00000; 0.00000; 1.00000;,
        0.00000; 0.00000; 1.00000;;
        1;
        3; 2, 1, 0;;
        }
    }
}

and i have to past all this here:

begninning of "Frame frm_part NN i need"...
bla bla... material stuff..

...MeshTextureCoords {
14;
0.23688; 0.66237;,
0.25881; 0.66148;,
0.25893; 0.66491;,
0.25923; 0.66783;,
0.23851; 0.66789;,
0.23731; 0.66571;,
0.25828; 0.65211;,
0.28195; 0.65222;,
0.28195; 0.66049;,
0.22918; 0.66238;,
0.23296; 0.65530;,
0.22918; 0.65530;,
0.28192; 0.66791;,
0.23296; 0.65206;;
}

}


RIGHT HERE???

}
 
Thank you very much Bjoern, for sharing your knowledge with us. Very informatiive

Question: Is it possible, wise? to add this tutorial as "resource"to the FSDevelopers library? so it does not get lost inside many future discussion threads?
Tip:......... Is is possible to add pictures to your tutorial? (since they speak a thousand words and have the power to get everyone on the same page)
 
It would probably be best to put it on the Wiki if we want to access it easily.
 
I asked, but i still don't get it working :(
EDIT: indenting with autoindent in notepad++ finally i managed to do it right
 
Last edited:
Back
Top