mr_centipede 31 Posted September 2, 2021 Just like the title reads, is there a way to convert direction in degrees to cardinal ( north, south, north east, etc...). Or do you need to create it from scratch? Thank you. Share this post Link to post Share on other sites
h - 169 Posted September 2, 2021 There this ancient one but I suppose it still works:https://www.ofpec.com/editors-depot/index.php?action=details&id=439&game=ArmA Share this post Link to post Share on other sites
mr_centipede 31 Posted September 2, 2021 Thank you, I'll give it a try Share this post Link to post Share on other sites
Ibragim A 163 Posted September 30, 2021 Try this one: PC_fn_compass_direction = { params ["_direction"]; private ["_compass_direction"]; _compass_direction = ""; switch (true) do { case (round ((_direction)/22.5) == 0): { _compass_direction = "north" }; case (round ((_direction)/22.5) == 1): { _compass_direction = "north-north-east" }; case (round ((_direction)/22.5) == 2): { _compass_direction = "north-east" }; // and so one case (round ((_direction)/22.5) == 3): { _compass_direction = localize "STR_PC_groupchat_153" }; case (round ((_direction)/22.5) == 4): { _compass_direction = localize "STR_PC_groupchat_154" }; case (round ((_direction)/22.5) == 5): { _compass_direction = localize "STR_PC_groupchat_155" }; case (round ((_direction)/22.5) == 6): { _compass_direction = localize "STR_PC_groupchat_156" }; case (round ((_direction)/22.5) == 7): { _compass_direction = localize "STR_PC_groupchat_157" }; case (round ((_direction)/22.5) == 8): { _compass_direction = localize "STR_PC_groupchat_158" }; case (round ((_direction)/22.5) == 9): { _compass_direction = localize "STR_PC_groupchat_159" }; case (round ((_direction)/22.5) == 10): { _compass_direction = localize "STR_PC_groupchat_160" }; case (round ((_direction)/22.5) == 11): { _compass_direction = localize "STR_PC_groupchat_161" }; case (round ((_direction)/22.5) == 12): { _compass_direction = localize "STR_PC_groupchat_162" }; case (round ((_direction)/22.5) == 13): { _compass_direction = localize "STR_PC_groupchat_163" }; case (round ((_direction)/22.5) == 14): { _compass_direction = localize "STR_PC_groupchat_164" }; case (round ((_direction)/22.5) == 15): { _compass_direction = localize "STR_PC_groupchat_165" }; case (round ((_direction)/22.5) == 16): { _compass_direction = localize "STR_PC_groupchat_166" }; }; _compass_direction; }; call it like this: [_dir] call PC_fn_compass_direction; // _dir = azimuth; Change localized strings by yourself according to degrees like you see in the first three cases. Share this post Link to post Share on other sites
R3vo 2654 Posted September 30, 2021 (edited) PC_fn_compass_direction = { params ["_direction"]; private _sector = round (_direction / 22.5); [ "north", "north-north-east", "north-east", localize "STR_PC_groupchat_153", localize "STR_PC_groupchat_154", localize "STR_PC_groupchat_155", localize "STR_PC_groupchat_156", localize "STR_PC_groupchat_157", localize "STR_PC_groupchat_158", localize "STR_PC_groupchat_159", localize "STR_PC_groupchat_160", localize "STR_PC_groupchat_161", localize "STR_PC_groupchat_162", localize "STR_PC_groupchat_163", localize "STR_PC_groupchat_164", localize "STR_PC_groupchat_165", localize "STR_PC_groupchat_166" ] select _sector; }; Edited September 30, 2021 by R3vo fixed return value 1 Share this post Link to post Share on other sites
Tankbuster 1746 Posted October 2, 2021 cardinaldirs = ["north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest", "north"]; tky_fnc_cardinaldirection = { params ["_dir"]; private ["_cardinaldir"]; _cardinaldir = cardinaldirs # (([_dir, 45] call BIS_fnc_roundDir) /45); _cardinaldir }; 1 Share this post Link to post Share on other sites