Search the Community
Showing results for tags 'azimuth'.
Found 4 results
-
azimuth Tank horizontal rotation based on marker direction
thy_ posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey. I'm coding something strongly based on it I need to make AI tanks hold positions as close as possible at some marker positions managed through Eden. My version is simpler and must be more accurate about synchronizing tank direction to the selected marker direction, with smooth movement when needed, differently when we use setDir, for example: But this is what happens (image down below): tanks got their horizontal azimuths misaligned when compared with their selected marker direction. Even my debug messages (systemChat) don't make sense to me hehe. Here, both functions that m THY_fnc_CSWR_move = { // This function makes the tank goes to a marker position. // Return nothing. params ["_grp"]; private ["_markers", "_mkrSelected", "_mkrPos", "_wp"]; sleep 1; _markers = ["hold_1", "hold_2", "hold_3", "hold_4"]; _mkrSelected = selectRandom _markers; _mkrPos = getMarkerPos _mkrSelected; // Adding waypoint: _wp = _grp addWaypoint [_mkrPos, 0]; _wp setWaypointType "HOLD"; _grp setCurrentWaypoint _wp; // Waiting the tank gets closer: waitUntil { sleep 3; (((leader _grp) distance _mkrPos) < 20) }; // Do rotation: [_mkrSelected, _grp] call THY_fnc_CSWR_hold; // Return: true; }; THY_fnc_CSWR_hold = { // This function makes the tank rotate on your own axis until it reach the same direction of a specific marker. // Return: nothing. params ["_mkr", "_grp"]; private ["_clockwise", "_vehicle", "_directionToHold", "_dirRelative"]; _clockwise = false; _vehicle = vehicle (leader _grp); _directionToHold = markerDir _mkr; _dirRelative = _directionToHold - (getDir _vehicle); // Force the vehicle doest start to turn when still moving (rare, but happens): _vehicle sendSimpleCommand "STOP"; // Wait the vehicle to brakes: sleep 1; // ------------------- NEED HELP HERE DOWN BELOW ------------------------------- if ( abs(_dirRelative) > 2 ) then { if ( _dirRelative > 0 ) then { if (_dirRelative < 180) then { _clockwise = true }; } else { if (_dirRelative < -180) then { _clockwise = true }; }; if (abs(_dirRelative) > 1) then { // Originally was: > 120 if (_clockwise) then { _vehicle sendSimpleCommand "RIGHT" } else { _vehicle sendSimpleCommand "LEFT" }; waitUntil { _dirRelative = _directionToHold - (getDir _vehicle); if ( _dirRelative > 180 ) then { _dirRelative = abs(360 - _dirRelative) }; if ( _dirRelative < -180 ) then { _dirRelative = abs(_dirRelative + 360) }; // Without this line, the tank will rotate on its axis non-stop: if ( abs(_dirRelative) <= 100 ) exitWith { true }; false; }; _vehicle sendSimpleCommand "STOPTURNING"; }; systemChat format ["[Desired %1º | Executed: %2º]", markerDir _mkr, getDir _vehicle]; // ------------------- NEED HELP HERE ABOVE ------------------------------- sleep 10; [_grp] spawn THY_fnc_CSWR_move; }; // Return: true; }; Demo: cswr-tanks-holding.stratis.zip = https://drive.google.com/file/d/1EcPiF2LFo149skR6GV63Vz6hhP7o6PlV/view?usp=share_link- 1 reply
-
- 1
-
- rotation
- non-setdir
-
(and 2 more)
Tagged with:
-
How to add azimuth to the gunner optics of a custom (mod) vehicle?
DanilKan posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
I got a BTR from a custom mod. It has the same 'gunnerOpticsModel' as the vanilla 'Marid' but it doesnt show the bearing. What do I have to change to make the bearing visible for my custom vehicle? Here is how it looks from the custom vehicle: https://imgur.com/a/606cnY2 config.cpp: And here is how I need it to look like: https://imgur.com/a/026bpR3 config.cpp: -
Hey guys, a bit of a puzzle here. I'm trying to create a trigger that opens a one way gate. Tigger has following conditions: Player present inside trigger. No OpFor within trigger. Gate is alive. Gatekeeper is alive. Players vehicle is facing correct direction. I managed to get everything except the direction so far with this: Activated by player present - this and (alive gatekeeper) and (alive gate02) and (east countside thislist) == 0 However i'm having hard time implementing getdir in to the condition. I managed to get getdir working like this: if (direction (vehicle player) >200) then {hint "Going out"} if (direction (vehicle player) <200) then {hint "Going in"} But how would i make this into a trigger condition? Somehow with _x thislist i would assume..? It's for multiplayer so i can't use command "player" in the trigger. How do you refer to the unit that is inside the tigger instead of "player"?
-
Spawn empty vehicle and set its direction
WurschtBanane posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi. I am spawning a jet via trigger by using this: _vehicleObject = "B_Plane_CAS_01_F" createVehicle (getMarkerPos "marker_spawn_A10");, but its always pointing towards 180. I want it to look towards 270 or so... you get it. Can anyone help me please? I know this is pretty basic and there is a thread covering this somewhere probably... couldnt find it though.