scottb613 263 Posted September 26, 2016 Hi Folks, OK - school was a long time ago - yet I think my math is correct... This is my first attempt at Arma scripting and I am trying to make a medium sized air assault compatible with both Arma 2 and Arma 3 (hooked on the old Unsung)... I'm trying to identify a good IP (_wpip) some distance prior to the LZ (_wplz) when an air assault is inbound from BASE (_wpbs)... After marking the point with green smoke - it's very apparent the point I am calculating doesn't seem to be anywhere near being inline between the BASE and LZ... I did read not to use radians - that COS and SIN just take the actual angle as input... Any idea where I went wrong - as I said school was a long time ago ??? // var - LZ pad and BASE pad // _wplz = getPos LzPad; _wpbs = getPos BsPad1; // var - direction/distance from LZ to BASE for IP // _disip = 250; _dirip = nil; // get LZ position and break down array // _arrX = _wplz select 0; _arrY = _wplz select 1; _arrZ = _wplz select 2; // get slick IP waypoint - bearing relative to start posit // _dirip = [_wplz, _wpbs] call BIS_fnc_dirTo; _arrXn = ((cos _dirip) * _disip) + _arrX; _arrYn = ((sin _dirip) * _disip) + _arrY; _wpip = [_arrXn,_arrYn,_arrZ]; // green smoke for identifying position // _1Rnd_SmokeGreen_GP25 = "G_40mm_SmokeGreen" createVehicle _wpip; Thanks... Regards, Scott Share this post Link to post Share on other sites
scottb613 263 Posted September 27, 2016 Hi Folks, Please disregard - I found a reference where BIS did it a bit bass ackwards - you need to swap the SIN/COS functions from normal use to accommodate... _arrXn = ((sin _dirip) * _disip) + _arrX; _arrYn = ((cos _dirip) * _disip) + _arrY; Regards,Scott Share this post Link to post Share on other sites
killzone_kid 1329 Posted September 27, 2016 There are some handy command in Arma 3 you might want to check:https://community.bistudio.com/wiki/getDirhttps://community.bistudio.com/wiki/getRelDirhttps://community.bistudio.com/wiki/getPos https://community.bistudio.com/wiki/getRelPos 1 Share this post Link to post Share on other sites
scottb613 263 Posted September 27, 2016 Hi - thanks kid - yeah - each new thing I try to do has me searching the wiki for functions that allow me to complete the task at hand - appreciate the pointers - I'll take a gander... Regards, Scott Sent from my iPhone using Tapatalk Share this post Link to post Share on other sites