OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Spooner on 16 Oct 2007, 21:38:21

Title: SPON_directionName (ACCEPTED)
Post by: Spooner on 16 Oct 2007, 21:38:21
SPON_directionName v0.1.0
- Released: 2007-10-16
- SQF function in a single file
- Includes demo mission

Works out the name (e.g. "North North-West") or abbreviated name (e.g. "NNW") of a compass direction given a value in degrees (clockwise from North, as returned from getDir) or a vector (as returned from vectorDir, wind or weaponDirection). The user can specify how many possible directions to take the names from: 4 (N, E, W, S), 8 (adding NE, etc), 16 (adding NNE, etc) or 32 (adding NEbE, etc).

Credits
Based on a small part of a script by [seven]

ChangeLog
v0.1.1 - Correctly accepts degree values outside range of 0-359.
v0.1.0 - First release at OFPEC.
Title: Re: SPON_directionName (READY)
Post by: Spooner on 16 Oct 2007, 23:15:07
Mandoble pointed out that the function should accept angles outside of the range 0-359. I'll fix that in the next version.

*** EDIT ***
Updated with the suggested fix.
Title: Re: SPON_directionName (READY)
Post by: LeeHunt on 24 Oct 2007, 00:35:48
I just demo'd this, looks good  :good:  Accepted!