• 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.

P3D v4 How to create a new keybind for a new animation? (3ds Max -> P3D)

Messages
31
Country
sweden
Hi,

How do I test a new animation that I've created in an aircraft exported from 3ds Max?

For example if I've created the animation "thrust_reversor"
Code:
<Animation name="thrust_reversor" guid="9d252b38-ba56-491c-97ac-eb97f37b0ea2" length="100" type="Sim" typeParam2="thrust_reversor" typeParam="AutoPlay" />

(I re-used the EXIT DOOR PartInfo)
Code:
    <PartInfo>
        <Name>thrust_reversor</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>EXIT OPEN:0</Variable>
                    <Units>percent</Units>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>


1)
How do I connect this with a keybind within P3D?

2)
What to use for CODE or can I create my own VARIABLE like in the "EXIT OPEN:0" above?


(No I do not want to use the built in thrust rev)


Also, how do you create GUIDS? Is this a valid site? https://www.guidgenerator.com/online-guid-generator.aspx

Thanks!
 
Last edited:
Messages
913
Country
indonesia
1)
How do I connect this with a keybind within P3D?

2)
What to use for CODE or can I create my own VARIABLE like in the "EXIT OPEN:0" above?

1. use Event IDs (read SDK documentation, in variable section for P3D )
2. own variable commonly use term "Lvars", Local Variable (as SDK state). in modeldef.xml, Lvars use code with L: followed by name of Lvars and unit.

stock sample
Code:
  <PartInfo>
    <Name>switch_master_arm</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:switch_master_arm,number) 50 *
        </Code>
        <Lag>400</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle</MouseFlags>
      <CallbackCode>
        (L:switch_master_arm) ! (&gt;L:switch_master_arm)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
Messages
31
Country
sweden
1. use Event IDs (read SDK documentation, in variable section for P3D )
2. own variable commonly use term "Lvars", Local Variable (as SDK state). in modeldef.xml, Lvars use code with L: followed by name of Lvars and unit.

stock sample
Code:
  <PartInfo>
    <Name>switch_master_arm</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:switch_master_arm,number) 50 *
        </Code>
        <Lag>400</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle</MouseFlags>
      <CallbackCode>
        (L:switch_master_arm) ! (&gt;L:switch_master_arm)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

1)
Awesome, thanks!
(http://www.prepar3d.com/SDKv4/sdk/references/variables/event_ids.html)

2)
I'm really not good with code and I cant seem to figure it out. Could you please dumb it down for me.

I want to test a toggle animation how should it look? I'm using the "TOGGLE_WING_FOLD" EventID (Keybind T i believe).

3)
Do I need to re-create animations on the aircraft after changing them within modeldef.xml or is a simple re-export sufficient?



The P3D SDK includes a GUID generator.
Thanks, I found it in the SDK root folder. I'll be using that one from now on.
 
Messages
913
Country
indonesia
2)
I'm really not good with code and I cant seem to figure it out. Could you please dumb it down for me.

I want to test a toggle animation how should it look? I'm using the "TOGGLE_WING_FOLD" EventID (Keybind T i believe).

3)
Do I need to re-create animations on the aircraft after changing them within modeldef.xml or is a simple re-export sufficient?

this stock code of wing fold lever:
XML:
  <PartInfo>
    <Name>lever_toggle_wing_fold</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:FOLDING WING LEFT PERCENT, percent)
        </Code>
        <Lag>400</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle</MouseFlags>
      <TooltipID>TOOLTIPTEXT_FOLDING_WING_HANDLE</TooltipID>
      <CallbackCode>
        (&gt;K:TOGGLE_WING_FOLD)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

you can use stock modeldef.xml. there so many sample over modeldef. you can compare one to another to make you understand.
if needed you can modify the code (remember to make back up original code first).
you can re-create code as you wish as learning process and you should do yourself. ask here if you already done many option you have but still dead end.
 
Messages
31
Country
sweden
I tried that before as well; to copy paste the entire wing fold part info and GUID and use that but it still wont work.

If I add the animations to doors open/close (Shift+E) they work so there's nothing wrong with the animations.
 

Paul Domingue

Resource contributor
Messages
1,530
Country
us-california
Did you also copy the animation name header? it needs to be included as well as the code @kalong posted.
Code:
<Animation name="lever_toggle_wing_fold" guid="B58FCD14-056C-41a2-BB27-456C52BC8FBE"length="100" type="Sim" typeParam2="lever_toggle_wing_fold" typeParam="AutoPlay" />
 
Messages
31
Country
sweden
Did you also copy the animation name header? it needs to be included as well as the code @kalong posted.
Code:
<Animation name="lever_toggle_wing_fold" guid="B58FCD14-056C-41a2-BB27-456C52BC8FBE"length="100" type="Sim" typeParam2="lever_toggle_wing_fold" typeParam="AutoPlay" />
Yes.

Do I need to update or change something in the aircraft.cfg?
 
Messages
31
Country
sweden
yes, like this:
Code:
[folding_wings]
wing_fold_system_type = 3
fold_rates = 0.05, 0.05
Awesome, thank you kalong!

