-
Content Count
772 -
Joined
-
Last visited
-
Medals
Posts posted by Schatten
-
-
Seems, this code works:
while {true} do { _nearestVehicles = nearestObjects [player, ["Car", "Tank", "Air"], 1000]; { _vehicle = _x; if (({alive _x} count (crew _vehicle)) == 0) then { _unitGroup = createGroup civilian; _unit = _unitGroup createUnit ["TK_CIV_Takistani01_EP1", getPos _vehicle, [], 0, "NONE"]; _unit moveInDriver _vehicle; _unit action ["lightOff", _vehicle]; moveOut _unit; deleteVehicle _unit; deleteGroup _unitGroup; }; } forEach _nearestVehicles; sleep 10; };
-
You can use https://community.bistudio.com/wiki/BIS_fnc_inTrigger for triggers or my function for markers.
-
-
kyopower, save code
while {true} do { _nearestVehicles = nearestObjects [player, ["Car", "Tank", "Air"], 1000]; { _reflectors = configFile >> "CfgVehicles" >> (typeOf _x) >> "Reflectors"; _reflectorsNumber = count _reflectors; for "_i" from 0 to (_reflectorsNumber - 1) do { _reflector = _reflectors select _i; _x setHit [getText (_reflector >> "selection"), 1]; }; } forEach _nearestVehicles; sleep 10; };
and launch from init.sqf using
execVM "scriptName.sqf";
This script doesn't work properly. For example, it destroys only front lights of HMMWV CROWS (M2).
-
Use
((player isKindOf "B_Helipilot_F") or (player isKindOf "B_officer_F"))
or
((typeOf player) in ["B_Helipilot_F", "B_officer_F"])
or
copy the whole script just changing the class as well -
Is it?
Function:
private ["_keystonePos", "_playerPos", "_relativeDir", "_relativePos"]; _relativeDir = [player, _this] call BIS_fnc_relativeDirTo; _playerPos = getPos player; _keystonePos = getPos _this; _relativePos = [(_playerPos select 0) - (_keystonePos select 0), (_playerPos select 1) - (_keystonePos select 1), (_playerPos select 2) - (_keystonePos select 2)]; [_relativePos, _relativeDir]
Usage:
_array = _keystone call functionName;
-
Not working. Spawning civilians outside the vehicles.Replace string with createUnit to
_unit = _unitGroup createUnit ["TK_CIV_Takistani01_EP1", getPos _vehicle, [], 0, "NONE"];
Btw, that method could cause more lag than we would like to have.Decrease radius, reduce list of vehicles.
-
Try to use this code:
_nearestVehicles = nearestObjects [player, ["Car", "Tank", "Air"], 1000]; { _vehicle = _x; if (({alive _x} count (crew _vehicle)) == 0) then { _unitGroup = createGroup civilian; _unit = "TK_CIV_Takistani01_EP1" createUnit [getPos _vehicle, _unitGroup]; _unit moveInDriver _vehicle; _unit action ["lightOff", _vehicle]; deleteVehicle _unit; deleteGroup _unitGroup; }; } forEach _nearestVehicles;
-
Try to use this function:
EPfn_saveInventory = { private ["_array", "_items"]; _array = []; { if ((typeName _x) == "ARRAY") then { _items = _x; { _array set [ count _array, [ typeOf _x, damage _x ] ]; } forEach _items; } else {diag_log "THIS IS NOT AN ARRAY"}; } forEach _this; _array };
-
I am just not certain how to execute them :confused:.Add this code into init field of group's leader:
{_x addEventHandler ["HandleDamage", {false}]} forEach (units (group this));
-
Add this command in init field:
this execVM "watchForAltitude.sqf";
watchForAltitude.sqf:
while {true} do { _position = getPosASL _this; if (!(surfaceIsWater _position)) then {_position = ASLtoATL _position}; _altitude = _position select 2; if (_altitude <= 3) then { switch (true) do { case (_this isKindOf "B_Heli_Transport_01_F"): { {_this animateDoor _x} forEach [ [_doorname, _phase, _now], ... ]; }; case (_this isKindOf "B_Heli_Transport_03_base_F"): { {_this animateDoor _x} forEach [ [_doorname, _phase, _now], ... ]; }; }; } else { switch (true) do { case (_this isKindOf "B_Heli_Transport_01_F"): { {_this animateDoor _x} forEach [ [_doorname, _phase, _now], ... ]; }; case (_this isKindOf "B_Heli_Transport_03_base_F"): { {_this animateDoor _x} forEach [ [_doorname, _phase, _now], ... ]; }; }; }; sleep 0.1; };
_doorname, _phase and _now you need to take from configs of Ghosthawk and Huron (use config viewer).
-
Not sure.
If player isn't in vehicle he can't turn light off.
-
I think that's impossible because there isn't such scripting command.
-
_pos = _this select 0; if (surfaceIsWater _pos) then { _position = [_pos, 0, _maxDistance, 10, 0, 0.5, 1] call BIS_fnc_findSafePos; if ((count _position) > 0) then {_position} else {getArray (configFile >> "CfgWorlds" >> worldName >> "mapcenter")}; };
-
My version of function to detect whether is object within marker of "ellipse" or "rectangle" type:
private ["_angle", "_distance", "_markerName", "_markerPosition", "_markerSize", "_markerSizeA", "_markerSizeB", "_object"]; _object = _this select 0; _markerName = _this select 1; _markerPosition = getMarkerPos _markerName; _markerSize = getMarkerSize _markerName; _markerSizeA = _markerSize select 0; _markerSizeB = _markerSize select 1; _angle = ([_markerPosition, _object] call BIS_fnc_dirTo) - (markerDir _markerName); if (_angle < 0) then {_angle = 360 + _angle}; if ((markerShape _markerName) == "ELLIPSE") then { _distance = _markerSizeA * _markerSizeB / (sqrt ((_markerSizeA * (cos _angle)) ^ 2 + (_markerSizeB * (sin _angle)) ^ 2)); _markerSizeA = abs (_distance * (sin _angle)); _markerSizeB = abs (_distance * (cos _angle)); }; _distance = [_object, _markerPosition] call BIS_fnc_distance2D; ((abs (_distance * (sin _angle))) < _markerSizeA) and {(abs (_distance * (cos _angle))) < _markerSizeB}
Usage:
isWithinMarker = compile (preprocessFileLineNumbers "isWithinMarker.sqf"); if ([player, "marker1"] call isWithinMarker) then {hint "You are within marker area"};
-
It depends on what should be saved. I use this extension to save player's inventory and position, objects, etc. IniDBi works fine.
-
-
-
I'd like all boats to spawn with the same init line (which adds a push back script to the player's menu while in or near the boat).One of solutions:
player addAction ["Something", "script.sqf", nil, 1.5, true, true, "", "((typeOf cursorTarget) in boats) and {(cursorTarget distance player) <= 5}"]; player addAction ["Something", "script.sqf", nil, 1.5, true, true, "", "(typeOf (vehicle player)) in boats"];
-
Diameter: 49
Height: 47.5
sizeOf returns max size - diameter.
Also I think that it's impossible to change its size.
-
If I'm not mistaken, commander's seat of tanks (Varsuk, etc) has turret path [0,0], but commander's seat of cars (Strider, etc) - [1]. Thus "varsuk removeWeaponTurret ["SmokeLauncher", [0,0]]" works, but "strider removeWeaponTurret ["SmokeLauncher", [0,0]]" doesn't.
-
By default drivers/pilots (turret path is [-1]) or commanders ([1] or [0,0]) have smoke launcher. So you need to use
this removeWeaponTurret ["SmokeLauncher", [-1]]
or
this removeWeaponTurret ["SmokeLauncher", [1]]
or
this removeWeaponTurret ["SmokeLauncher", [0,0]]
More universal solution:
{if ("SmokeLauncher" in (this weaponsTurret _x)) exitWith {this removeWeaponTurret ["SmokeLauncher", _x]}} forEach (allTurrets this);
-
-
Is it failed to get size?
Variable Checking Problem (Help!!)
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
returns
So
returns "BLA1".