vpil0t Posted July 30, 2013 Report Posted July 30, 2013 (edited) Hello, I'm scratching my head around a problem I haven't been able to solve for a long time. I'm trying to access some CRJ datarefs, namely the Vspeeds of the plane, as set by the pilot prior to take-off. Philipp has published this in his CRJ Datarefs listing :// VALUES#define CRJ_SPD_V1_VAL "CRJ/spd/v1_value"#define CRJ_SPD_V2_VAL "CRJ/spd/v2_value"#define CRJ_SPD_VR_VAL "CRJ/spd/vr_value"#define CRJ_SPD_VT_VAL "CRJ/spd/vt_value"But I'm unable to read them (or set them) in my plugin (using Gizmo). No matter what I do, treating them as float or integer, they always read 0 (or some very strange, ever-changing numbers). Other CRJ Datarefs, like "CRJ/reverser1_arm", I can read/set them without any problems. Any help would be greatly appreciated. Edited July 30, 2013 by vpil0t Quote
Ben Russell Posted July 30, 2013 Report Posted July 30, 2013 As a guess you're creating your datarefs before the CRJ plugin has loaded. Try this: function OnBoot() dr_crj_v1 = dref.getDataref( "CRJ/spd/v1_value" )end function OnUpdate() -- or main() if( dr_crj_v1)then value = dref.getFloat( dr_crj_v1 )end end Quote
Ben Russell Posted July 30, 2013 Report Posted July 30, 2013 If that doesn't work you can replace OnBoot with OnFirstFrame... or you can use: plugins.findPlugin( "signature" ) Quote
vpil0t Posted July 31, 2013 Author Report Posted July 31, 2013 Nope, none of the solutions work. Gizmo can communicate with the CRJ plugin because I'm able to set/read some other CRJ datarefs, but the Vspeeds are always at 0. It may be a CRJ bug or some error on my side, but I really spent a lot of time trying to solve this problem. If somebody could confirm that it's indeed possible de read/set the Vspeeds values that would be great. Quote
Ben Russell Posted July 31, 2013 Report Posted July 31, 2013 Do the datarefs work in DataRefEditor ? Quote
vpil0t Posted July 31, 2013 Author Report Posted July 31, 2013 I can't see any of the CRJ datarefs in the editor. I can see datarefs for most of my plugins (sandy barbour's, xhsi...) but not for the CRJ. Quote
Ben Russell Posted July 31, 2013 Report Posted July 31, 2013 Try using dref.publish("CRJ/spd/v1_value") and see if DRE will begin to show them after you use that Gizmo API call. Quote
vpil0t Posted August 1, 2013 Author Report Posted August 1, 2013 dref.publish does not seem to be a valid api Call error:OnBoot.lua:35: attempt to call field 'publish' (a nil value): OnBoot Quote
Ben Russell Posted August 1, 2013 Report Posted August 1, 2013 try this:http://forums.x-pilot.com/topic/5478-gizmo64-1307140636-download/ Quote
vpil0t Posted August 13, 2013 Author Report Posted August 13, 2013 Nope, still not working with the new version. Anyway I give up, I'll find a workaround, this is just one of the numerous CRJ bugs that I'll have to dodge. Thank you for your help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.