Search the Community
Showing results for tags 'holdAction'.
Found 12 results
-
help simulating "Dual key lock" with Hold actions
Tochka-U posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Intention and some context: I'm making a mission where the players (Multiplayer) need to open a door using a "Dual key lock" Mechanism (like those nuclear launch mechanisms where two keys must be turned at the same time to launch). I believe the best way to go about this is two Holdactions on two separate terminals (KeyReader_North / KeyReader_South in this instance) each activating a variable (VarNorth / VarSouth) and a trigger to check if they're both active at the same time. I've also tried putting a small delay after the Holdaction activates its variable before it turns it back off and resets. [ KeyReader_North, "Scan Card", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "_this distance _target < 3", "'Wallet_ID' in ((vestItems _caller) + (uniformItems _caller) + (backpackItems _caller))", //Checks if the player has a "Keycard" {}, {}, {_this call Gut_fnc_NorthKey;}, //calls the function to confirm the other variable is activated or to reset the action {}, [], 1, 1000, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, KeyReader_North]; [ KeyReader_South, "Scan Card", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "_this distance _target < 3", "'Wallet_ID' in ((vestItems _caller) + (uniformItems _caller) + (backpackItems _caller))", {}, {}, {_this call Gut_fnc_SouthKey;}, {}, [], 1, 1000, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, KeyReader_South]; Gut_fnc_SouthKey = { //Im not exactly sure if im using functions correctly, kinda my first time trying them out VarSouth = true; Sleep 5; if(VarNorth == true) exitWith {true}; VarSouth = False; [ KeyReader_South, "Scan Card", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "_this distance _target < 3", "'Wallet_ID' in ((vestItems _caller) + (uniformItems _caller) + (backpackItems _caller))", {}, {}, {_this call Gut_fnc_SouthKey;}, {}, [], 1, 1000, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, KeyReader_South]; }; Gut_fnc_NorthKey = { VarNorth = true; Sleep 5; if(VarSouth == true) exitWith {true}; VarNorth = False; [ KeyReader_North, "Scan Card", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_arrow_up_ca.paa", "_this distance _target < 3", "'Wallet_ID' in ((vestItems _caller) + (uniformItems _caller) + (backpackItems _caller))", {}, {}, {_this call Gut_fnc_NorthKey;}, {}, [], 1, 1000, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, KeyReader_North]; }; The problem I cant figure why, but the holdactions work as intended separately but I cant get them to activate simultaneously. I activate one, then turn to activate the other and see the holdaction icon but I cannot actually activate it until the function runs its course. -
mulitplayer scripting Executing holdAction on a dedicated server
Lukas Lee posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello guys, I have a strange problem with the following script: tsk = format ["tsk%1", random 100]; [allPlayers, tsk, ["Hack the watchtower to get information about the position of the opposing players!", "Watchtower", ""], laptop, "ASSIGNED", 99, true, "download", true] call BIS_fnc_taskCreate; [laptop, "Activate watchtower", "\a3\ui_f\data\igui\cfg\holdactions\holdaction_connect_ca.paa", "\a3\ui_f\data\igui\cfg\holdactions\holdaction_connect_ca.paa", "player distance laptop < 5", "player distance laptop < 3", {num = execVM "watchtower\durring.sqf";}, {}, {nul = execVM "watchtower\gegner_markieren_v3.sqf", nul = execVM "watchtower\sleep.sqf", [tsk, "SUCCEEDED", true] remoteExec ["BIS_fnc_taskSetState", 0, true], sleep 0.1, [tsk, allPlayers, true] remoteExec ["BIS_fnc_deleteTask", 0, true];}, {["Hacking canceled!"] remoteExec ["hintSilent", 0, true], sleep 1; [""] remoteExec ["hintSilent", 0, true], call{playSound "cancel";}, execVM "watchtower\deletion_sound.sqf";}, [], 15, 0, true, false] remoteExec ["bis_fnc_holdactionadd", 0, true]; With the script I add a holdaction function to a laptop. When I start the mission in the Eden editor in singleplayer or multiplayer everything works as it should. The script is executed by the init.sqf and the holdaction function is displayed on the laptop. When I complete it with the spacebar it disappears again as it should. However, when I host the mission on my dedicated Arma server, the holdaction appears twice for some reason. Once with text and once without. Both run the same code when I use it and then disappear, but reappearing twice when I run the script again. Can any of you help me further? And tell me why this happens? Thanks- 10 replies
-
- holdaction
- arma3
-
(and 4 more)
Tagged with:
-
Hostage Script (Using HoldAction Function) - Download
GalacticTwinkles posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys! First script I've ever put up on the forums, but as far as I know no one has posted a hostage script using the new HoldAction function. I needed it for a mission and figured it may be helpful to some! I'm not sure if it works in MP yet, 2 AM so I haven't gotten to test.Tested and working in MP! For me anyway. Any bugs or blatant mis-coding, let me know! Features: Random hostage animation. AI joins player group after release. Uses Arma 3 Hostage Icons. Multiplayer Compatible (JIP should work too) Random interruption and completion dialogue from hostage. Nothing too fancy! Just simple. INSTRUCTIONS/CODE: SCRIPT: For use on units spawned via script, see @davidoss's wonderful example right here. Changelogs: For those who just want a download link: DOWNLOAD HERE (Google Drive)- 22 replies
-
- 13
-
bis_fnc_holdactionadd BIS_fnc_holdActionAdd Appear several times
Lucas28XD posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Script Example (which I use in my mission): [ Truck, "<t color='#58D68D'>Enganchar UH60</t>", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa", "(_this distance _target < 3) && (Truck_Bar distance Heli_1 < 10)", "(_Caller distance _target < 3) && (Truck_Bar distance Heli_1 < 10)", {}, {}, { null = ["Scripts\Interacciones\Remolcador\Soltar_Heli_1.sqf","BIS_fnc_execVM",false,false] spawn BIS_fnc_MP; [Truck,_actionId] call BIS_fnc_holdActionRemove; }, {}, [], 5, 6, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, Truck]; ____________________________________________________________________________________________________________________ When I put this Script in my Init.sqf file, one appears every time a player joins my dedicated server. Is there a way to fix that? the problem is where do I put my script? or is it a typical Arma 3 problem? -
BIS_fnc_holdActionAdd with сondition
Anteq Iney posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I need a script that will display my holdaction if the player has an item in his inventory. My script that doesn't work: if (playerside == west) then { { [_x,"<t color='#FFAA00'>Remove!</t>", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa", "_this distance _target < 4", "(_caller distance _target < 4) && ("ToolKit" in items _caller)", {[_target, "wire_s",100] spawn CBA_fnc_globalSay3d;}, {}, {deleteVehicle _target;}, {}, [], 9, 0, true, false] call BIS_fnc_holdActionAdd; } forEach wire; }; Arma writes that there is an error in the line: "(_caller distance _target < 4) && ("ToolKit" in items _caller)", Where is the error and why it doesn't work?- 3 replies
-
- bis_fnc_holdactionadd
- holdaction
-
(and 6 more)
Tagged with:
-
Im creating a multiplayer mission where i want that only the pilot of a chopper can use a certain BIS_fnc_holdActionAdd. Several things are confusing me. First i have a container with following code in the init line: I actually expected that the pilot would now see the enty several times, one entry for each player. But to my happy suprise the pilot can only see the entry once. So this is the first thing i can't understand. But it keeps getting more confusing. Once the pilot completes the hold action, a script gets started (rearm.sqf). In this script a new hold action gets created in exactly the same way as the first one: this time suddenly the action gets added once for every player. Why does it behave different this time? I then decided to change my script. I try to get the id of the player who is controlling the pilot: pilotID = 0; pilotID = owner heli1D; I made two tests. The first time the host was playing heli1D. in that case pilotID was 2. Why was the pilotID 2? The host wasn't able to see the holdAction (he should have been). Second test the clients controlls heli1D. pilotID is 2 again. the client can see the hold action and it also got added only once. Again i don't understand whats going on. Im totally confused now. Help would be highly appreaciated.
- 2 replies
-
- locality
- holdaction
-
(and 1 more)
Tagged with:
-
Break down blocked doors/windows using holdAction?
JoMiMi posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Is there a way using holdAction to delete obstacles (e.g. Shoothouse Wall (long)) in the way of doors/windows? I am very inexperienced in scripting, and I couldn't figure out how to do it myself. -
Guys I have this hold action set up to revive downed team mates. My issues are: 1) How can I reduce the completion time if the caller is a medic? 2) Can I cancel the holdAction with a hint if the caller has no FirstAidKits? (I want the hold action to show even if the caller does not have the firsAidKit, I just want the hold action to exit with a hint, would if ((({""FirstAidKit"" == _x} count (items _caller))<1)) exitWith {hint "You need a firstAidKit";} work inside the conditionProgress field? Thank you!
- 15 replies
-
- holdaction
- addaction
-
(and 1 more)
Tagged with:
-
Optimizing holdAction for performance & Multiplayer
LSValmont posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello A3 Community! Since there is no topic on HoldAction optimization and tweaking I wanted to create one so we could perhaps answer some questions and share our findings. I love the holdActions implementation in Arma 3 far better than addAction but there is always the concern about performance and multiplayer compatibility. My first question would be: 1) Are Lazy evaluation/Successive condition check doable and beneficial for holdAction conditions and if so how could I implement it and optimize this example holdAction: The holdAction is added to the players and displayed when the conditions are met. The script that adds the holdAction is executed from init.sqf: nul = [] execVM "vTakeDown.sqf"; The conditions are: I worry that these many conditions might affect performance specially when adding other similar player holdActions but targeting only civilians etc. Question nber 2: How many holdActions can we add to a player before it starts lagging things out for that particular client?- 5 replies
-
- 1
-
- holdaction
- multiplayer
-
(and 1 more)
Tagged with:
-
Newbie need help with creating global objects
Eblonski posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi there. First of all sorry for my poor English. So, i just started "scripting" things for Arma3 and i faced with problem of creating object by client globally. Basic idea was to build the bridge by holding button, but when i hosting a server i (the server ) can make my script work, but not friend of mine (client). With that problem i tried many different solutions like HideObject, then making it's "false" in the body of "holdAction". Here is my code now, holdAction : if (!isDedicated) then { if (playerSide == west) then { [ planks_s, // Object "Construct bridge", // Title "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa", "(_this distance _target < 5)", "(_this distance _target < 5)", {}, {}, { [] spawn {[] execVM "PlankSimple_S.sqf"}}, // Code executed on completion {}, [], 3, // how long 0, true, false ] call BIS_fnc_holdActionAdd; }; }; And here's my file "PlankSimple_S.sqf" : if (isServer) then { _simpleObject_0 = createSimpleObject ['a3\structures_f_exp\civilian\accessories\plank_01_8m_f.p3d', [5613.273926,4128.347168,13.888593]]; _simpleObject_0 setVectorDirAndUp [[-0.857715,-0.499353,-0.122361],[-0.114261,-0.0469019,0.992343]]; _simpleObject_1 = createSimpleObject ['a3\structures_f_exp\civilian\accessories\plank_01_4m_f.p3d', [5618.109863,4131.231934,14.0554686]]; _simpleObject_1 setVectorDirAndUp [[-0.84041,-0.514142,0.171377],[0.155349,0.0744123,0.985053]]; _simpleObject_2 = createSimpleObject ['a3\structures_f_exp\civilian\accessories\plank_01_8m_f.p3d', [5608.121094,4125.246094,13.159078]]; _simpleObject_2 setVectorDirAndUp [[-0.854349,-0.503035,-0.130551],[-0.151054,0,0.988526]]; }; So once again. I need to make it work globally on server to every client. Thanks in advance. And once again, sorry for my English. -
Hi guys. I want to create a healing script using Hold Actions. I was wondering which method is best performance-wise. 1. Adding the hold actions to all individual units, with a straightforward conditionShow (see the Hold actions description): "alive _target && _target distance _this < 5 && getDammage _target > 0" in the above code, _target is the unit the action is attached to and _this is the caller (i.e player). Also, the action is removed every time it's added, so it might be applied to each unit multiple times during a game session. This code is simple if added to just one unit. However, there will be too many of these if there are lots of units (I'm aiming for +60!). 2. Adding only one action and to the player, but modifying the conditionShow as follows: "call {_units = applicableUnits select {alive _x && _x distance _target < 5 && ([visiblePosition _target, getDir _target, 60, visiblePosition _x] call BIS_fnc_inAngleSector) && (getDammage _x > 0)}; if (count _units > 0) then {_unit = _units select 0; _target setVariable ['target', _unit]; true} else {false}}" in the above code, _target is the same as the caller (i.e player), and applicableUnits is an array of applicable units! The reason for adding the "target" variable is here: This code is obviously more demanding, especially if it's run on each frame (which I'm assuming it is).
-
Using Hold Actions on hidden units (i.e hide unit without hideObject)
Leopard20 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello everyone. Does anyone know a way to add hold actions to hidden units? Unfortunately, when a unit is hidden using hideObject the action doesn't appear anymore. However, if there was a way to hide the unit without using hideObject it would work. My first idea was to use setObjectTexture, but it doesn't hide the unit completely (the unit's face and arms are still visible)