The website and forum will be intermittently unavailable while we're making some security updates.
File uploads to the download hangar are also disabled until further notice.

AI KC-30A

Discussion, tutorials,hints and tips relating to designing military ai aircraft.
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Hang in there, we'll see if one of the other guys knows a better code to use.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12113
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: AI KC-30A

Post by Firebird »

OK, now I may be throwing some confusion in here, if so tell me to shut up, but I had a look at Nick's makemdl in particular at his apache flir.
he actually has two entries :-

Code: Select all

<part>
<name>apache_flir</name>
<visible_in_range>
<parameter>
<code>
(A:LIGHT NAV,number)
</code>
</parameter> 
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>
</part>

<part>
<name>apache_flir</name>
<visible_in_range>
<parameter>
<code>
(A:LIGHT NAV,number)
</code>
</parameter> 
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>
Which seems to indicate that you need to entries, one to determine when the anim is on and one when the other is on. Now obviously there must be a way in FSDS that you determine which conditional part is on and which is off.
Does this ring any bells with anybody?
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Not me (but I've already said I know nothing about xml)!
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12113
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: AI KC-30A

Post by Firebird »

Rob, I am the opposite, a little bit about XML and naff all about modeling. :D
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

But in that example code the condition is based off of the nav light. We don't want that in this case, we want it based off of a variable condition (velocity) instead of a boolean condition (off=0, on=1).

I'm trying to get a code that displays the static prop any time the z body velocity is less than 35 knots. My thinking is that we get that code working for that part. Then all we have to do is reverse the code for the spinning part version.

So IOW, master the first part, THEN we'll worry about the second bit.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Firebird
MAIW Admin
MAIW Admin
Posts: 12113
Joined: 11 Aug 2006, 21:04
Version: FS9
Location: EGLL

Re: AI KC-30A

Post by Firebird »

Yep, completely understand everything you said.
What I was wondering is if its a conditional part that you need to define entries for both conditional parts. However, as a non-modeler I am happy to keep quiet about things that I know nothing about. :)
Steve
_______________________________________________________
Image
Quid Si Coelum Ruat
_______________________________________________________
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Ahh, gotcha. Yea you may be right about that.

Rob if you want, we can at least get you a working XML code for preflight items like chocks, engine covers, etc. If we can get you to try that out and get that working, we'll at least know that you are compiling the model correctly.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Yeah, no worries. I'll do some chocks for it first.
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Ok Rob, I KNOW this one works. :D It was the first one that I ever got to work.

This is a conditional visibility code for anything that you want to be visible when the selected light source is NOT ON. In this example, the part "Your_Part" would be the parent part of all the rest of the preflight stuff. Just use this code once, for one part and make all the other preflight bits, child parts of the primary. This code uses the beacon but you can use anything you want to. I later changed this to make use of the nav lights. The difference is that using the nav lights will make the parts disappear, up to 15 minutes prior to departure and they won't show back up until 15 minutes after the AI parks. If you use LIGHT BEACON, the parts will be visible any time the beacon is not on, which would be any time the engines are not on. If you want to use the nav lights as the trigger, just change the "LIGHT BEACON" part to "LIGHT NAV".

<part>
<name>Your_Part</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT BEACON,number)</code>
</parameter>
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>
</part>

If you want me to explain the logic behind this code so you know what it's doing, just say so.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Dark Morelia
Captain
Captain
Posts: 248
Joined: 15 Feb 2007, 04:02
Version: FS9
Location: Hervey Bay, Australia
Contact:

Re: AI KC-30A

Post by Dark Morelia »

Steve - I can't see any way that code would work, it's just two entries for the same part name. As far as I know MakeMDL will just ignore the second one.
You'd need two differently named parts in the model linked to two differently named <part> entries in order for it to work.

For starters though Rob, just try linking something highly visible to this code, compile your model with the code in place in the xml file, load 'er up as UI, and hit the L key a few times to see if it works.

Code: Select all

<part>    
<name>test_box</name>    
<visible_in_range>    
<parameter>    
<code>
(A:LIGHT NAV, bool) !
</code>  
</parameter>
<minvalue>1</minvalue>  
</visible_in_range>  
</part>
(I use a giant red cube sitting just above the aircraft for testing xml)

EDIT: Mike beat me to it, that's what I get for leaving the reply window open while I get a drink :lol:
Drew >>

Image
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

LOL! Yea but it does show the two different ways to do the same thing. You used a code with the "bool" code. I used "number", either one will work Rob.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

Okay, the first one worked. The part becomes visible just as the aircraft starts to move forward. Now comes the tricky bit...
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

You mean the z body velocity one??
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

This one:

<part>
<name>Refuelling_pod_turbine</name>
<visible_in_range>
<parameter>
<code>(A:LIGHT BEACON, bool)</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>
User avatar
nickblack423
MAIW Veteran
MAIW Veteran
Posts: 2155
Joined: 11 Aug 2006, 21:43
Version: FS9
Location: Ipswich, UK
Contact:

Re: AI KC-30A

Post by nickblack423 »

Sorry I've missed this one guys. Below is the code I have implemented for the Growler and Super Hornet Buddy refueller.

<part>
<name>tank_motor</name>
<visible_in_range>
<parameter>
<code>
(A:VELOCITY BODY Z, knots) 90 > </code>
</parameter>
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>
</part>

<part>
<name>tank_motor</name>
<visible_in_range>
<parameter>
<code>
(A:VELOCITY BODY Z, knots) 90 > </code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>

<part>
<name>tick18_tank_motor</name>
<visible_in_range>
<parameter>
<code>
(A:VELOCITY BODY Z, knots) 90 > </code>
</parameter>
<minvalue>1</minvalue>
<maxvalue>1</maxvalue>
</visible_in_range>
</part>

<part>
<name>tick18_tank_motor</name>
<visible_in_range>
<parameter>
<code>
(A:VELOCITY BODY Z, knots) 90 > </code>
</parameter>
<minvalue>-1</minvalue>
<maxvalue>0</maxvalue>
</visible_in_range>
</part>

This will have the part look like it is not moving when below 90 knots and then come to life and spin above that.

Nick
"Pain Heals......Chicks Dig Scars.....Glory, Lasts Forever!!!"
Image
Image
User avatar
Bell 209
First Lieutenant
First Lieutenant
Posts: 101
Joined: 27 Aug 2006, 11:32
Version: FSX
Location: Nambour, QLD, Australia

Re: AI KC-30A

Post by Bell 209 »

You legend! Thanks, Nick!
So do I term the static part "Tank_Motor" and the moving one "Tick18_Tank_Motor"?
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: AI KC-30A

Post by MIKE JG »

Rob, Nick's code is assuming that you are using Tick18 animation for your spinning prop. If that's the case, then that part, the spinning one, must start with "Tick18" per the standard FS2004 naming conventions. You can use whatever names you want to as those part names he has used (to my knowledge) are not recognized by MakeMDL. They are just what he used in this example.

You should be able to swap in your part name for the static bit, then "Tick18_........" whatever for your other part name and change the 90 to whatever speed value you want to and that should work.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
nickblack423
MAIW Veteran
MAIW Veteran
Posts: 2155
Joined: 11 Aug 2006, 21:43
Version: FS9
Location: Ipswich, UK
Contact:

Re: AI KC-30A

Post by nickblack423 »

Thats right Rob and Mike thanks for that. Just animate the Tick18 part to have a keyframe at each 90 degrees and then it will spin. Use a bit of trial and error to get the speed right but I used 0, 5, 10 and 15 and it worked fine.

Nick
"Pain Heals......Chicks Dig Scars.....Glory, Lasts Forever!!!"
Image
Image
User avatar
Dark Morelia
Captain
Captain
Posts: 248
Joined: 15 Feb 2007, 04:02
Version: FS9
Location: Hervey Bay, Australia
Contact:

Re: AI KC-30A

Post by Dark Morelia »

Now I'm the confused one :lol: ... why two entries for each part? you only need one :|
Drew >>

Image
User avatar
nickblack423
MAIW Veteran
MAIW Veteran
Posts: 2155
Joined: 11 Aug 2006, 21:43
Version: FS9
Location: Ipswich, UK
Contact:

Re: AI KC-30A

Post by nickblack423 »

If you are wanting a part to animate on a Tick18 part then yes. But if you want a Tick18 part that will only show when the aircraft is in flight or over a certain speed or altitude etc then you need to have conditionally appearing parts as per the code above. Part "tank_motor" will only show below 90kts and part "Tick18_tank_motor" will show and animate above 90kts.
Much the same as "Prop" models. To animate props with the normal FS animation you need 3 parts for each one. "Prop_still", "Prop_Slow" and "Prop_Blurred"

Nick
"Pain Heals......Chicks Dig Scars.....Glory, Lasts Forever!!!"
Image
Image
Post Reply