Search the Community
Showing results for tags 'horizontal'.
Found 2 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:
-
Horizontal Listbox Example needed
Bayern_Maik posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, I cant find a working example for a horizontal Listbox (Type: CT_XLISTBOX/42) & BI's "Templates/Examples" in their "splendid" documentation don't work either (https://community.bistudio.com/wiki/DialogControls-ListBoxes). Is there anyone who could help me out with a working example control pls? There might be a ugly wrokaround with buttons but im kind of desperate to understand how this ****box is supposed to work Bueno thanks in advantage Greets from Germany Edit: Got it working, will post my example for other noobs ;D- 1 reply
-
- listbox
- horizontal
-
(and 1 more)
Tagged with: