setDirection – Talk

From Bohemia Interactive Community
Revision as of 17:56, 30 March 2015 by Benargee (talk | contribs) (spelling)
Jump to navigation Jump to search

Lightwolf's Note

-https://community.bistudio.com/wiki?title=setDirection&oldid=88331
I had very different results to your claim. This command does work with Arma 3 locations. If you read carefully, it only changes the orientation of the area and icon if it has one. This code demonstrates the icon rotation: location2 = createLocation ["VegetationPalm", getpos player, 200, 200]; Location2 setText "Benargee's Palm Tree"; Location2 setDirection 45; Now observe the map and you will see the icon is rotated 45 degrees. The text is not rotated as that would make no sense.
The only thing that stands true, is that you can not edit preexisting locations built into the map.

EDIT: To prove that not only the icon rotates, but also the area, here is a script that provides visual demonstration: //set parameters so that marker reflects location's exact area. feel free to change area and angle. xArea = 10; yArea = 30; pos = position player; angle = 45; //create marker for visualization marker2 = createMarker ["mk2", position player ]; "mk2" setMarkerShape "RECTANGLE"; "mk2" setMarkerBrush "Border"; "mk2" setMarkerSize [xArea, yArea]; "mk2" setMarkerDir angle; "mk2" setMarkerColor "ColorBlack"; //create location and set parameters location2 = createLocation ["VegetationPalm", (getMarkerPos "mk2"), xArea, yArea]; Location2 setText "Benargee's Palm Tree"; Location2 setDirection angle; location2 setRectangular true; null = [] spawn {while {true} do {hintSilent ("Am I in the location?\n" + (str (getpos player in location2))); sleep 0.1;};}; Here you will have a script that shows you the area is in fact rotated, and a hint that tells the player is in the location or not. You will notice the hint is consistent with the map marker area. (A3 1.40) --Benargee (talk) 18:52, 30 March 2015 (CEST)