Sign in to follow this  
pve

XML Increasing number switch

Recommended Posts

Hi all I want to set up a switch for number increase ie: (current number) (current number increases by one gives bool 1 then (new current number) (new current number increases by one gives bool 1 etc. with no limit Tried a few things but can't get the reset to the next higher number Can anyone help

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi PVE,Not sure, if you're talking about XML or C. In XML you can do it on this way:(L:Whatyouwant, number) 1 + (>L:Whatyouwant, number)Best RegardsMatthias

Share this post


Link to post
Share on other sites

Hi Matthias I am counting each flightplan Wpt passage number with (L:wpt_pass, number) gives 1-2-3-4 etc. I want to trigger 1 bool at each number increment to update the ATA fuel, distance, etc. I have it working OK with (A:GPS IS ACTIVE WAY POINT, bool) (A:GPS WP DISTANCE, nmiles) 3 < if { But the mileage number includes altitude and the trigger point does not match the GPS change point. Regards

Share this post


Link to post
Share on other sites

Hi,I think there is a GPS variable that stores the number of waypoints left in the flight plan. Maybe (@c:FlightPlanWaypointsNumber) but I'm not sure. If you save its value at a/c startup, and then compares it with the last registered value, you should obtain something similar to a "Wpt passage number", but more accurate than the "distance less than 3 miles" solution. Just by saving the previous number and comparing with the new one like:(L:PrevFPIndex,number) (L:CurrentFPindex,number) != (>L:Flag, bool)should give what you're looking for.Tom

Share this post


Link to post
Share on other sites

Hi,Why not use the GPS codes to show a flightplan with everything you want from it?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi Tom (@c:FlightPlanWaypointsNumber) gives total of waypoints. Does not change on Wpt passage. I Tried (@c:FlightPlanWaypointsNumber)(L:WPt,number) "counts up from first waypoint" != (>L:Flag, bool) just gives 1 Paul

Share this post


Link to post
Share on other sites

Jan I am building a simple HA! FMC using only FS9 and FSgps info. The more I add to it the more difficult it becomes. I am now reaching the limit of my skills but with some help I think I can add few more things.

Share this post


Link to post
Share on other sites

Hi,Made this one just for fun, it triggers a piece of music at waypointpassage.(A:GPS DRIVES NAV1,bool) if{ @FPLLineIndex (>L:waypointA,number) (@c:FlightPlanWaypointRemainingDistance,nmiles) 3 < if{ (P:Absolute time,seconds) 2 + (>L:fptimer,number) } (P:Absolute time,seconds) (L:fptimer,number) > if{ @FPLLineIndex (>L:waypointB,number) } (L:waypoint A,number) (L:waypointB,number) != if{ 1 (>L:BACH,number) (L:waypointB,number) 1 + (>L:waypointB,number) } } Of course you can do something else instead of making music.Hope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan Your FMC Looks nice, I tried your code but not working I don't see the macro @FPLLineIndex anywhere is it yours.Paul

Share this post


Link to post
Share on other sites

Paul,The macro is an existing one and will only work in the MS-GPS!Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan Found the macro, closed the space between the A, changed (@c:FlightPlanWaypointRemainingDistance,nmiles) for (A:GPS WP DISTANCE, nmiles) and now get a 1 spot on time but it does not reset to 0. Nearly there. Paul

Share this post


Link to post
Share on other sites

OK I got it Not sure if it's best way but it works. (A:GPS DRIVES NAV1,bool) if{ @FPLLineIndex (>L:waypointA,number) (A:GPS WP DISTANCE, nmiles) 3 < if{ (P:Absolute time,seconds) 2 + (>L:fptimer,number) } (P:Absolute time,seconds) (L:fptimer,number) > if{ @FPLLineIndex (>L:waypointB,number) } (L:waypointA,number) (L:waypointB,number) != if{ 1 (>L:BACH,enum) (L:waypointB,number) 1 + (>L:waypointB,number) } } (A:GPS WP DISTANCE, nmiles) 5 < (L:BACH,enum) 1 == && if{ (P:Absolute time,seconds) 4 + (>L:fptimer,number) } (P:Absolute time,seconds) (L:fptimer,number) > if{ (L:BACH,enum) 0 (>L:BACH,enum) }

Share this post


Link to post
Share on other sites

May be this works too:(A:GPS DRIVES NAV1,bool) if{ @FPLLineIndex (>L:waypointA,number) (A:GPS WP DISTANCE, nmiles) 3 < if{ (P:Absolute time,seconds) 2 + (>L:fptimer,number) } (P:Absolute time,seconds) (L:fptimer,number) > if{ @FPLLineIndex (>L:waypointB,number) } (L:waypointA,number) (L:waypointB,number) != if{ 1 (>L:BACH,enum) (L:waypointB,number) 1 + (>L:waypointB,number) } els{ 0 (>L:BACH,enum) } } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this