Search the Community
Showing results for tags 'setDir'.
Found 3 results
-
I'm having a couple of snipers (same group) reach their spot and then keep watch over a static position (in the image below represented by the lighthouse). What we noticed is that the more distant the lighthouse, the more untidy the "distracted" snipers' direction in relation to the position (lighthouse) they were supposed to be watching. I've given many go to align the group leader's position but the image was my best. Here are some commands that I've already tried: setDir, getDir, setFormDir. But doWatch and lookAt work better and, of course, because of the purpose, I chose to use doWatch. initServer.sqf (just for testing): waitUntil { !isNull grp1 }; private _sniperPos = [3801.55,4266.83,0]; private _wp = grp1 addWaypoint [_sniperPos, 0]; waitUntil {sleep 0.2; ((leader grp1) distance _sniperPos) < 8 }; grp1 setBehaviourStrong "AWARE"; grp1 setSpeedMode "LIMITED"; { _x setUnitPos "DOWN" } forEach (units grp1); systemChat format ["Before formationDirection '%1'", formationDirection (leader grp1)]; waitUntil {sleep 3; ((leader grp1) distance _sniperPos) < 1 }; { sleep 2; //[_x, (_x getDir LIGHTHOUSE)] remoteExec ["setDir"]; //_x setDir (_x getDir LIGHTHOUSE); //[_x, (_x getRelDir LIGHTHOUSE)] remoteExec ["setDir"]; //_x setDir (_x getRelDir LIGHTHOUSE); _x doWatch LIGHTHOUSE; } forEach (units grp1); grp1 setFormation "DIAMOND"; // better than LINE 'cause the spotter doesn't get in the sniper's way most of the time. grp1 setFormDir (getDir (leader grp1)); while { true } do { ["behaviour '%1' / formationDirection '%2' / eyeDirection '%3' / ", behaviour (leader grp1), formationDirection (leader grp1), eyeDirection (leader grp1)] call BIS_fnc_error; sleep 2; }; Demo: https://drive.google.com/file/d/18QGkzuj53y4LwcPvxpYBASMhiQROB76a/view?usp=sharing If you got some more to share, please, keep going!
-
Hey everybody! I have saved 4 different positions and their relative directions to spawn a unit, but unit's direction never matches the one I saved. First, this is the code I am using: _pos = [ [3144.13,3984.86,1.24656], [3148.41,3982.62,1.1283], [3148.64,3979.73,1.10767], [3153.13,3977,1.0178] ]; _dir = [16.0291,308.932,328.367,320]; _dice = count _pos; _dice = floor (random _dice); _grp = createGroup EAST; _unit = _grp createUnit ["O_G_Soldier_F", markerPos "marker", [], 0, "NONE"]; _unit setPosATL (_pos select _dice); sleep 1; _unit allowFleeing 0; _unit setDir(_dir select _dice); _unit setUnitPos "MIDDLE"; I check unit's direction after it's creation with _dirTarget = getDir cursorTarget; hint str(_dirTarget); For example my last 3 spawns: Instead of 308.9 it's 338.9 Instead of 328.3 it's 358.3 Instead of 16.02 it's 0.011 How is that possible and how am I able to stop this behaviour? It's driving me crazy, because I need them quite accurate. I tried with different sleep values, with and without allowFleeing or setUnitPos. I don't get it. Kind Regards.
- 2 replies
-
- setDir
- setFormDir
-
(and 1 more)
Tagged with:
-
how to make an array with setPosATL & setDir positions for MP respawn ?
doomnet posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
hello, i have made some positions with setPosATL and setDir this setPosATL [16559.8,21846.6,1.13549]; this setDir 271.228; this setPosATL [16560.2,21848.7,1.10291]; this setDir 279.611; this setPosATL [16556.1,21847.2,0.573884]; this setDir 3.74775; this setPosATL [16556.8,21850.9,0.636226]; this setDir 268.757; how to make an array to use in this code for random respawn positions ? if (isServer) then { _randomPos = [,,,,] call BIS_fnc_selectRandom; player setPos (getPos _randomPos); }; i found a lot of answers for making an array but not for multiple setPos and setDir positions in one array !