fight9
Member-
Content Count
382 -
Joined
-
Last visited
-
Medals
Everything posted by fight9
-
Marksman content in Mission ?
fight9 replied to R34P3R's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What happens if you spawn with a DLC rifle or one gets added via script? -
Multiplayer addAction execute global not working?!?! Please Help
fight9 replied to GODSPEEDSNAKE's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yup, I put a random extra parameter in there... fixed for future purposes. -
Multiplayer addAction execute global not working?!?! Please Help
fight9 replied to GODSPEEDSNAKE's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This will run the script globally, inlcuding JIP. nuke_action = nuke addAction[ "Shut Down Nuke", { 0 = ["scripts\mission\nukeactivated.sqf","BIS_fnc_execVM",true,true] call BIS_fnc_MP; }, nil, 6, True, True, "", "(_target distance _this) < 2" ]; -
Local Headless client problem
fight9 replied to total's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Your if-then condition to run the script is the same to exit the script. You are running the script, then exiting immediately. if !(hasInterface or isServer) then { //... if !(hasInterface or isServer) exitwith {}; Remove that top line of Spawn1.sqf. -
How to hook an Quadbike onto the back of an Offroad.
fight9 replied to Warnerm14's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Short of making it dynamic (any offroad and quad), the attachTo command is all you need. quad1 attachTo [offroad1,[0,1,1]; The numbers will have to be adjust to get it right... Trial and error on that. Wrap that in an addAction and you are set. offroad1 addAction ["Place Quad",{ quad1 attachTo [offroad1,[0,1,1]; }]; Use another addAction, detach, & setPos to remove the quad. -
Take a look at this... might just be what you are looking for. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Loaded
-
Check for locality before creating the resource.
-
Pickup a Suitcase, laptop or moneypile?
fight9 replied to tmvbj83's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Unfortunately, stuff like that is not configured to be placed in the inventory - at least not in vanilla Arma 3. That's why you always see the "fancy task" being done. -
Use a respawn eventHandler to run the function again. player addEventHandler ["respawn",{ _null = (_this select 0) call fnc_MyCamera; }];
-
Using triggerAttachVehicle to sync a Trigger to a Group
fight9 replied to travhimself's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is how you create variables dynamically. call compile format ["myGroup_%1 = createGroup WEST;",count]; Format creates the dynamic string. Compile turns it into code. Then call... well it calls that code. -
Oh missed that part side _unit == east // or typeOf _unit == "classname"
-
nul = _unit execVM "AAF_Ammo.sqf"; Same with other one. Also, you have an extra ";" before your "else".
-
Your taxi function will work the same... _this select 0 is arg1 _this select 1 is 2 _this select 2 is 3
-
That's because you are trying to give a true/false variable combat orders... the error message tells you that. [color="#FF8040"][color="#006400"][i]/* _this select 0: object - unit to follow _this select 1: bool - true = snipers, false = recon nul = [_unitname,true] execVM "NatoAI.sqf"; // spawn with fnc_findOverwatch || fnc_taskPatrol */[/i][/color] [color="#191970"][b]private[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"_unit"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_snipers"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_pos"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_cfg"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_msg"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_team1"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_team2"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// params [/i][/color] [color="#1874CD"]_unit[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_snipers[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// position and group[/i][/color] [color="#000000"]_pos[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]getPos[/b][/color] [color="#1874CD"]_unit[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_cfg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]configFile[/b][/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"CfgGroups"[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"West"[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"BLU_F"[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"Infantry"[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// spawn AI[/i][/color] [color="#1874CD"]_team1[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]grpNull[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_team2[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]grpNull[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_snipers[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_team1[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]west[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_cfg[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"BUS_SniperTeam"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_spawnGroup[color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_team2[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]west[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_cfg[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"BUS_SniperTeam"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_spawnGroup[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_team1[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]west[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_cfg[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"BUS_ReconTeam"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_spawnGroup[color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_team2[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color] [color="#000000"]west[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#1874CD"]_cfg[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"BUS_ReconTeam"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_spawnGroup[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// set behaviour[/i][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]setCombatMode[/b][/color] [color="#7A7A7A"]"YELLOW"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]setBehaviour[/b][/color] [color="#7A7A7A"]"AWARE"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]setSpeedMode[/b][/color] [color="#7A7A7A"]"LIMITED"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_team1[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_team2[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// set overwatch || patrol[/i][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_snipers[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]private[/b][/color] [color="#7A7A7A"]"_ow"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_ow[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]300[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]250[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]15[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_findOverwatch[color="#8B3E2F"][b];[/b][/color] [color="#000000"]_x[/color] [color="#191970"][b]move[/b][/color] [color="#1874CD"]_ow[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_team1[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_team2[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]private[/b][/color] [color="#7A7A7A"]"_fnc"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_fnc[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#000000"]_x[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]250[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_taskPatrol[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_team1[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_team2[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// send message[/i][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_snipers[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Nato Snipers providing Overwatch"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Nato Recon nearby"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// wait for all dead[/i][/color] [color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]5[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#191970"][b]alive[/b][/color] [color="#000000"]_x[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]count[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]units[/b][/color] [color="#1874CD"]_team1[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b]+[/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]units[/b][/color] [color="#1874CD"]_team2[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]=[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]0[/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_snipers[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Sniper teams eliminated"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Recon teams eliminated"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter EDIT: Optimized code a bit.
-
This would yield the same results as the my first post. _action = _helo addAction [ "Give LZ to Pilot", {_null = [color="#FF0000"](_this select 3)[/color] call taxi; _null = [] execVM "mapclick.sqf"}, [color="#FF0000"][arg1,2,3][/color], 0, true, "", "_this == player" ]; I made [arg1,2,3] the the third element of the addAction array, the arguments. That array becomes _this select 3 in the addAction code block. Send that array to your taxi function and presto...
-
Don't need a separate file. Just use execVM instead of just the quotations alone. _action = _helo addAction ["Give LZ to Pilot",{_null = [arg1, 2, 3] call taxi; _null = [] execVM "mapclick.sqf";}, "", 0, true, true, "", "_this == player"];
-
Try this... it uses createVehicle array with createVehicleCrew... The params allow you to try the FSM or BIS function, also. [color="#FF8040"][color="#006400"][i]/* _this select 0: object - unit to follow _this select 1: bool - true for UAV, false for UGV _this select 2: bool - true for FSM, false for fnc_taskPatrol nul = [_unitname,true,true] execVM "SpawnDrone.sqf"; // spawn UAV with FSM nul = [_unitname,false,false] execVM "SpawnDrone.sqf"; // spawn UGV with fnc_taskPatrol */[/i][/color] [color="#191970"][b]private[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"_unit"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_flying"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_patrol"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_pos"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_group"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_drone"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_fsm"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_fnc"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_msg"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// params [/i][/color] [color="#1874CD"]_unit[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_flying[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_patrol[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// position and group[/i][/color] [color="#000000"]_pos[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]getPos[/b][/color] [color="#1874CD"]_unit[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]_group[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createGroup[/b][/color] [color="#000000"]west[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// spawn drone[/i][/color] [color="#1874CD"]_drone[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]objNull[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_flying[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_drone[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"B_UAV_02_CAS_F"[/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]_pos[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b]([/b][/color][color="#000000"]_pos[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]+[/b][/color] [color="#FF0000"]150[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"FLY"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_drone[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createVehicle[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"B_UGV_01_rcws_F"[/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_pos[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b]([/b][/color][color="#000000"]_pos[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]+[/b][/color] [color="#FF0000"]10[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]_pos[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"NONE"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]createVehicleCrew[/b][/color] [color="#1874CD"]_drone[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// create crew for drone[/i][/color] [color="#006400"][i]// set behaviour[/i][/color] [color="#1874CD"]_drone[/color] [color="#191970"][b]setCombatMode[/b][/color] [color="#7A7A7A"]"RED"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_drone[/color] [color="#191970"][b]setBehaviour[/b][/color] [color="#7A7A7A"]"AWARE"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_drone[/color] [color="#191970"][b]setSpeedMode[/b][/color] [color="#7A7A7A"]"NORMAL"[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// set patrol type[/i][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_patrol[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_fsm[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_drone[/color][color="#8B3E2F"][b],[/b][/color][color="#1874CD"]_unit[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]200[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]execFSM[/b][/color] [color="#7A7A7A"]"droneFollow.fsm"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_fnc[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#191970"][b]group[/b][/color] [color="#1874CD"]_drone[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]200[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_taskPatrol[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// send message[/i][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_flying[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Nato UAV CAS inbound"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Nato UGV inbound"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// wait for 0 ammo or 0 fuel or dead[/i][/color] [color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]5[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]![/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]someAmmo[/b][/color] [color="#1874CD"]_drone[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]or[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]fuel[/b][/color] [color="#1874CD"]_drone[/color] [color="#191970"][b]isEqualTo[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]or[/b][/color] [color="#8B3E2F"][b]![/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]alive[/b][/color] [color="#1874CD"]_drone[/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]alive[/b][/color] [color="#1874CD"]_drone[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#006400"][i]// if alive[/i][/color] [color="#006400"][i]// send message[/i][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_flying[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"UAV returning to base for rearm/refit"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"UGV returning to base for rearm/refit"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// delete vehicle[/i][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]3[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]deleteVehicle[/b][/color] [color="#1874CD"]_drone[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#006400"][i]// if dead[/i][/color] [color="#006400"][i]// send message[/i][/color] [color="#191970"][b]if[/b][/color] [color="#1874CD"]_flying[/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"UAV destroyed"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]else[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#1874CD"]_msg[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"UGV destroyed"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"systemChat"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]false[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter edit: the "_group = createGroup west;" line is not needed... but KK's converter is hard to edit...
-
Look up the isClass command.
-
You might have to change the Z value of your position array. [(getPos player) select 0, (getPos player) select 1, ((getPos player) select 2) + 100] If you plan on using this mission for MP, then you might not want to use a trigger... They fire on every client. Alternatively, you could define who player should be in the condition. this && player == unit1
-
How to setup scoreboard for a coop mission to show all units killed/destroyed!
fight9 replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
self host: http://imacrepo.com/uploader/kH2TtB7qTt290NX/mpscore.jpg (149 kB) dedicated: https://community.bistudio.com/wiki/server.armaprofile class Difficulties { class Recruit { class Flags { 3rdPersonView = 1; armor = 1; autoAim = 0; autoGuideAT = 1; autoSpot = 1; clockIndicator = 1; deathMessages = 1; enemyTag = 0; friendlyTag = 1; hud = 1; hudGroupInfo = 1; hudPerm = 1; hudWp = 1; hudWpPerm = 1; map = 1; [color="#FF0000"][size=3][b]netStats = 1; // scoreboard setting[/b][/size][/color] tracers = 1; ultraAI = 0; unlimitedSaves = 1; vonID = 1; weaponCursor = 1; }; skillFriendly = 1; precisionFriendly = 1; skillEnemy = 0.55; precisionEnemy = 0.3; }; -
How to setup scoreboard for a coop mission to show all units killed/destroyed!
fight9 replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Server/host difficulty settings determine if the scoreboard is available. -
loadout into function conversion
fight9 replied to kOepi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You've gotten this shit super complicated. There's functions to call functions to spawn functions to call functions... just for a uniform. What happen to just listing all the shit you need in a single file... _unit = _this select 0; if (!local _unit) exitWith {}; removeAllWeapons _unit; removeUniform _unit; removeHeadgear _unit; _unit addUniform "U_B_HeliPilotCoveralls"; _unit addVest "V_BandollierB_rgr"; _unit addBackpack "B_Kitbag_rgr"; _unit addHeadgear "H_Cap_grn"; _unit addWeapon "binocular"; _unit linkItem "ItemMap"; _unit linkItem "ItemWatch"; _unit addWeapon "CUP_smg_bizon"; _unit addPrimaryWeaponItem "CUP_muzzle_Bizon"; _unit addPrimaryWeaponItem "CUP_optic_Kobra"; _unit addMagazine "CUP_64Rnd_9x19_Bizon_M"; _unit addMagazine "CUP_64Rnd_9x19_Bizon_M"; _unit addMagazine "CUP_64Rnd_9x19_Bizon_M"; _unit addMagazine "CUP_64Rnd_9x19_Bizon_M"; _unit addMagazine "CUP_64Rnd_9x19_Bizon_M"; Put all that in a single file and then call it in the init field with 0 = [this] execVM "scriptName.sqf"; It just seems so much easier! -
Nitpicking isn't a bad thing... Especially when it results in clean, correct, and optimal coding.
-
Make an addAction for portable light for all MP - Yeah I know...but can't find it
fight9 replied to pwrmx24's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You are better off passing addAction directly through BIS_fnc_MP. [[player,["Action Name", {/* what should be done */}]],"addAction",true,true,false] call BIS_fnc_MP; There is no reason for that extra function' date=' BIS_fnc_call. That would only come in handy if you were using a command not supported in the CfgRemoteExecCommands. @Pwrmx24 This all comes down on how you are adding the action. The above code would be used if you need the action for everyone but calling the code from one machine. Running code from the init.sqf or the init field of an object in-editor would not require this - since that is ran for everyone. Multiplayer scripting all comes down to knowing where your code is running and how the commands used are ran. If you have a global command, you can run it locally without adding anything. But if you have local command (like addAction) that you need to run globally, then you need to do some extra work like running it through BIS_fnc_MP. -
Make an addAction for portable light for all MP - Yeah I know...but can't find it
fight9 replied to pwrmx24's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'll try to answer your questions the best I can. I asked about using the marker because you could put the cords right into the createVehicle command, like you said. It just seemed redundant... but you could be using the marker elsewhere... that's why I left it. As for spawning this with a trigger... can you not just place this in the editor? I swear I have seen it. Also, moving the marker will not move the light... they are not tied together, in case you thought that. 1. The reason you didn't have the addAction working in your original attempt was because the spot1 variable didn't exist anywhere else but the server. The if-isServer statement makes sure its only spawned once, but also make it so the only place the variable is defined is on the server. Variables like this are different from the name you give an object in the editor. If you had placed the object there and named it spot1, then you wouldn't have that problem. The use of publicVariable here broadcasts the variable to all of the clients (& JIP). This ensures that spot1 references the light everywhere, consistently. 2. I used the spawn command here to open a new "thread". This allows the init.sqf to continue running past the code block while the waitUntil has the script held. execVM works much the same way but with script files, not code. The waitUntil command is really for people who are in the server when the mission starts. The publicVariable is synced to a JIP clients before the init.sqf is ran - so we don't have to worry about it there. However, when the mission starts, clients in the game already will skip the if-isServer part and go straight to the the "global code" section. Since we can't tell exactly when the server will have spot1 defined and broadcasted, we have to waitUntil it is ready. This code is designed for the init.sqf so make sure you run it there. 3. I use local variables (underscored words) there simply as a place to store the returned data from those commands. A return is what a command or function sends back after its runs. Not all commands have that. If you look at the wiki page for a command, it will tell you what it returns. AddAction returns the action index number. According to the wiki, BIS_fnc_MP returns an array, or "data packet". I don't know exactly what that is, but it might be the return from the command or function you are using. Without the "_off", "_on", "_h1", and "_h2", that returned data will just be floating there unassigned to a variable. Depending on the code, or scope you are running a code in, that might cause problems. Its always a good idea to assign returned data like that to a variable, just to be safe. params: You are correct. functionName: you are correct. target: I'm using the object spot1 here as a place to send the code. BIS_fnc_MP accepts a bunch of different values here. Using an object means it runs the code where that object is local - who owns it - the server in this case. isPersistent: No, false is correct. We don't need to send the info to JIP players. setHit is an argument:local/effect:global command. That means the code has to be ran on the machine where the object is local. However, the effects are global and send to the clients by the engine. isCall: This just means whether we should use spawn or call when running the functionName. We aren't using a function here but a CfgRemoteExecCommand so this probably doesn't apply. However, if you notice the light taking a little while to change when the action is hit, change it to true. False means its spawned... The code is added to the engine's code scheduler and ran when possible. Calling it means it will be bumped to the front and ran immediately. I hope this answers your questions... good luck.