Jump to content
The simFlight Network Forums

jd

Members
  • Posts

    82
  • Joined

  • Last visited

Posts posted by jd

  1. here are two functions, one to read the pause state, the other to set it

    Public Function pause() As Boolean ' 0 if not, 1 if retractable

    Dim x As Integer

    Dim dwResult As Long

    Call FSUIPC_Read(&H264, 2, VarPtr(x), dwResult) 'updated 12/12/2002 per peter dowson

    Call FSUIPC_Process(dwResult)

    If x = 1 Then

    pause = True

    Else

    pause = False

    End If

    End Function

    Public Function set_pause(pause As Boolean) As Boolean

    Dim x As Integer

    Dim dwResult As Long

    If pause Then

    x = 1

    Else

    x = 0

    End If

    Call FSUIPC_Write(&H262, 2, VarPtr(x), dwResult)

    Call FSUIPC_Process(dwResult)

    End Function

  2. the last time i tried was back in fs2000 and fs2002. there was something screwy. it seemed to be a factor of how much "altitude" the landing gear gave the plane, maybe a little barometric pressure. just when i had it working on my lear, i'd switch to the 737 and it was a bouncing betty.

    i gave up. i just told the user to place their plane at the departure airport before starting radar contact :-)

    jd

  3. i use

    Public Function set_Plane_Lat(lat As Single) As Single ' Planes latitude

    Dim x As Long

    Dim dwResult As Long

    x = lat * 10001750 / 90

    Call FSUIPC_Write(&H564, 4, VarPtr(x), dwResult)

    Call FSUIPC_Process(dwResult)

    End Function

    Public Function set_Plane_lon(lon As Single) As Single ' Plane's longitude

    Dim x As Long

    Dim dwResult As Long

    x = lon * 65536 * 65536 / 360

    Call FSUIPC_Write(&H56C, 4, VarPtr(x), dwResult)

    Call FSUIPC_Process(dwResult)

    End Function

    let me know if you figure out how to make the plane sit nicely on the ground, and not bounce up and down

    jd

  4. this is what i use

    Public Function fix_to_fix_distance(lat1 As Single, lon1 As Single, lat2 As Single, lon2 As Single) As Single

    Dim pi As Double

    Dim degtorad As Double

    Dim latx1 As Double

    Dim latx2 As Double

    Dim lonx1 As Double

    Dim lonx2 As Double

    pi = 3.1415926535

    degtorad = (pi / 180)

    latx1 = lat1 * degtorad

    latx2 = lat2 * degtorad

    lonx1 = -lon1 * degtorad

    lonx2 = -lon2 * degtorad

    fix_to_fix_distance = ArcCos((Sin(latx1) * Sin(latx2)) + (Cos(latx1) * Cos(latx2) * Cos(lonx1 - lonx2)))

    fix_to_fix_distance = fix_to_fix_distance * 180 * 60 / pi

    End Function

  5. this will set the keys. it assumes that keys you want to set are in key_codes(i) and that the corresponding offsets are put into key_offsets(i)

    Public Function set_keycodes()

    Dim x As Long

    Dim i As Long

    Dim k As Long

    Dim dwResult As Long

    Dim j As Long

    Call FSUIPC_Read(&H320C, 4, VarPtr(x), dwResult)

    Call FSUIPC_Process(dwResult)

    If x = 56 Then

    i = 1

    For k = &H3210 To &H32F8 Step &H4

    Call FSUIPC_Read(k, 4, VarPtr(j), dwResult)

    Call FSUIPC_Process(dwResult)

    If j = key_codes(i) Then 'can we find our hot key

    key_offsets(i) = k

    i = i + 1

    ElseIf j = 0 And i <= 28 Then 'can't find it, find an empty slot and write it out

    Call FSUIPC_Write(k, 4, VarPtr(key_codes(i)), dwResult)

    Call FSUIPC_Process(dwResult)

    key_offsets(i) = k

    If debug_flag Then Debug.Print i, key_offsets(i), key_codes(i)

    i = i + 1

    End If

    If i > 28 Then Exit For 'done entering hot keys

    Next k

    End If

    End Function

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.