meshboy Posted January 24, 2012 Report Posted January 24, 2012 (edited) XPLMSetDatai(XPLMFindDataRef("sim/weather/turbulence[0]"),5); //int ktsXPLMSetDatai(XPLMFindDataRef("sim/weather/turbulence[1]"),8); //int ktsXPLMSetDatai(XPLMFindDataRef("sim/weather/turbulence[2]"),3); //int ktsThis is how i set some datarefs, works in some but others are not affected.Any suggestions? iam not using gizmo at the moment.These turbulence refs are not affected at all???? Edited January 24, 2012 by meshboy Quote
Ben Russell Posted January 24, 2012 Report Posted January 24, 2012 (edited) Looks like you're trying to write Integer values to datarefs that expect Floats.Try this instead:XPLMSetDataf( XPLMFindDataRef("sim/weather/turbulence[0]"), 0.5 ); Edited January 24, 2012 by Ben Russell Quote
meshboy Posted January 25, 2012 Author Report Posted January 25, 2012 Hi, you are right, it is a float, but it wont work even if i set a float value.I set three cloud values first. is that why no turbulence is showing?I guess if the turbulence is set i will see the values in the weather window as i do when i set my cloud? This is what i have, cloud works but nothing else.//Set weatherXPLMSetDatai(XPLMFindDataRef("sim/weather/cloud_type[0]"),cloud0);XPLMSetDatai(XPLMFindDataRef("sim/weather/cloud_type[1]"),cloud1);XPLMSetDatai(XPLMFindDataRef("sim/weather/cloud_type[2]"),cloud2);//0-1XPLMSetDatai(XPLMFindDataRef("sim/weather/thunderstorm_percent"),0.7);XPLMSetDatai(XPLMFindDataRef("sim/weather/wind_turbulence_percent"),0.8);XPLMSetDatai(XPLMFindDataRef("sim/weather/rain_percent"),0.6);XPLMSetDatai(XPLMFindDataRef("sim/weather/wind_speed_kt[0]"),0.5); //int ktsXPLMSetDatai(XPLMFindDataRef("sim/weather/wind_speed_kt[1]"),0.5); //int ktsXPLMSetDatai(XPLMFindDataRef("sim/weather/wind_speed_kt[2]"),0.5); //int kts XPLMSetDatai(XPLMFindDataRef("sim/weather/turbulence[0]"),5.0); //int ktsXPLMSetDatai(XPLMFindDataRef("sim/weather/turbulence[1]"),5.0); //int ktsXPLMSetDatai(XPLMFindDataRef("sim/weather/turbulence[2]"),5.0); //int ktsXPLMSetDatai(XPLMFindDataRef("sim/weather/rate_change_percent"),1.0); Quote
meshboy Posted January 25, 2012 Author Report Posted January 25, 2012 SOLVED IT!Of course it wont work,XPLMSetDatai (setting integers only)have to use:XPLMSetDataf (setting float) Different method and it is working! 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.