-
Content Count
782 -
Joined
-
Last visited
-
Medals
Everything posted by Schatten
-
It contains if !(hasInterface) exitWith {}; at the beginning, so it will work only on client PCs. I would recommend to rewrite the script that it will be client only.
-
Eject all players in my Helicopter but me
Schatten replied to dernikkl1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@dernikkl1, try this: { _x action ["GetOut", _vehicle]; } forEach ((crew _vehicle) - [player]); -
trigger Trigger multiplying addAction
Schatten replied to Dj Rolnik's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Dj Rolnik, trigger statements are local, i.e. they are executed by each client. At the same time you use remoteExec. It means that if the trigger condition is true, the code placed in "On activation" field is executed by each client. This leads to duplicating actions. To solve the problem either make your trigger server only, or don't use remoteExec. -
Is there a way to pass/get a local variable into setTriggerActivation?
Schatten replied to doctorbutts's topic in ARMA 3 - MISSION EDITING & SCRIPTING
There are getTriggerXXX commands. Can you provide full error message got from RPT-file? -
Is there a way to pass/get a local variable into setTriggerActivation?
Schatten replied to doctorbutts's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@doctorbutts, as far as I remember, if an object is attached to a trigger using triggerAttachVehicle command, then the object is accessible through thisList variable, so try to use this code: _healed_trig setTriggerStatements [ "this && { _victim = thisList select 0; !([_victim] call ace_medical_blood_fnc_isBleeding) && { [_victim] call ace_common_fnc_isAwake } }", "hint 'victim healed';", "" ]; Also you can use getVariable and setVariable commands to transfer variables between the trigger and your code: _healed_trig setTriggerStatements [ "this && { _victim = thisTrigger getVariable 'victim'; !([_victim] call ace_medical_blood_fnc_isBleeding) && { [_victim] call ace_common_fnc_isAwake } }", "hint 'victim healed';", "" ]; _healed_trig setVariable ["victim", _victim]; -
Help with set/get variable
Schatten replied to Robustcolor's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, you don't need to delete variables using setVariable before deleting an object. -
Help with set/get variable
Schatten replied to Robustcolor's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Robustcolor, use this code: _respawnPositionAdded = false; for "_i" from 1 to 5 do { _veh = "Jeep" createVehicle [0,0,0]; _veh setVariable ["RWPoint", false]; if (!_respawnPositionAdded) then { [west, _veh] call BIS_fnc_addRespawnPosition; _veh setVariable ["RWPoint", true]; _respawnPositionAdded = true; }; }; But in this code only the first vehicle will always be added to respawn positions. If you need that random vehicle will be added, then use this code: _vehicles = []; for "_i" from 1 to 5 do { _veh = "Jeep" createVehicle [0,0,0]; _veh setVariable ["RWPoint", false]; _vehicles pushBack _veh; }; (selectRandom _vehicles) setVariable ["RWPoint", true]; Next, you should check vehicle variable before deleting vehicle itself: params ["_veh"]; if (_veh getVariable ["RWPoint", false]) then { [_veh] call BIS_fnc_removeRespawnPosition; }; deleteVehicle _veh; -
Returning a value inside a hint
Schatten replied to CY4's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@CY4, use this code: _loadoutWeightsInfo = thisList apply { format ["%1: %2lbs", name _x, (round ((loadAbs _x) * 10)) / 10 ^ 2] }; hintSilent (parseText (format ["Loadout Weight<br/>%1", _loadoutWeightsInfo joinString "<br/>"])); -
call command doesn't accept path to a function. Also, you already added your function into function library, so use this code: remoteExec ["AURA_fnc_SFInteraction"];
-
hint parseText for MP
Schatten replied to major-stiffy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@7erra, thanks for the clarification. It's possible to use this simplified code: { hint parseText "Who<br/><img size='5' image='pic\man.jpg'/><br/>is it?"; } remoteExec ["call"]; -
hint parseText for MP
Schatten replied to major-stiffy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@major-stiffy, try this: (parseText "Who<br/><img size= '5' image='pic\man.jpg'/><br/>is it?") remoteExec ["hint"]; -
Activate Three scripts per trigger at different times
Schatten replied to Coladebote's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can create 35 markers and the script, that creates 105 triggers. Also, I missed that your trigger is activated by any player, so here is updated version: - trigger condition: (this and { !(thisTrigger getVariable ["script1Started", false]) }) or { _unit = thisList select 0; (((_unit distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) }) or { ((_unit distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) } } } - on activation: if (!(thisTrigger getVariable ["script1Started", false])) then { execVM "scripts\scripts_1.sqf"; thisTrigger setVariable ["script1Started", true]; }; call { _unit = thisList select 0; if (((_unit distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) }) then { execVM "scripts\scripts_2.sqf"; thisTrigger setVariable ["script2Started", true]; }; if (((_unit distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) }) then { execVM "scripts\scripts_3.sqf"; thisTrigger setVariable ["script3Started", true]; }; }; -
Activate Three scripts per trigger at different times
Schatten replied to Coladebote's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Coladebote, trigger condition: (this and { !(thisTrigger getVariable ["script1Started", false]) }) or { ((player distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) } } or { ((player distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) } } on activation: if (!(thisTrigger getVariable ["script1Started", false])) then { execVM "scripts\scripts_1.sqf"; thisTrigger setVariable ["script1Started", true]; }; if (((player distance thisTrigger) < 50) and { !(thisTrigger getVariable ["script2Started", false]) }) then { execVM "scripts\scripts_2.sqf"; thisTrigger setVariable ["script2Started", true]; }; if (((player distance thisTrigger) < 10) and { !(thisTrigger getVariable ["script3Started", false]) }) then { execVM "scripts\scripts_3.sqf"; thisTrigger setVariable ["script3Started", true]; }; Seems that creating 3 triggers can be simpler. -
Delete Marker <nul> in a array
Schatten replied to eldarius's topic in ARMA 3 - MISSION EDITING & SCRIPTING
How exactly do you run it? You should pass path to a file: execVM "myCode.sqf"; -
Delete Marker <nul> in a array
Schatten replied to eldarius's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I guess you need this: _marker = allMapMarkers select (allMapMarkers findIf { (markerColor _x) == "ColorOPFOR" }); -
Nearest marker from player
Schatten replied to Sayker's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sure, call { private ["_distance", "_distanceMin", "_marker"]; _marker = ""; _distanceMin = worldSize; { if (((getMarkerColor _x) == "ColorOPFOR") and { _distance = (getMarkerPos _x) distance2D player; (_distance >= 400) and { _distance < _distanceMin } }) then { _distanceMin = _distance; _marker = _x; }; } forEach allMapMarkers; _marker }; -
Nearest marker from player
Schatten replied to Sayker's topic in ARMA 3 - MISSION EDITING & SCRIPTING
distance2D can accept objects, so you don't need to get position in advance. How did you test? If you just copy and paste the code into console, then it won't work. Instead you should wrap it: call { private ["_distance", "_distanceMin", "_marker"]; _marker = ""; _distanceMin = worldSize; { _distance = (getMarkerPos _x) distance2D player; if ((_distance >= 400) and { _distance < _distanceMin }) then { _distanceMin = _distance; _marker = _x; }; } forEach allMapMarkers; _marker }; -
Nearest marker from player
Schatten replied to Sayker's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Sayker, something like this: private ["_distance", "_distanceMin", "_marker"]; _marker = ""; _distanceMin = worldSize; { _distance = (getMarkerPos _x) distance2D player; if ((_distance >= 400) and { _distance < _distanceMin }) then { _distanceMin = _distance; _marker = _x; }; } forEach allMapMarkers; ? -
creation of trigger condition destroy or incapacited tank
Schatten replied to SGT Major Ray Jefferson's topic in ARMA 3 - MISSION EDITING & SCRIPTING
([tank1, tank2, tank3, tank4] findIf { (damage _x) >= 0.8 }) >= 0 ({ (damage _x) >= 0.8 } count [tank1, tank2, tank3, tank4]) == 2 ({ (damage _x) >= 0.8 } count [tank1, tank2, tank3, tank4]) == 3 ([tank1, tank2, tank3, tank4] findIf { (damage _x) < 0.8 }) < 0 -
How do I get a count of mines in a given area?
Schatten replied to Luft08's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Luft08, use this code: #define MARKER "markerName" private _markerSize = getMarkerSize MARKER; private _radius = if ((markerShape MARKER) == "RECTANGLE") then { sqrt ((_markerSize select 0) ^ 2 + (_markerSize select 1) ^ 2); } else { selectMax _markerSize; }; private _minesCount = { _x inArea MARKER } count ((getMarkerPos MARKER) nearObjects ["APERSBoundingMine_Range_Ammo", _radius]); -
BIS_fnc_holdActionAdd dynamic title
Schatten replied to gc8's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@gc8, BIS_fnc_holdActionAdd returns action ID. I'm sure you can use it to change the title using setUserActionText command. -
1 person view in town
Schatten replied to Casio91Fin's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Casio91Fin, condition: this && { (vehicle player) in thisList } && { cameraView == "EXTERNAL" } On activation: (vehicle player) switchCamera "INTERNAL"; titleText ["You are\nIN\n1stPV Area!", "PLAIN DOWN", 3];- 1 reply
-
- 2
-
Access variable from MPeventhandler "MPKilled" - Help Needed
Schatten replied to pSiKO's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@pSiKO, if you kill someone from a vehicle, _killer will be the vehicle. You can use this workaround: params ["_unit", "_killer", "_instigator"]; if (!(isNull _instigator)) then { _killer = _instigator; } else { if (!(_killer isKindOf "CAManBase")) then { _killer = effectiveCommander _killer; }; }; -
Force eject all non-crew from vehicle
Schatten replied to Aurora152's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_spawn isn't available inside "On deact." field, but you can save action ID in the trigger object: - On act.: thisTrigger setVariable ["actionId", player addAction ["Spawn Units", "spawn.sqf"]]; - On deact.: _actionId = thisTrigger getVariable ["actionId", -1]; if (_actionId >= 0) then { player removeAction _actionId; }; -
Issues with fleeing squads
Schatten replied to redarmy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@redarmy, unfortunately, you need to write a script that will monitor each unit in a group and order those of them to return to initial position. Here is example: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/0554cc7aabc300d2a92a85df361ad5e1dba140db/server/functions/defendArea.sqf#L78