I can get the "wing_fold_l_pct" to work but can I change the animation name?

I used:

Code:
<Animation name="wing_fold_l_pct" guid="2C79D434-1318-44ea-A6A1-DEAE474EEE07" length="100" type="Sim" typeParam2="wing_fold_l_pct" typeParam="AutoPlay" />

Code:
<PartInfo>
        <Name>wing_fold_l_pct</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>FOLDING WING LEFT PERCENT:1</Variable>
                    <Units>percent</Units>
                </Sim>
            </Parameter>
        </Animation>
  </PartInfo>



Instead of:

Code:
<Animation name="lever_toggle_wing_fold" guid="B58FCD14-056C-41a2-BB27-456C52BC8FBE" length="100" type="Sim" typeParam2="lever_toggle_wing_fold" typeParam="AutoPlay" />

Code:
<PartInfo>
     
    <Name>lever_toggle_wing_fold</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>FOLDING WING LEFT PERCENT:1</Variable>
                    <Units>percent</Units>
                </Sim>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <EventID>TOGGLE_WING_FOLD</EventID>
        </MouseRect>
    </PartInfo>


BUT can't I change the name of the Animation?
If I keep everything and only changes the name it wont work anymore. (I've changed it in both <Animation and <PartInfo)
 
Messages
913
Country
indonesia
yes, you can change "name", both in <PartInfo> and <Animation>. the name must identical
remember to use different GUID for each animation that used at same aircraft.
 
Messages
31
Country
sweden
yes, you can change "name", both in <PartInfo> and <Animation>. the name must identical
remember to use different GUID for each animation that used at same aircraft.
If I simply use the "wing_fold_l_pct" it works but if I change all the "wing_fold_l_pct" to "thrust_reversor" (using the same GUID, and only have that animation applied to the model) it wont work..
I change it in the "<Animation", "<AnimationRef" and "<PartInfo>".
 
Messages
913
Country
indonesia
<Animation> have 2 identical name (must): name and typeParam2

sample, look at 3 identical naming as any_name in the code
XML:
<Animation name="any_name"    guid="378BCEF0-0D9A-44bc-98D5-B3995B59C694" length="100" type="Sim"  typeParam2="any_name" typeParam="AutoPlay" />

    <PartInfo>
        <Name>any_name</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                    <!-- Put Code here -->
                </Code>
            </Parameter>
        </Animation>
    </PartInfo>
 
Messages
31
Country
sweden
Exactly, that's how I changed it.

(I'm using Sublime Text so I can CTRL+D to select everything with the exact same name and change everything at the same time, so I know that I didn't make any typos)


Maybe I can use the default naming since I can't change it. It doesn't really make much difference except to keep it clean and easy for me if I could rename as I saw fit.
 
Messages
913
Country
indonesia
after change name, do you re-attach model animation to use new name?
 
Last edited:
Messages
31
Country
sweden
after change name, do you re-attach model animation to use new name?
I've always re-imported the model and done everything(browse for custom modeldef.xml, tag animations, ) all over again to make sure I start of clean.

I'm gonna let this rest for a while and continue with the unwrap and texturing of the model and then come back to the animations and export in a couple of weeks.

Thank you very much for your help and patience so far kalong!
 
Messages
31
Country
sweden
And I'm back again, still with the same problem.

I can't get the custom animations to work, except for the


Now I'm trying to use the "water_rudder_key" but it wont work. I've even downloaded a free float plane to test CTRL+W which worked on that model, but not on mine.
I can't see any special lines added within the aircraft.cfg for the water rudder on the float plane.
What I'm trying with (default):

Code:
    <Animation name="l_water_rudder_key" guid="CE0B48AA-EB61-4afc-A59C-3612D27E9F53" type="Sim" typeParam2="l_water_rudder_key" typeParam="AutoPlay" />

Code:
<PartInfo>
        <Name>l_water_rudder_key</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>WATER LEFT RUDDER EXTENDED</Variable>
                    <Units>keyframe</Units>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>
 
Messages
31
Country
sweden
<Animation> have 2 identical name (must): name and typeParam2

sample, look at 3 identical naming as any_name in the code
XML:
<Animation name="any_name"    guid="378BCEF0-0D9A-44bc-98D5-B3995B59C694" length="100" type="Sim"  typeParam2="any_name" typeParam="AutoPlay" />

    <PartInfo>
        <Name>any_name</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                    <!-- Put Code here -->
                </Code>
            </Parameter>
        </Animation>
    </PartInfo>
For someone who really does not know how to code. Is there a universal code I can use to toggle/run an animation when I press the button related to the animation?
 
Messages
913
Country
indonesia
actually each code are specific. by general the code you quote above.

for press button (or some other command) you can add
Code:
<MouseRect>

</MouseRect>

inside <PartInfo>

find out more sample in stock modeldef.xml in SDK.
 
Messages
31
Country
sweden
Is there a way to execute an animation when I select Engine 2?

The airplane is set up as E+1 = Engine 1 which drives it forward. E+2 = Engine 2 which works as a thrust reverser and drives it backwards. I want to run an animation when Engine 2 is selected.
 
Top