OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: JasonO on 07 May 2007, 19:54:16
-
Hey
How would I go about moving a marker around a circumfrance of a circle?
I want a dot to move around a building on a map, but I don't know how. I would assume it would need some math calculation?
Thanks for your help :)
-
Try this:
;dotturning.sqf
_marker = _this select 0;
_center = _this select 1;
_radius = _this select 2;
while {true} do
{
for [{_i = 0},{_i < 360},{_i = _i + 5}] do
{
_marker setMarkerPos [(_center select 0)+sin(_i)*_radius,(_center select 1)+cos(_i)*_radius];
Sleep 0.5;
};
};
Example:
["mk_mygreendot", getPos player, 100] execVM "dotturning.sqf"
EDIT:
Forgot to say ... Advanced????? ???
-
Thanks. I'll try it tommorow when i'm on my PC.
Well I considered it advanced. It needs a small bit of math to work, and it's not your basic scripting so..
-
Even though math is a complete mystery to me and thus I would consider this advanced to me, I don't think this actually fits in the advanced realm so I'm moving this here..