Paja Posted April 27, 2014 Report Posted April 27, 2014 Dear Pete, I am trying to switch on and off the flight director from LUA. I am trying the ipc.writeSB(2EE0,1) command but it prevents the LUA file from running. Am I missing something? I still didnt understand properly how to work with different offsets. From the FSUIPC4 Offsets Status.pdf I see that the 2EE0 offset is long "4" but how do I know which type of offset it is? Is somewhere the lehgth - to - type conversion table? I mean even if you help me with this one, how do I know which types are other offsets I will need (alternators, antiice,...)? U understand what is the length of an offset, but when I try logging them in FS I see the result of this 2EE0 is simply 1 or 0, so I would guess it will be the easiest of all the types, hm? Pavel
Pete Dowson Posted April 27, 2014 Report Posted April 27, 2014 I am trying to switch on and off the flight director from LUA. I am trying the ipc.writeSB(2EE0,1) command but it prevents the LUA file from running. Am I missing something? Lua won't understand 2EE0. It isn't a decimal number with E's in it! You either need to precede it with 0x (so 0x2EE0) to tell it that it is a hexadecimal number,, or quote it, like "2EE0". your choice. I still didnt understand properly how to work with different offsets. From the FSUIPC4 Offsets Status.pdf I see that the 2EE0 offset is long "4" but how do I know which type of offset it is? Is somewhere the lehgth - to - type conversion table? I mean even if you help me with this one, how do I know which types are other offsets I will need (alternators, antiice,...)? U understand what is the length of an offset, but when I try logging them in FS I see the result of this 2EE0 is simply 1 or 0, so I would guess it will be the easiest of all the types, hm? 1 byte = 8 bits = byte 2 bytes = 16 bits = word 4 bytes = 32 bits = double word, or "DWORD" 8 bytes = 64 bits = quad word or "long long" Also there are two floating point formats 4 byte = 32 bit float = "float" 8 byte = 64 bit float = "double" Please see the FAQ subforum. There's a thread there about numbers. Pete
Paja Posted April 27, 2014 Author Report Posted April 27, 2014 I wish I knew the number of times I got stuck with lua because of forgetting to use "" for strings. Thank you, solved! Pavel
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now