gitrinec
Member-
Content Count
34 -
Joined
-
Last visited
-
Medals
Everything posted by gitrinec
-
Spawn a single unit and move them into a vehicle
gitrinec posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm trying to spawn a vehicle and assign an ai driver at the same time but I have had an issue with making the unit spawn into the vehicle. So far this is what I've tried. I tried "NONE" as well for the create group. The Bus spawns correctly, just no driver at all or in the bus. private["_position","_direction","_veh","_texture","_civgroup"]; createMarker ["Bus_Spawn",[3238.332,6685.015]]; "Bus_Spawn" setMarkerType "Empty"; "Bus_Spawn" setMarkerSize [20, 20]; _position = getMarkerPos "Bus_Spawn"; _direction = 5.994,359.713,357.128; _veh = createVehicle ["CUP_C_Bus_City_TKCIV", _position, [], 0, "NONE"]; _veh setVehicleVarName "Bus1"; _civgroup = createGroup [civilian,true]; _BusDriver = "C_Man_UntilityWorker_01_F"; _tempBDriver = _civgroup createUnit [_BusDriver, getMarkerPos "Bus_Spawn", [], 0,"CAN_COLLIDE"]; [_tempBDriver] joinSilent _civgroup; _tempBDriver assignAsDriver _veh; _tempBDriver moveInDriver _veh; -
Spawn a single unit and move them into a vehicle
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This bus I am using has an x,y in the rotation and no Z -
Spawn a single unit and move them into a vehicle
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Is there a way to take a position such as 3238.332,6685.015 and use that to send a unit to it instead of creating a marker at the location and then sending them there? -
Spawn a single unit and move them into a vehicle
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's weird that it works though, I took the values from Rotation in the Attributes of a vehicle I placed to get them originally. -
Spawn a single unit and move them into a vehicle
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I wasn't sure if the size was needed for anything. So would this be how you would do the position then? _veh = createVehicle ["CUP_C_Bus_City_TKCIV",[3238.332,6685.015], [], 0, "NONE"]; Sorry, I left the use of _direction out of the code. Is the direction not needed if you have the position? It does put the vehicle facing the correct way. _veh setDir _direction; I guess a bad typo messes up everything with unit creation, thanks! -
Is it possible to keep an object next to the ground and move it. Not a setpos but where you can visually see it moving. Not, walk or drive, etc. Would you have to attachto and hide a different object?
-
Slide an object across the ground
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is for a vehicle, sorry for such a late reply, was away from editing for a while. The idea was to have a vehicle moving upside down and sliding on its roof. -
Recommended terrain size for vast mountainous terrain?
gitrinec posted a topic in ARMA 3 - TERRAIN - (BUILDER)
What would be a good size for a vast mountainous terrain landscape, would 8192×30 look ok. It's around 51800 km2. So guessing I have to make it larger to fit in at 60398 km2? Or does 8192×30 look too blocky? -
How long does the detach command take to complete, I'm noticing it tends to not be immediate?
-
Ya, I had one of the ai units hovering in the air , but that one was unneeded , so I just removed the attachto for it, but I noticed that even after detaching one unit from another, if I have a different unit setdir towards the supposedly detached unit, the unit looks at the previously attached unit and not the correct unit.
-
If you use a domove command on a unit to an object's position, how close will they get before stopping. Is it possible to domove on a unit to place them at a vehicles door but not get in the vehicle.
-
Make units aim properly at target during animation
gitrinec posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Is it possible to keep a unit fireing at an actual target during a walking animation , they are firing with forceweaponfire but just straight ahead , not aiming. Also what's the smoothest way to break out of forceweaponfire? -
Make units aim properly at target during animation
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
So this seems promising, I found it as a Arma 3 feature request . Maybe it's just me but my AI seem to hit the target more. The poster of the code Leopard20 mentioned that it wouldn't allow the AI to aim up and down. Can you see if this makes your ai hit anything? I didn't use it exactly as it was, just added it in my code. https://feedback.bistudio.com/T144528 [] spawn { _lastDir = 0; aiTarget disableAI "ALL"; ai setSkill 1; ai disableAI "MOVE"; ai doWatch aiTarget; ai doTarget aiTarget; aiTarget allowDamage false; _time = time+3; waitUntil { ai playMoveNow (["amovpercmtacsraswrfldl", "amovpercmtacsraswrfldr"] select _lastDir); ai forceWeaponFire [currentWeapon ai, currentWeaponMode ai]; ai reveal aiTarget; if (time - _time > 3) then { _time = time; aiTarget attachTo [ai, [0, 5, ([2, 5] select _lastDir)]]; }; _lastDir = 1 - _lastDir; ai setAmmo [currentWeapon ai, 10]; sleep 0.3; false } }; -
Make units aim properly at target during animation
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I don't have an invisible target but an actual target with reveal, dotarget, commandtarget, dofire, lol . Also DisableAI "FSM", setUnitPOS "UP" is set. Though I did see them one time actually turn some but then they shot one of their own , lol.. I did notice in 3DEN enhanced there is a option to disable weapon aim . - attribute to disable weapon aim for AI units.. the usual _unit disableai "WEAPONAIM" - no weapon aiming. But enableAI "WEAPONAIM" didn't change anything. -
Make units aim properly at target during animation
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm doing this with it, but as you are aware they just shoot straight. Even using _unit disableAI "PATH" over _unit disableAI "MOVE" doesn't change anything. But so far I'm able to keep them shooting in a line while walking. But looks awful when there is a wall behind the object they are shooting and they mostly just hit the wall. -
If a unit is in a walking animation toward an object, is the distance between the two objects measurable? I've tried _meters = _unit1 distance _unit2 but the number never changes in the while loop if the unit is in an animation moving forward. Also does forceweaponfire break out of an the animation instead of firing during the animation? If you attach a dummy unit then you can read the distance while the walking animation is playing, if it's in a loop getting updated. No forceweaponfire doesnt break a unit out of a walking animation. I'll post code later.
-
[SOLVED]Flip a vehicle upside down on its roof
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Is it possible to post embedded videos or video links in the forums? I've not turned what I'm creating into a cutscene yet but. I do have an AI unit pulling the wounded guy out of the car sort of. Most of this code came from here. With my added changes but the animations might be different depending on what unit you use. You can look through animations for the unit under the injured section for the correct one. I move the unit out of the car briefly set him in the correct animation position and then put him back at the car and it looks like the AI unit pulls him out. It's not a finished script but looks halfway decent. I'm making a coop mission so If you're using SP it would need to be modified. The sleep variables or whatever should be tweaked to meet your needs. _dragger = the ai you want to be the dragger; _injured = the injured unit getting dragged; _obj= object where you want unit dragged to; _obj2 = object to spawn back at where the _draghrt unit is; [_dragger, "grabDrag"] remoteExecCall ["playAction", _dragger, true] ; [_injured, "AinjPpneMrunSnonWnonDb"] remoteExecCall ["playMove", _injured, true] ; _injured enableSimulation false; Sleep (0.01); waitUntil { ((AnimationState _dragger) == "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2") || ((AnimationState _dragger) == "AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_2")}; _injured attachTo [_dragger, [0, 1.2, 0]]; // attach injured _injured setDir 180; // set injured to turn his back on dragger _DummyClone = { private ["_dummy", "_dummygrp", "_dragger"]; _dragger = _this; _dummygrp = createGroup East; _dummy = _dummygrp createUnit ["RU_soldier", Position _dragger, [],0,"FORM"]; _dummy setUnitPos "up"; _dummy hideobject true; _dummy allowdamage false; _dummy setBehaviour "CARELESS"; _dummy disableAI "FSM"; _dummy forceSpeed 1.5; _dragger attachTo [_dummy,[0, -0.2, 0]]; _dragger setDir 180; _dummy; }; _dummy = _dragger call _DummyClone; sleep 30; //move injured unit to a marker _injured setpos getmarkerpos "some marker"; // set injured unit animation for being dragged [_injured, "AinjPpneMrunSnonWnonDb"] remoteExecCall ["playMove", _injured, true]; //place the unit facing in the correct dir for the _dragger unit to grab _injured setDir 180; sleep 2; //put the _injured unit back to the object where the _dragger unit is at. _injured setpos (_obj2 modelToWorld [0, 0, 0]); // I've previously set the _injured unit to unconscious so that he wont' jump from the upside down car, this sets him back to conscious. _injured setUnconscious false; sleep 2; [_dragger, "AcinPknlMwlkSrasWrflDb"] remoteExecCall ["playMove", _dragger, true]; _dragger disableAI "ANIM"; _dummy doMove (position _obj); -
[SOLVED]Flip a vehicle upside down on its roof
gitrinec posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Is it possible in game flip a vehicle upside down without destroying it or the vehicle occupants? Like an explosion. I did find a start, this can flip a vehicle upside down. _obj setVectorUp [0,0,-1]; -
[SOLVED] Place units in a 360 degree circle position facing inward toward an object
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for creating most of the script Harzach!! -
[SOLVED]Flip a vehicle upside down on its roof
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, I have progress, when I have the scripts completed, I'll post them. I've kept the ai in the car alive while upside down. But don't have a good transition from car to drag, probably have to black out in a cutscene not to see the ai jump out from the top then move to being dragged. Any ideas , anyone?. -
[SOLVED] Place units in a 360 degree circle position facing inward toward an object
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here is what I used with some tweaks to make sure the units face the obj they were around and made the AI disabled for a brief amount of time so that they stay in the desired position. The numbers passed to the params can be changed to suit one's needs. That gave me 4 units facing the object. [2, 3] params ["_radius","_width"]; _pos = getPos sdv1; _pos params ["_px","_py" ]; _index = 0; _circ = floor ((2 * pi) * _radius); _radials = floor (_circ / _width); _factor = (360 / _radials); systemChat str _radials; for "_i" from 0 to (_radials - 1) do { _ix = (_i * _factor); _yaw = (180 - _ix); // yaw-pitch-roll need to be adjusted depending on object and orientation _roll = 0; _pitch = 0; _dirx = sin(_yaw) * cos(_roll); _diry = cos(_yaw) * cos(_roll); _dirz = sin(_roll); _upx = cos(_yaw) * cos(_roll) * sin(_pitch); _upy = sin(_yaw) * cos(_roll) * sin(_pitch); _upz = cos(_roll) * cos(_pitch); _ox = (_radius * cos _ix); _oy = (_radius * sin _ix); _obj = group player createUnit ["B_SL_Frogman_Team_Leader_01",[0,0,0],[],0,"FORM"]; _obj setVectorDirAndUp [[_dirx,_diry,_dirz],[_upx,_upy,_upz]]; _obj setPosATL [_px + _ox, _py + _oy, -0.2]; _obj setBehaviour "SAFE"; _rotation = [_obj, _pos] call BIS_fnc_relativeDirTo; _obj setDir (getDir _obj) +_rotation; _obj lookAt _pos; doStop _obj; _obj disableAI "move"; sleep 0.5; _obj enableAI "move"; _index = _index +1; }; -
[SOLVED] Place units in a 360 degree circle position facing inward toward an object
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I made some tweaks to that script and it works great. I'll prob have to tweak it some more for underwater. Thanks again. -
[SOLVED] Place units in a 360 degree circle position facing inward toward an object
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks Gunter Severloh I'll check it out. -
[SOLVED] Place units in a 360 degree circle position facing inward toward an object
gitrinec replied to gitrinec's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Merry Christmas GEORGE FLOROS GR. I've downloaded a bunch of your scripts lately, been working with your winter environment script, was able to get the snow to stop going through the ocean out to sea. Thanks for the link, I'm thinking it has something to do with the addvector 3d space as you can see in the image they stack vertically and not around the SDV. I'll take a look at that script later today that you linked too. Thanks