- Messages
- 347
- Country
-
Hi All - It's been a while and things have moved on. Except for me, I'm still on FS2004.
I'm wrapping up a model and am interested in hiding elements on a random basis (either per flight or per sim session, I don't mind). I've checked the wiki for XML approaches and thought that I could hide parts by generating a random number, dividing it by 2 and multiplying it by 2 - and if the result is the same, the number was even, otherwise odd. That gives me a binary random number and makes my choice for me. Obviously this calculation would not be continually evaluated and would need to be tied either to the AI spawning, or the aircraft coming out of sleep (for a per-flight hiding). It would also I assume use L-vars to avoid affecting AI based on the same model. It's ten years since I last did this XML stuff.
Which leads me also to a more specific query about AI traffic state from the SDK. The only one I can find online is on the P3D site, but the variables seem familiar and I assume are available in FS9 as they're shown below (without things like preflight and postflight support). If hiding the crew when the a/c is asleep, it seems that I would need to check for the strings "sleep" and "Sleep" capitalized so that it appears the same at all airports. I assume that "sleep" under ATC control actually means the aircraft is sleeping at a towered airport and not at an airport without ATC.
It also looks as though "init" is nothing to do with the aircraft spawning, which I had hoped, since init isn't an option for AI outside ATC control.
I'm wrapping up a model and am interested in hiding elements on a random basis (either per flight or per sim session, I don't mind). I've checked the wiki for XML approaches and thought that I could hide parts by generating a random number, dividing it by 2 and multiplying it by 2 - and if the result is the same, the number was even, otherwise odd. That gives me a binary random number and makes my choice for me. Obviously this calculation would not be continually evaluated and would need to be tied either to the AI spawning, or the aircraft coming out of sleep (for a per-flight hiding). It would also I assume use L-vars to avoid affecting AI based on the same model. It's ten years since I last did this XML stuff.
Which leads me also to a more specific query about AI traffic state from the SDK. The only one I can find online is on the P3D site, but the variables seem familiar and I assume are available in FS9 as they're shown below (without things like preflight and postflight support). If hiding the crew when the a/c is asleep, it seems that I would need to check for the strings "sleep" and "Sleep" capitalized so that it appears the same at all airports. I assume that "sleep" under ATC control actually means the aircraft is sleeping at a towered airport and not at an airport without ATC.
It also looks as though "init" is nothing to do with the aircraft spawning, which I had hoped, since init isn't an option for AI outside ATC control.
AI TRAFFIC STATE | English string describing an AI object's state. If the object is an aircraft under ATC control the string will be one of: "init" "sleep" "flt plan" "startup" "preflight support" "clearance" "push back 1" "push back 2" "pre taxi out" "taxi out" "takeoff 1" "takeoff 2" "T&G depart" "enroute" "pattern" "landing" "rollout" "go around" "taxi in" "shutdown" "postflight support" If the AI object is not an aircraft under ATC control, the string is one of: "Sleep" "Waypoint" "Takeoff" "Landing" "Taxi" This string also appears in the State column of the Traffic Explorer tool dialog. See Note 1. |
Last edited: