Jump to content

shuko

Member
  • Content Count

    2231
  • Joined

  • Last visited

  • Medals

Everything posted by shuko

  1. Change _this addaction to _x addaction
  2. Well, I did say it's an unfinished and untested.
  3. Let's start with these: To disable the automatic reset of the targets, put this into init.sqf nopop = true; After that, you can operate the targets with animate command targetObject animate["terc", 0]; // up targetObject animate["terc", 1]; // down
  4. I must be blind or just slow, but why not just do addAction on the vehicle(s)?
  5. I can't think anything worse than someone else playing a mission I've created.
  6. Disclaimer: I never used the script in this thread. However, I kind of rewrote the whole thing to include a queue system, and made the AI group members follow the human group leader once he ropes down. Example I tried to add a feature to be able to FT full AI group from AI chopper, but there's some kind of deep link between the units, because even if the chopper is not in the same group, it will still land as soon as the first guy is moved outside the chopper. Due to lack of time, I haven't had time to finish this. That basically means going through all the rope attachment points for all helos and adding door names. Adding custom chopper is rather simple. If the model is based on BIS, just add the name to the correct array. If it's a custom one, make a new line and tweak the attachment points. If someone wants to, please, feel free to use it anyway you like. /* SHK_Fastrope by Shuko (LDD Kyllikki) Version 1.0 Inspired by v1g Fast Rope by [STELS]Zealot (modified by TheRick for Altis Life) */ #define MAX_ALTITUDE_ROPES_AVAIL 70 #define MIN_ALTITUDE_ROPES_AVAIL 5 #define MAX_SPEED_ROPES_AVAIL 50 #define STR_TOSS_ROPES "Toss Ropes" #define STR_FAST_ROPE "Fast Rope" #define STR_CUT_ROPES "Cut Ropes" #define STR_JOIN_QUEUE_HINT "You're in the fast-rope queue." // [["TypeName1","TypeName2"],["Door_L","Door_R"],[[ropeAttachPosition1],[ropeAttachPosition2]]] SHK_Fastrope_Helis = [ [["B_Heli_Light_01_F"],[],[[1.1,0.5,-0.5],[-1.1,0.5,-0.5]]], [["B_Heli_Transport_01_F","B_Heli_Transport_01_camo_F","RHS_UH60M","RHS_UH60M_d","CAF_CH146_F_D","CAF_CH146_SF","ST1_UH_80_MED_FG"],["door_L","door_R"],[[-1.11,2.5,0],[1.11,2.5,0]]], [["B_Heli_Transport_03_F","B_Heli_Transport_03_unarmed_F","CFB_Helo_Chinook"],["Door_rear_source"],[[-1.35,-4.6,-0.5],[1.24,-4.6,-0.5]]], //Side doors: "Door_L_source","Door_R_source" [["O_Heli_Transport_04_covered_F"],["Door_4_source","Door_5_source"],[[1.3,1.3,-0.1],[-1.5,1.3,-0.1]]], [["O_Heli_Attack_02_F","O_Heli_Attack_02_black_F"],[],[[1.3,1.3,0],[-1.3,1.3,0]]], [["O_Heli_Light_02_unarmed_F","O_Heli_Light_02_F"],[],[[1.35,1.35,0],[-1.45,1.35,0]]], [["I_Heli_light_03_unarmed_F","CFB_Helo_Griffon_Unarmed"],[],[[0.7,2.5,0],[-0.9,2.5,0]]], [["I_Heli_Transport_02_F"],["Door_Back_L","Door_Back_R"],[[0,-5,0]]] ]; // Check if the player is allowed to drop the ropes SHK_Fastrope_fnc_canCreate = { private ["_heli","_alt","_flag"]; _heli = objectParent player; _alt = (getPosATL (_heli) select 2); _flag = (_alt < MAX_ALTITUDE_ROPES_AVAIL) && (_alt > MIN_ALTITUDE_ROPES_AVAIL) && ((abs (speed _heli)) < MAX_SPEED_ROPES_AVAIL) && (count (_heli getVariable ["SHK_Fastrope_Ropes",[]]) == 0) && (_heli getCargoIndex player >= 0); _flag }; SHK_Fastrope_fnc_createRopes = { params ["_heli","_ropesPos","_ropesObj","_rope"]; _heli = objectParent player; _ropesPos = _heli getVariable ["SHK_Fastrope_Ropes",[]]; // Ropes already exist if (count _ropesPos > 0) exitWith {}; { if (typeOf _heli in (_x select 0)) exitWith { // Open doors { _heli animateDoor [_x,1]; } forEach (_x select 1); // Rope attach positions _ropesPos = (_x select 2); }; } forEach SHK_Fastrope_Helis; // Create ropes _ropesObj = []; { _rope = ropeCreate [_heli, _x, (getPosATL player select 2) + 3]; _ropesObj pushBack _rope; } forEach _ropesPos; _heli setVariable ["SHK_Fastrope_Ropes", _ropesObj, true]; _heli setVariable ["SHK_Fastrope_Queue", [], true]; // Destroy ropes if chopper moves too fast _heli spawn { params ["_heli","_ropes"]; waitUntil {_ropes = (_heli getVariable ["SHK_Fastrope_Ropes",[]]); abs (speed _heli) > MAX_SPEED_ROPES_AVAIL || (count _ropes == 0)}; call SHK_Fastrope_fnc_cutRopes; }; }; SHK_Fastrope_fnc_cutRopes = { params ["_heli","_ropes"]; _heli = objectParent _heli; _ropes = _heli getVariable ["SHK_Fastrope_Ropes",[]]; { ropeCut [_x,0]; } forEach _ropes; _heli setVariable ["SHK_Fastrope_Ropes", [], true]; _heli setVariable ["SHK_Fastrope_Queue", [], true]; // Close doors { if (typeOf _heli in (_x select 0)) exitWith { { _heli animateDoor [_x,0]; } forEach (_x select 1); }; } forEach SHK_Fastrope_Helis; }; SHK_Fastrope_fnc_fastRope = { params ["_unit","_rope"]; [_unit,_rope] spawn { // Wait for the unit to be move out of the chopper. params ["_unit","_rope","_ropePos","_heli"]; _heli = objectParent _unit; waitUntil {isNull objectParent _unit}; if (local _unit) then { _unit leaveVehicle _heli; _unit allowDamage false; _ropePos = (ropeEndPosition _rope) select 0; _unit setPosATL [(_ropePos select 0),(_ropePos select 1),(_ropePos select 2)-0.5]; _unit switchMove "LadderRifleStatic"; _unit setDir ([_heli,_unit] call BIS_fnc_dirTo); //_unit setDir (_unit getDir _heli); // Arma 3 version 1.55+ _unit spawn { params ["_unit"]; while {alive _unit && (((getPos _unit) select 2) > 1.5)} do { _unit setVelocity [0,0,-8]; }; _unit setVelocity [0,0,0]; _unit playMove "LadderRifleDownOff"; _unit allowDamage true; }; }; }; moveOut _unit; sleep 1.3; }; SHK_Fastrope_fnc_processQueue = { params ["_heli","_queue","_ropes","_count","_rope",["_i",0]]; _heli = objectParent player; _queue = _heli getVariable ["SHK_Fastrope_Queue",[]]; _ropes = _heli getVariable ["SHK_Fastrope_Ropes",[]]; _count = count _ropes; waitUntil {_queue find player == 0}; hintSilent ""; { // Player or an AI in player's group if (_x == player || (group _x == group player && !isPlayer _x)) then { _queue = _queue - [_x]; if (_count > 0) then { if (_count == 2) then { _rope = _ropes select _i; if (_i == 0) then { _i = 1 } else { _i = 0 }; } else { _rope = _ropes select 0; }; [_x,_rope] call SHK_Fastrope_fnc_fastRope; }; }; } forEach _queue; _heli setVariable ["SHK_Fastrope_Queue", _queue, true]; }; SHK_Fastrope_fnc_queueUp = { params ["_heli","_queue"]; _heli = objectParent player; _queue = _heli getVariable ["SHK_Fastrope_Queue",[]]; _queue pushBack player; hintSilent STR_JOIN_QUEUE_HINT; // If the player is a group leader, queue up his subordinate AIs if (player == leader group player) then { { if (!isPlayer _x && vehicle _x == vehicle player) then { _queue pushBack _x; }; } forEach (units group player); }; _heli setVariable ["SHK_Fastrope_Queue", _queue, true]; _heli spawn SHK_Fastrope_fnc_processQueue; }; player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", SHK_Fastrope_fnc_createRopes, [], -1, false, false, '','call SHK_Fastrope_fnc_canCreate']; player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", SHK_Fastrope_fnc_cutRopes, [], -1, false, false, '','count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0']; player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", SHK_Fastrope_fnc_queueUp, [], 15, false, false, '','!(player in (objectParent player getVariable ["SHK_Fastrope_Queue",[]])) && (count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0) && ((getPosATL (objectParent player) select 2) < MAX_ALTITUDE_ROPES_AVAIL)'];
  7. player addAction ["Text1", "script.sqf", [myVar1,myVar2]]; or myVars = [myVar1,myVar2]; player addAction ["Text1", "script.sqf", myVars]; script.sqf _myVars = _this select 3; _myVar1 = _myVars select 0; _myVar2 = _myVars select 1;
  8. Using player is perfectly fine as long as you know what you are doing. Unless you can prove otherwise? One way could be saving the sides into the box: _box setVariable ["COOLTAG_Side",_side]; _box addAction [format["<t color='#FF0000'>%1</t>",(_descname select _i)], spawn_object ,[(_type select _i),(_items select _i),(_magazines select _i),(_backpacks select _i),(_weapons select _i),_spawnpoint],6, false, true, "","player distance _target < 5 && (side player in (_target getVariable 'COOLTAG_Side'))"];
  9. Is the mentioned performance difference huge?
  10. I've been using this. for [{_i = 0},{_i < count(paramsArray)},{_i = _i + 1}] do { call compile format ["PARAMS_%1 = %2",(configName ((missionConfigFile >> "Params") select _i)),(paramsArray select _i)]; }; Which will turn the follow. class Params { class TimeLimit { title = "Time limit"; values[] = {1800,2700,3600,0}; texts[] = {"30 minutes", "45 minutes", "60 minutes", "No limit"}; default = 2700; }; Into PARAMS_TimeLimit variable.
  11. Did you try it with and without RHS AFRF?
  12. You are correct, init fields are processed before init.sqf. Name the boat and run the script from init.sqf: [NameOfTheBoat, boatPatrolWPPool] execVM "scripts\moveToRandomFromPool.sqf"; Of course, nothing prevents you from moving that array definition to the boat's init field.
  13. case 0: { // Open terminal [_object,3] call BIS_fnc_dataTerminalAnimate; sleep 2; with uiNamespace do { disableSerialization; _object setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"]; 1100 cutRsc ["RscMissionScreen","PLAIN"]; _scr = BIS_RscMissionScreen displayCtrl 1100; _scr ctrlSetPosition [-10,-10,0,0]; _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv"; _scr ctrlAddEventHandler ["VideoStopped", { (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1; }]; _scr ctrlCommit 0; }; sleep 5; _object setVariable ["KDK_TerminalStatus",1,true]; }; I moved the setVariable to the end of the case. Before that I added five second sleep. Change the time to whatever you want.
  14. Add it to the case 1: case 1: { // Use terminal _object setVariable ["KDK_TerminalStatus",2,true]; [] execvm "lights.sqf"; };
  15. Init field of the terminal: this addAction ["Open Terminal","terminal.sqf",0,2,true,true,"","(_target getVariable ['KDK_TerminalStatus',0]) == 0"]; this addAction ["Use Terminal","terminal.sqf",1,2,true,true,"","(_target getVariable ['KDK_TerminalStatus',0]) == 1"]; this addAction ["Close Terminal","terminal.sqf",2,2,true,true,"","(_target getVariable ['KDK_TerminalStatus',0]) == 2"]; terminal.sqf in the mission folder: params ["_object","_state"]; _state = _this select 3; switch _state do { case 0: { // Open terminal _object setVariable ["KDK_TerminalStatus",1,true]; [_object,3] call BIS_fnc_dataTerminalAnimate; sleep 2; with uiNamespace do { disableSerialization; _object setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"]; 1100 cutRsc ["RscMissionScreen","PLAIN"]; _scr = BIS_RscMissionScreen displayCtrl 1100; _scr ctrlSetPosition [-10,-10,0,0]; _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv"; _scr ctrlAddEventHandler ["VideoStopped", { (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1; }]; _scr ctrlCommit 0; }; }; case 1: { // Use terminal _object setVariable ["KDK_TerminalStatus",2,true]; }; case 2: { // Close terminal _object setVariable ["KDK_TerminalStatus",0,true]; [_object,0] call BIS_fnc_dataTerminalAnimate; }; }; exampleMission Someone smarter can help you how to stop the video(sound) when closing the terminal before the video has ended. I'm not familiar with the resources and controls.
  16. Yes, it would replace the: [[this,["Open","DataTerminal\OpenTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;
  17. Visual Code has SQF support now as well. I've been trying it out lately, after years of Notepad++ing. https://code.visualstudio.com/
  18. I would use the condition parameter of the addAction command to control when to display the actions. As condition, I'd use a simple status or state variable saved to the terminal object. General idea: this addAction ["Open",......,"(_target getVariable ['KDK_TerminalStatus',0]) == 0"]; this addAction ["Do something while its open",......,"(_target getVariable ['KDK_TerminalStatus',0]) == 1"]; this addAction ["Close",......,"(_target getVariable ['KDK_TerminalStatus',0]) == 2"]; openScript: _object setVariable ["KDK_TerminalStatus",1,true]; inBetweenScript: _object setVariable ["KDK_TerminalStatus",2,true]; closeScript: _object setVariable ["KDK_TerminalStatus",0,true]; This way you wont even need to bother with the add/removeAction via fnc_MP. Condition-method is perfect for few actions, but I wouldn't use it if you are planning on having a huge number of actions. But it also easily enables you to have multiple actions available at the same time, in any combination.
  19. Well, if you can confirm it. Then create a fresh new mission to show it. That will make it easier to track down the bug.
  20. You don't remove a string from an array, but you subtract an array (which happens to contain the string) from the original array. https://community.bistudio.com/wiki/Array#Subtraction
  21. Taskmaster works. BIS functions work as long as you get the latest hotfix (Dec 3rd). I'd figure out what funny business is going on in the mission instead of just trying yet another system. Taskmaster does not require BIS functions (basic commands yes, but not the functions). BIS functions/task framework does not require Taskmaster. There's nothing by design in Taskmaster that should affect BIS functions.
  22. The Taskmaster was made before BIS created it's own task framework and modules. You can either use the Taskmaster or use BIS functions.
  23. Nope, this was all I got from Dwarden when I reported it: "thanks, known issue, already fixed issue in script, part of planned hotfix". Most likely Soonâ„¢ or When It's Readyâ„¢ like everything in gaming.
  24. BIS_fnc_taskCreate is bugged at the moment (post-patch). I does no longer accept boolean as the first argument (units the task should be created for). It's known by BIS, and fix is already in a planned hotfix.
×