This should get you the direction in degrees:
Note that wind does have a vertical direction, but I think that is safe to ignore. As for the wind strength:Code:(wind select 0) atan2 (wind select 1)
This will give you the correct value, but I'm not sure what unit the wind command returns. Meters per second perhaps?Code:sqrt((wind select 0)^2 + (wind select 1)^2)
EDIT: Looks like the atan2 command doesn't return values in the 0...359 range, but rather -180...+180. Easy enough to convert though.
Last edited by MadDogX; Mar 26 2012 at 19:29.
Gigabyte P67X-UD3-B3 Motherboard | Intel Core i7 2600k @ 4.0GHz | NVidia GeForce GTX770 4GB
16GB Corsair XMS3 1600Mhz RAM | Kingston HyperX SSD | ASUS Xonar D2X sound | be Quiet! 700W PSU | Windows 7 x64
Thanks for the formulas. Is there a dev or anyone else who certainly knows the speed the wind command returns?
The wind vector is meters per second if I'm not mistaken. You can convert numbers (note: not vectors) to different units using BIS_fnc_convertUnits. Check the in-game function viewer in the editor on how to use it. This is a scripted function, so performance is slower than true script command.Further, is there a possibility to return the wind force in knots and km/h ?
[32, 2, 9] call BIS_fnc_convertUnits; //Convert 32 mps to kts