spen25 Posted January 20, 2012 Report Posted January 20, 2012 Hello, I've been working on how to change indicator 1 to light up yellow and can not understand what is wrong. I have ran the included WP6test.lua and seen that is possible, but my code only lights up white. What am I doing wrong? function MasterCaution(offset, value) if logic.And(value,0x0002) ~=0 then gfd.SetColour(GFWP6,0, 1, 6) gfd.SetLight(GFWP6,0,1) else gfd.ClearLight(GFWP6,0,1) end end event.offset("9420", "UB", "MasterCaution")
Pete Dowson Posted January 20, 2012 Report Posted January 20, 2012 Hello, I've been working on how to change indicator 1 to light up yellow and can not understand what is wrong. I have ran the included WP6test.lua and seen that is possible, but my code only lights up white. What am I doing wrong? Ouch! It isn't you, it's me! There's a bug -- the indicator IDs in SetColour run from 1 whilst those in SetLight and ClearLight run from 0! You can see this by changing your SetLight to gfd.SetLight(GFWP6,0,0) I'm going to have to fix this. I'm not sure at present which one is wrong, but i've a feeling it must be "SetColour", because the SetLight and ClearLight facilities existed long before the WP6 and 'SetColour'. The convention in FSUIPC has always been to number from 0, but I must have been confused by the WP6 which numbers its indicators from 1. So, I'll change SetColour to also count from 0. I just hope it doesn't mess too many folks up! Fix will be in FSUIPC 4.761, 3.998t and Wideclient 6.92, later today. Thanks for finding this bug! [LATER] Okay, the revised versions are now available in the Download Links subforum. Regards Pete
spen25 Posted January 20, 2012 Author Report Posted January 20, 2012 Thank you, will test it out when I get home. That was going to be my next guess as I was just going to turn them all yellow and try to eliminate them one by one. Update: Works like a Charm, Thank you!
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