-
Content Count
816 -
Joined
-
Last visited
-
Medals
Everything posted by Schatten
-
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 -
"or" in trigger condition
Schatten replied to Alert23's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Alert23, OR has lower priority than AND, so you should use brackets to increase priority: this && vehicle player in thislist && ((a1 inArea trg1) or (b1 inArea trg1)) I recommend to use curly brackets for lazy evaluation: this && { (vehicle player) in thislist } && { (a1 inArea trg1) or { b1 inArea trg1 } } -
How to make specific corpses not despawn or get cleaned up?
Schatten replied to SOVIET_IDIOT's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@SOVIET_IDIOT, strange -- I've just checked it in simple SP mission and it works fine. In the mission I enabled GC, place 2 enemy units, removed the one from GC and kill them -- the one disappeared, but the second didn't. Seems you made mistake somewhere. Try to use isInRemainsCollector command to check. -
Proper way to select a random position in marker
Schatten replied to redarmy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@redarmy, try this: for "_i" from 1 to 6 do { art1 doArtilleryFire [[["hj"], []] call BIS_fnc_randomPos, "32Rnd_155mm_Mo_shells", 1]; sleep 5; }; -
How to make specific corpses not despawn or get cleaned up?
Schatten replied to SOVIET_IDIOT's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@SOVIET_IDIOT, use removeFromRemainsCollector command. -
If Unit Not alive End Mission (trigger) [SOLVED]
Schatten replied to ziptlytical's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@ziptlytical, try this condition: this and { !(alive officer1) } -
Which Condition, recognizes the item within the vehicle inventory?
Schatten replied to snakeplissken's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@snakeplissken, try this: "Flashdrive" in (magazineCargo SUV) -
Adding image to background control in dialog
Schatten replied to sagent54's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's difficult to explain short. I recommend you read about dialogs here. Also there are nice tutorials written by @killzone_kid, first part here.