Profile image

Working ILS In SimplePlanes!

49.3k PlaneFlightX  3.1 years ago
Auto Credit Based on Jundroo's Wasp

Working ILS

Complete Version Here

Using the power of trigonometry, a working ILS dial is possible in SimplePlanes!

It is designed so you can change where the code thinks the runway threshold is in the map. Currently it only works in Wright, runway 00. It has both localizer and glideslope

If you think you understand this, here is the code:

Wright Runway 00 Activation Parameters:

Latitude > -15522 & Latitude < -5522 & Longitude > -3981 & Longitude < 16019 & Altitude < 10072.5424

Wright Runway 00 Localizer Code:

0.1 * (clamp01(Longitude > 6019) * 10 + (80 + (clamp((atan(clamp((Latitude + 5522), -10000, 0) / (clamp((Longitude - 6019), -1763, 1763)))), -89.9999, -80))) + -clamp01(Longitude < 6019) * 10 - (80 - (clamp((atan(clamp((Latitude + 5522), -10000, 0) / (clamp((Longitude - 6019), -1763, 1763)))), 80, 90))))

Wright Runway 00 Glideslope Code:

0.5 * clamp((80 - (-1 * (clamp((atan(clamp((Latitude + 5522), -10000, 0) / (clamp((Altitude - 72.5424), -1763, 1763)))), -89.9999, -70)))), -2, 2)

Generic Activation Parameters Code:

Latitude > ThresholdLatitude - 10000 & Latitude < ThresholdLatitude & Longitude > ThresholdLongitude - 10000 & Longitude < ThresholdLongitude + 10000 & Altitude < ThresholdAltitude + 10000

Generic Glideslope Code:

0.5 * clamp((80 - (-1 * (clamp((atan(clamp((Latitude + ThresholdLatitude), -10000, 0) / (clamp((Altitude - ThresholdAltitude), -1763, 1763)))), -89.9999, -70)))), -2, 2)

Generic Localizer Code:

0.1 * (clamp01(Longitude > ThresholdLongitude) * 10 + (80 + (clamp((atan(clamp((Latitude ThresholdLatitude), -10000, 0) / (clamp((Longitude ThresholdLongitude), -1763, 1763)))), -89.9999, -80))) + -clamp01(Longitude < ThresholdLongitude) * 10 - (80 - (clamp((atan(clamp((Latitude ThresholdLatitude), -10000, 0) / (clamp((Longitude ThresholdLongitude), -1763, 1763)))), 80, 90))))

Instructions:

Replace ThresholdLongitude with the longitude of the threshold. If the value is greater than zero, subtract it. Add it if it's less than zero. For the longitudes after the two "clamp01"s, don't add or subtract. Replace ThresholdLatitude with the latitude of the threshold. If the value is greater than zero, subtract it. Add it if it's less than zero. Replace ThresholdAltitude with the altitude of the threshold.

Note

It doesn't work on runways which don't have a heading of 0. I have plans to fix this in the future.

Spotlights

General Characteristics

  • Predecessor Wasp
  • Created On Windows
  • Wingspan 39.3ft (12.0m)
  • Length 56.1ft (17.1m)
  • Height 15.6ft (4.8m)
  • Empty Weight 22,402lbs (10,161kg)
  • Loaded Weight 38,014lbs (17,243kg)

Performance

  • Power/Weight Ratio 0.913
  • Wing Loading 79.0lbs/ft2 (385.7kg/m2)
  • Wing Area 481.2ft2 (44.7m2)
  • Drag Points 2153

Parts

  • Number of Parts 241
  • Control Surfaces 10
  • Performance Cost 1,247
  • Log in to leave a comment
  • Profile image
    6,065 dabestsock

    @PlaneFlightX cool

    4 months ago
  • Profile image
    49.3k PlaneFlightX

    @dabestsock Yes

    4 months ago
  • Profile image
    6,065 dabestsock

    Has someone made one with complete one

    4 months ago
  • Profile image
    49.3k PlaneFlightX

    @UltraLight Sure, just make sure you use the finished one. I've updated the description to link to it. This one only works at wright, and the finished one works at more airports.

    2.3 years ago
  • Profile image
    38.7k UltraLight

    Can I use this on my plane -- well, project

    2.3 years ago
  • Profile image
    45.7k OPaiTaOn

    @PlaneFlightX thanks man

    2.5 years ago
  • Profile image
    49.3k PlaneFlightX

    @OPaiTaOn If you mean adjust the base throttle input, you can't. The default inputs like roll, pitch, yaw, brake, throttle, vtol, trim (and some others I forgot) can only be modified by directly connecting those to a variable (Sliders go with levers, throttles, and yokes, and activation groups go with switches and buttons). What I'd recommend is making a variable which references throttle and also can switch to taking inputs from other sources like a button.

    +1 2.5 years ago
  • Profile image
    45.7k OPaiTaOn

    Hello, can you help me with a code? I'm trying to get those buttons to raise the Throttle to 98%, but they don't work. How can I do this?

    2.5 years ago
  • Profile image
    49.3k PlaneFlightX

    @Falkenwut I know... Imagine if I finally completed my Python code that output the right code base on the heading and threshold coordinates, and then Jundroo released a new update called "Navigation".

    +3 3.1 years ago
  • Profile image
    51.5k Falkenwut

    Impressive work!! This should be something simpleplanes integraes in-game now that gauges are available

    +2 3.1 years ago
  • Profile image
    49.3k PlaneFlightX

    @MrSilverWolf That's fine, just make sure you credit.

    +1 3.1 years ago
  • Profile image

    You know what, I may steal- I mean politely take this and use it in a few builds

    +4 3.1 years ago
  • Profile image
    4,884 Mikey101234

    The Cessna and airliner bois are gonna have fun with this

    +3 3.1 years ago
  • Profile image
    49.3k PlaneFlightX

    @jamesPLANESii I'm planning on making a Python script where you input the runway threshold coordinates, specify the heading of the runway, and it spits out the code. But that will take a while.

    Also thanks for the spotlight!

    3.1 years ago
  • Profile image

    WOW

    +2 3.1 years ago
  • Profile image
    49.3k PlaneFlightX

    @klm747klm747 I know - I am going to work on Yeager (and other airports with a heading other than 0) a bit later.

    3.1 years ago
  • Profile image
    19.2k klm747klm747

    lol I made mine work on Yeager but it was a pain

    +1 3.1 years ago