The download hangar is currently disabled. We're doing our best to bring it back as soon as possible.

xml again

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

xml again

Post by andras1 »

Hello again,

I am afraid this is another xml question. I have built a little piston engine aircraft to which I have attached animated tie downs etc. Thanks to Weescotty my first xml attempts went well. I attached the disappearance of the tie downs to the strobe lights which (in principle) works perfectly. However, the small planes push back without nav or stobe lights on. This means the tie downs do not disappar before the push back is finished which looks silly.

Is there any other event or command to which I can attach the disapperance of the tie downs - like battery on or so. Or is there a smatrer way of doing this?

Thanks

andras
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Post by Weescotty »

As we found out - Piston engined aircraft do not respond to Nav, Strobe or Landing lights as AI.

There are a couple more you could try but I ca'nt remember what they are......IDENT? etc
aerogator

Post by aerogator »

I'd like to know as well. Airstairs work fine when the plane is pointed out but if it has to push back, the stairs follow until the engines start. :x

Thanks, :)
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

Post by andras1 »

well there was a mistake in my first post. not the strobe but beacon. Beacon works only that it is switched on after push back...

ident?
would be grateful for some further suggestions
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Post by Weescotty »

This is all the available lights -

LIGHT STROBE
LIGHT PANEL
LIGHT LANDING
LIGHT TAXI
LIGHT BEACON
LIGHT NAV
LIGHT LOGO
LIGHT WING
LIGHT RECOGNITION
LIGHT CABIN

You could try -

<name>YOUR PART NAME</name>
<visible_in_range>
<parameter>
<code>(A: VELOCITY BODY Z, knots) 0= (A: LIGHT BEACON, bool) ! * </code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>

Should work like this -
If it isn't moving = 1
If Beacon is off = 1 (the ! turns the 0 into 1)
1 * 1 = 1 (minvalue)

If either if false (plane moving or beacon on) the result is 0 so the part shouldn't be displayed.

It might need * * instead of just the one * in the code section.
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

Post by andras1 »

thanks, I will try all the lights and then report back
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

Post by andras1 »

Hello Weescotty

thanks for the code but unfortunatley it did not work. The part did not show at all, neither when the plane was standing nor when it was moving or putting the beacon on.
Any ideas?

Thanks
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12132
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Post by Firebird »

Now I am not an expert here but Nick makes his Vinka pilot appear when the light beacon is on. If the pilot appears before push back, then the code is quite simple.
However I am still not able to get to my main puter yet! So can somebody check to see if the pilot anim meets the requirements.
Thanks.
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Re: xml again

Post by Weescotty »

Try replacing code section with (I forgot a space)-

<code>(A: VELOCITY BODY Z, knots) 0 = (A: LIGHT BEACON, bool) ! * </code>

Copy and paste it in.

If nothing, time to test variable/values being returned -
<code>(A: VELOCITY BODY Z, knots) 0 = </code>

If that works try -
<code>(A: LIGHT BEACON, bool) ! </code>

Both of the above should make the stairs visible at start, but vanish at different times.
If not let me know which one.
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

Re: xml again

Post by andras1 »

Thanks

I used all three versions of the code like this

<part>
<name>tied_downs</name>
<visible_in_range>
<parameter>
<code>(A: VELOCITY BODY Z, knots) 0 = </code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>

</part>

<part>
<name>tied_downs</name>
<visible_in_range>
<parameter>
<code>(A: LIGHT BEACON, bool) ! </code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>

</part>

and

<part>
<name>tied_downs</name>
<visible_in_range>
<parameter>
<code>(A: VELOCITY BODY Z, knots) 0 = (A: LIGHT BEACON, bool) ! * </code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>

</part>

but the tie downs did not show at all

the only code that is working is the one you gave me some time ago and goes like

<visible_in_range>
<parameter>
<code>
(A:LIGHT BEACON, bool)
</code>
</parameter>
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>

The onle problem is that the plane pushes back with the tie dons on

Any more ideas??
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Re: xml again

Post by Weescotty »

Try this

<part>
<name>tied_downs</name>
<visible_in_range>
<parameter>
<code> (A:LIGHT BEACON,number) ! </code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

Re: xml again

Post by andras1 »

Weescotty, this one works now, how can I connect it to the body speed
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Re: xml again

Post by Weescotty »

andras1 wrote:Weescotty, this one works now, how can I connect it to the body speed
Think it was adding the max value in, so try -

<code> (A:LIGHT BEACON,number) ! (A: VELOCITY BODY Z, knots) 0 = * </code>
andras1
Second Lieutenant
Second Lieutenant
Posts: 49
Joined: 08 May 2007, 20:37

Re: xml again

Post by andras1 »

Hello Weescotty,

I got it to work but somewhat different from your last suggestion.

I attached the visibility of one part to the ground speed, which made it disappear when the plane was pushing back and then made the invisibility of another part subject to the beacon being switched on. Then I made the second part parent to the first part using the hierarchy in FSDS.

It is probably not the most elegant code in the world but it seems to work. The tie downs disapper when the plane pushes back and reapper only when the beacon is switched off. Although it is is not fully your proposal, without your help I would definitely not have made it - many thanks.

Now I´ll try to do the same with the pilots only that this time they should apper when the plane pushes back - let´s see.

The next plane I want to build is a Bell twin two twelve. When they are parked their main rotor is tilted backward. Is their a way manipulate the FS2004 stock animations by using xml and if not can I replace the rotor completely by an xml animated rotor?

Thanks

Andras
Post Reply