Search the Community
Showing results for tags 'rotation'.
Found 11 results
-
Is there a way to freeze rotation with attachToRelative function?
Pvt.Chiken posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm trying to attach a rather large object to a helicopter, essentially a spaceship. I did that using BIS_fnc_attachToRelative function and it works. The problem is, however, AI can't fly smoothly, and it looks extremely weird when a huge spaceship starts shaking all over the place. I need to know if there is a way to freeze the spaceship's rotation on pitch axis and roll axis so that it only turns together with the helicopter while generally remaining in the same orientation. -
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:
-
Hello good people ! i don't know if this is the right place to post this, but I'm having trouble getting mission rotation to work. my Class mission is setup like this class Missions { class Mission01 { template="Conquest-Ported.zargabad"; difficulty="regular"; class Params {}; }; class Mission02 { template="ConquestTestEngland.swu_public_Imber_uk"; difficulty="regular"; class Params {}; }; class Mission03 { template="ShapurConquest.Shapur_BAF"; difficulty="regular"; class Params {}; }; }; im using persistent = 1; and -autoinit. when the mission is over, it dont really end but put people back to the slot screen, but it never changes or reloads the pbo. im out of ideas :) looking forward to hear from you or getting put in the right direction!
-
simpler way to orientation vector of objects in 3d space?
bi_mg posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi Guys, i'm searching for a simpler way to rotate objects in 3d Space (yaw, roll, pitch). I never try the tranformation and rotation matrix to solve my problem. My Work: I started to work on worldToModel that takes an "Object Model Box 3D Space (named _ModelOrign) as a Parameter and puts "3D World Coordinades" (named _position) of another Object in this model space. private _modelOrign = _this select 0; private _objectOrign = _this select 1; private _position = _modelOrign worldToModel getPosWorld _objectOrign; So I can easily take the saved _position and apply to a targeting Object (named _modelTarget) that is differend rotating in 3D as the Object _modelOrign. Then I just execute the finction modelToWorld and voila the _position is rotating to the rotated _modelTarget in Model Box 3D Space as well. Nice and easy. privat _objectTarget = _this select 0; privat _modelTarget = _this select 1; privat _position = _this select 2; _objectTarget setPosWorld ( _modelTarget modelToWorld _position ) Orientation: to get the orientation of _objectOrign in 3D Space, i used vectorDir and vectorUp of _ modelOrign to get this orientation and apply it to this _objectOrign with the oriantation itsself. Wiki Source: Euler_angles Problem: I've have no idea to combine these two orientations vectors of _modelOrign and _objectOrign to get this problem of the orientation solved. I never used the transformation and rotation matrix. There sould be an easier way to do this. BIS serve an function BIS_fnc_setPitchBank in the past but I've heard that it is not precisely :/. I've never try it out. I'm sceptic about the documentation of vectorModelToWorld explains that it only use vectorDir and not vectorUp. I never try it. im very sure that there is a modern simpler way to solve this problem by a bunch of Arma 3+ vector functions for example addTorque but I do not understand the explanation at all, i'm not english. thank you -
deformation Model deforming when rotating.
npmproductions13 posted a topic in ARMA 3 - MODELLING - (O2)
Like my title suggests I'm making a weapon for the first time and I want the barrel of my minigun to turn in place when firing. Currently it turns but deforms beyond recognition when rotating but returns to normal when the rotation reaches 0 again. This is the animations class of my model.cfg. I can't see anything wrong with this. class Animations { class barrel { type="rotationZ"; source="ammoRandom"; sourceAddress="loop"; selection="barrel"; axis="barrel_axis"; centerFirstVertex=1; memory = true; minValue=0; maxValue=0.5; angle0="rad 0"; angle1="rad 180"; }; -
AI movement on scripted path / smooth rotations
Tova posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello ! To give a bit of context, I'd like to emulate the SetDriveOnPath command for infantry units in order to have them navigate inside buildings lacking path/building positions. The idea is to give an array of positions (e.g [[4680.4,6175.85,0.00143909],[4680.3,6170.7,0.00143909]]) and have the AI move in a straight line in between thanks to a switchMove. As of now, this is what I made : infantryDriveOnPath={ params ["_unit","_pathArray"]; _unit disableAI "ANIM"; _unit switchMove "Acts_SupportTeam_Front_Move"; { _direction= _unit getdir _x; while {sleep 0.5; ( _unit distance _x > 1)} do { _unit setDir _direction; } }forEach _pathArray; _unit enableAI "ALL"; _unit switchMove ""; }; The resulting behaviour is satisfying, however the setDir command causes instant rotations/twitching that are very ugly. Any ideas on how I could make smooth direction corrections ? Thanks 🙂 -
Fresh news - Improved maps rotation - Solved issue with unavailable maps
Pyrit. posted a topic in Announcements
Morning Outlanders and I'm terribly sorry for all the last minute info today. So first things first - We had a surprise prepared for you as we were changing the map rotation, but due to an issue on our end - as the map rotation has to be done manually - there were sadly no maps available for a short period of time. We a sorry for all the troubles this might have caused. - But this downfall comes with a price. We changed our map rotation! So now there will be only one map available at a time and the rotation will happen after 24 hours! That's right much faster map rotation just went live! So please do not hesitate and Let us know what do you think ⬇️ -
Morning Outlanders! - Just wanted to let you know that we changed the map rotation a little bit. Due to pretty long waiting times - There are going to be normal two maps most of the time but if the numbers drop in the least frequented hours there will be only one map available at a time. Hope this will help.
-
help Ingame rotation problem (does not appear in O2)
Noks - Ohliger posted a topic in ARMA 3 - MODELLING - (O2)
Hello, I have a problem with my animations which do not appear to rotate around the right axis, but only in game. Here are the rendered animations in O2 : In red you will see the axis, in green the rotating bones. Here in arma 3 : Looks like the rotation center is the center of the player. class CfgSkeletons { class MY_SPLENDID_WEAPON { pivotsModel=""; isDiscrete = 1; skeletonInherit = ""; skeletonBones[] = { "trigger", "", "bolt", "", "bolthandle", "bolt", "ejector", "bolt", "firepin", "bolt", "magazine", "", "bullets", "", "safety", "", "muzzleFlash", "", "foresight_unhide", "", "Sight", "foresight_unhide", "foresight_hide", "", "BackSight", "", "fireselector", "" }; }; }; class CfgModels { class MY_SPLENDID_WEAPON { htMin=0; htMax=0; afMax=0; mfMax=0; mFact=0; tBody=0; skeletonName = "MY_SPLENDID_WEAPON"; sectionsInherit = ""; sections[] = {"muzzleFlash"}; class Animations { /* class safety_mode_rot { type = "rotation"; source = "weaponMode"; selection = "safety"; axis = "safety_axis"; memory = 1; minValue = 0; maxValue = 0; angle0 = "rad 180"; angle1 = "rad 0"; }; */ class trigger { type = "rotation"; source = "reload"; sourceAddress = "clamp"; selection = "trigger"; axis = "trigger_axis"; memory = 1; minValue = 0; maxValue = 0.05; angle0 = "0"; angle1 = "rad 15"; }; class firepin { type = "translation"; source = "reload"; sourceAddress = "clamp"; selection = "firepin"; axis = "firepin_axis"; memory = 1; minValue = 0; maxValue = 0.06; minPhase = 0; maxPhase = 0.06; offset0 = -0.5; offset1 = 0; }; class bolt_reload_move_1 { type = "rotation"; source = "reload"; sourceAddress = "clamp"; selection = "bolt"; axis = "bolt_axis"; memory = 1; minValue = 0.2; maxValue = 0.3; angle0 = "rad 0"; angle1 = "rad 80"; }; class bolt_reload_move_2 { type = "translation"; source = "reload"; sourceAddress = "clamp"; axis = "bolt_axis"; selection = "bolt"; minValue = 0.30001; maxValue = 0.4; offset0 = 0; offset1 = -1; }; class bolt_reloadmagazine_move_1 { type = "rotation"; source = "reloadMagazine"; sourceAddress = "clamp"; selection = "bolt"; axis = "bolt_axis"; memory = 1; minValue = 0.05; maxValue = 0.1; angle0 = "rad 0"; angle1 = "rad 80"; }; class bolt_reloadmagazine_move_2 { type = "translation"; source = "reloadMagazine"; sourceAddress = "clamp"; axis = "bolt_axis"; selection = "bolt"; minValue = 0.10001; maxValue = 0.2; offset0 = 0; offset1 = -1; }; class magazine_unhide { type = "hide"; source = "reloadMagazine"; selection = "magazine"; minValue = 0; maxValue = 1; unhideValue = 0.55001; hideValue = 0.602; }; class magazine_hide: magazine_unhide { hideValue = 0; unhideValue = 0.550; }; class magazine_reload_move_1 { type = "translation"; source = "reloadMagazine"; selection = "magazine"; axis = "magazine_axis"; memory = 1; minValue = 0.55001; maxValue = 0.602; offset0 = 0; offset1 = -1; }; class bolt_reloadmagazine_move_3 { type = "translation"; source = "reloadMagazine"; sourceAddress = "clamp"; axis = "bolt_axis"; selection = "bolt"; minValue = 0.7; maxValue = 0.8; offset0 = 0; offset1 = 1; }; class bolt_reloadmagazine_move_4 { type = "rotation"; source = "reloadMagazine"; sourceAddress = "clamp"; selection = "bolt"; axis = "bolt_axis"; memory = 1; minValue = 0.80001; maxValue = 0.9; angle0 = "rad 0"; angle1 = "rad -80"; }; class bullets_hide: magazine_unhide { source = "isEmpty"; selection = "bullets"; hideValue = 1; unhideValue = 0; }; class raise_frontsight { type = "rotation"; source = "zeroing1"; selection = "foresight_unhide"; axis = "foresight_axis"; memory = 1; minValue = 0; maxValue = 0.2; angle0 = 0; angle1 = "rad -90"; }; class zeroing { type = "translation"; source = "zeroing1"; sourceAddress = "clamp"; selection = "Sight"; axis = "sight_axis"; memory = 1; minValue = 0.2; maxValue = 1; offset0 = 0; offset1 = 1; }; class muzzleFlashROT { type="rotationX"; source="ammoRandom"; sourceAddress="loop"; selection="muzzleFlash"; axis=""; memory = 0; centerFirstVertex=true; minValue=0; maxValue=4; angle0="rad 0"; angle1="rad 360"; }; class foresight_hide { type = "hide"; source = "hasOptics"; selection = "foresight_hide"; memory = 0; minValue = 0; maxValue = 1; hideValue = 0; unHideValue = 1; }; class foresight_unhide: foresight_hide { selection = "foresight_unhide"; hideValue = 0.9; unHideValue = 0; }; }; }; }; The animated bones are "foresight_unhide" and "bolt". The classnames of the animations are "raise_frontsight", "zeroing", "bolt_reload_move_1" and "bolt_reloadmagazine_move_1" / "bolt_reloadmagazine_move_4". -
Is there a way to use the Eden Rotation XYZ values in scripting?
Gilatar posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
I'm trying to replace an object that I've played in the Eden Editor through a script, but I've changed the XYZ rotation of the object. I have managed to give the new object the XYZ position values of the old object, but I'm struggling to figure out how to change it's rotation. Is there an easy way of doing this? I've already tried setVectorUp, but it doesn't seem to accept the above XYZ rotation values from the Eden editor. Edit: Woops, looks like I posted this in the wrong subforum.