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

Coding temporary parts

Thanks for those Tom.

Bill/Tom, could I push my luck with a supplemntary question please? The xml code that I have used in the last few days for the temporary parts on my AI Hunter has worked wonderfully well:

Parked - with GSE, canopy slid back and no pilot:

with.jpg


Ready to go - GSE gone, pilot in place, canopy slid closed:

without.jpg


The refinement I'd like to add is a moving pilot head. I know how to animate that with tick18 (FS9), but what do I call the part please if two names need to be recognised - tick18 (for the animation) and AI_pilot (for the visibility)?

John
 
Revelation of the blinding obvious while out this afternoon. Just needed to link the head (tick18_head) to the body (AI_piot). Works fine.

John
 
Revelation of the blinding obvious while out this afternoon. Just needed to link the head (tick18_head) to the body (AI_piot). Works fine.

John

You just gotta love those "ah ha!" moments...
 
Bill or Tom, could I possibly ask for 1 more please?

I'd like to be able to add a drag chute to an AI jet. I have seen code in another thread that triggers the chute by use of the parking brake or tail hook in a flyable aircraft, but obviously that won't work for an AI aircraft. The trigger needs to be related to speed on the runway and another variable, perhaps flaps. That might then prevent the deployment of the chute on take-off (flaps not used) but deploy it on landing. I am looking for the script for FS9and FSX please.

John
 
Most people use the spoiler. When the spoiler is deployed, also deploy the drag chute. Just use the spoiler variable for the animation and it should work OK.

Hope this helps,
 
Thanks Tom,

I have not set up spoilers before but assume that I don't need to model them physically, but just put the relevant text in the aircraft.cfg file. From what I can determine that amounts I think to these 5 lines added to the AIRPLANE GEOMETRY section:

spoiler_limit = 60.0 //Degrees
spoilerons_available = 1 //Spoilerons Available?
aileron_to_spoileron_gain = 4.6 //Aileron to spoileron gain
min_ailerons_for_spoilerons = 5 //Degrees
min_flaps_for_spoilerons= 0.0

Having done that, I assume the XML script (for FS9) is something like:

<part>
<name>Chute</name>
<visible_in_range>
<parameter>
<code>
(A:l_spoiler,bool)
</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>

Are my assumptions correct please? I am not sure about the part name for the spoiler in line 6 of the script.
 
That will get your drag chute to suddenly appear and disappear, but you could also animate it using the spoiler variable (with (for example) 100 keyframes) and then it would deploy and "retract" (I know, not realistic...). Some fancy code might make it deploy and then disappear, but I'm not sure how to code that (perhaps allow the animation when the spoiler variable is increasing, but make it disappear when the variable is decreasing?).

I don't think you want to activate spoilerons - that might cause the drag chute to pop out every time FS banked the AI plane...

Hope this helps,
 
Last edited:
If you set this properly, the chute will only appear whenever the spoilers are fully extended:

<minvalue>100</minvalue>

or, some range of spoilers:

<minvalue>90</minvalue>
<maxvalue>100</maxvalue>

The possibilities are manifold!
 
Thanks for the code but it didn't work unfortunately. The chute (actually a trial cube) just remained visible at all times. This is the script I used:

<name>Chute</name>
<visible_in_range>
<parameter>
<code>
(A:SPOILERS LEFT POSITION,percent) 0 &gt;
</code>
</parameter>
<minvalue>100</minvalue>
</visible_in_range>
</part>

I am not clear whether it is the script that's wrong or whether something needs to be written into the aircraft.cfg file for spoilers. I didn't have a beacon light in the .cfg for the parked parts script, so perhaps that's not the problem. I did however change auto_spoiler_available=0 to 1, but that made no difference.

John
 
Hi,

Section 327 of the AIR file may have to be set to TRUE (Spoiler Available)?

Hope this helps,
 
Is this FSX? If so, there may be something else required than just to name the part Chute? I work in FS9 so I don't know...
 
Thanks Tom. I am after the facility for both FS9 and FSX but I thought it best to concentrate on FS9 first.

The block of script above was tested in FS9 with "Chute" as the part name. That resulted in the chute being permanently attached to the aircraft. I did however also try it in FSX a few minutes ago with the new "Chute" visibility tag applied from the added script. In that case, the chute did not appear at all at any time.

I have confirmed that section 327 of the .air file is set to "1".

Not sure where to go from here.
 
Try putting the code /code all on one line?

BTW, you can speed up testing by loading the plane in FS as a flyable aircraft and then trying the spoiler using the / key.
 
And try changing the part name - I've found some that FS didn't like, for some unknown reason.
 
I changed the part name to Drag_Chute. By putting the code on one line did you mean like this (with indents):

<part>
<name>Drag_Chute</name>
<visible_in_range>
<parameter>
<code>(A:SPOILERS LEFT POSITION,percent) 0 &gt;</code>
<minvalue>100</minvalue>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part

Whether I put the code/code on one line or not and whether I include the minvalue or not, the end result is the same. The drag chute appears with the aircraft parked and stays with it for the AI flight.

Is it possible that you could test that script for me please with a simple cube to represent a drag chute behind one of your models? It would only take a few minutes I think if you have the time. If it works for you it would tell me that the aircraft.cfg file or .air file might need attention.
 
Back
Top