OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Trexian on 18 Jun 2008, 05:56:13
-
Hello - it has been awhile. :)
Is there some (easy) way to determine the orientation of a marker. The ultimate idea would be this:
- mission creator creates a marker on the map and names it;
- the name of the marker is passed to a script, which creates a trigger with the same dimensions as the marker;
- when activated, the trigger generates a list of all units within the marker/trigger.
I have searched, but haven't found anything quite what I need.
My situation would also be solved if there's a way to have a trigger display the exact boundaries like a marker does.
The only "solution" I've been able to work out is to take the marker dimensions, create temporary hidden markers on the corners (the marker would first be checked to make sure it is a rectangle), then work out the relative directions and distances of the corners to deduce an angle to use in the create trigger part.
There's an easier way, right? :)
Right?
-
Your overall idea seems sensible and I was going to say, "just use getMarkerDir", but then I found out that there wasn't one! That is rather surprising to me.
I can't see that there is a way to determine the orientation of a marker though, in the way you've described, since you only know where the corners of the marker actually are if you know its orientation already.
There aren't any trigger querying commands, so I can't suggest you ask the mission-maker to place a named trigger on the map leaving you to make the marker.
You might just be better off asking the player to place the trigger and marker manually. Sorry!
-
What about markerDir command ? :P
Syntax: Degrees = markerDir "markerName";
-
Good point! :whistle: Nothing like BIS's inconsistent command naming for confusing us mortals (getMarkerType, getMarkerSize, getMarkerColor, getMarkerPos...but markerDir).
-
:D :cool2:
There are many other commands beginning with marker*, they are mostly complimentary to any setmarker* commands listed later, or even equivalent to any getmarker* commands.
Planck
-
BAH! :D
Thanks guys. :clap:
I looked at all the "get" and "set" stuff. :) Silly me.... :whistle:
Glad it was an easy answer!
A follow up question, though. ;)
It returns a number, which I presume to be 1-360? That number directly correlates to the angle value in setTriggerArea?
Won't be able to test it for a couple days, so trying to work it out in my head now.
-
Returns a number (real number), which can also include a decimal portion.
Planck
-
BTW, I now realize that the whole thing might've been an exercise in futility. Tonight when I went into the editor, the test mission was exactly the same, but the trigger was a nice, finely drawn, box. Not the icon I recall seeing when I last looked at it.
:doh:
So, I don't think I need this nice little script I just worked up. Although, as these things usually happen, I'll end up needing it eventually for something else. :D