help with xml coding

Discussion, tutorials,hints and tips relating to designing military ai aircraft.
Post Reply
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

help with xml coding

Post by andras1 »

after a long time I managed to build my first ai planes. Now, I am trying to add some xml animations but do not even know where to begin. I would like to add pilots when the beacon goes on and pitot covers that disappear. I would really need an idiot´s guide to xml coding.

I am using FSDS 3.5.1 - can anybody help?

Many thanks

Andras
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2787
Joined: 11 Aug 2006, 22:15
Version: P3D
Location: Sydney

Post by Weescotty »

Here is the standard XML code for making things appear / dissappear -

<part>
<name>PARTNAME</name>
<visible_in_range>
<parameter>
<code>
WHAT BUILT IN CODE TO USE FOR APPEAR / DISSAPPEAR VALUE
</code>
</parameter>
<minvalue>A VALUE</minvalue>
<maxvalue>A VALUE</maxvalue>
</visible_in_range>
</part>

So for a part to appear when Nav Lights come on -

<part>
<name>anim_pilot</name>
<visible_in_range>
<parameter>
<code>
(A:LIGHT NAV, bool)
</code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>

Min and max values are 1 (True) because you only want the part to show when the Nav lights come on.
This is determined by - (A:LIGHT NAV, bool), if the nav lights are on the value is True. (same as 1).
If you set the <minvalue> to 0 the part would be visible all the time.

Tip - Create a poly (triangle), set it to a heirachical part.
Make all the parts you want to appear childs of it, then use the polys name in the XML. Anything connected to it dissappears when it dissappears.

Two SDK's the Panel and Makemodel ones have a lot of info in them.

Kev

Oops, to make things dissappear - same code but set minvalue to -1, maxvalue to 0. i.e. only show part when lights are off.
When lights are on (A:LIGHT NAV, bool) = True = 1, parts dissappear because neither minvalue (-1) or maxvalue (0) are true.
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

Post by andras1 »

Thanks,

this is still way beyond me but it is a beginning. I´ll try to read the sdk and see whether I can make any sense of it.

Andras
Post Reply