Jump to content

cpthammerbeard

Member
  • Content Count

    21
  • Joined

  • Last visited

  • Medals

Everything posted by cpthammerbeard

  1. cpthammerbeard

    EH for Disarming a mine

    @Johnny - hahaha, I forget I'd started that, I thought I'd googled it lol. Thanks for posting. Note to self, stop posting things after a few beers :P
  2. cpthammerbeard

    EH for Disarming a mine

    I used this for an underwater mine clearance mission //ARRAY to store mines _myMines = []; //spawn in 8 mines at randmo positions around my marker for "_i" from 1 to 8 do { _minePos = [_NavalMinePos,10,60,10,2,0,0] call BIS_fnc_findSafePos; _mineSpawn = createMine ["UnderwaterMine",_minePos,[],0]; //Add mine to ARRAY _myMines pushBack _mineSpawn; _mineSpawn setPosATL [_minePos select 0,_minePos select 1,(getPosATL _mineSpawn select 2) - 2]; [_mineSpawn,"BIS_fnc_spawn",true,true] call BIS_fnc_MP; }; //Create thread to monitor mines _checkMines = _myMines spawn { //Passed mines ARRAY _mines = _this; //Loop forever while { true } do { //Exit loop if the are 0 active mines if ( { mineActive _x }count _mines == 0 ) exitWith { //Set variable minesDefused = true; }; /*Check 10 seconds*/ sleep 10; }; }; waitUntil{(!isNil ("minesDefused"))}; //Insert the rest of your code here It's adapted from someone who gave me the code, can't find the post though. Apologies for not crediting. Hope it helps Cheers
  3. Excellent stuff, I've just been getting to grips with the Artillery in the previous release. How would I go about adding the action to an SDV and calling in Guided Bombs using the gunners seat laser marker? I had it working in SP, code below, but in server side tests it wouldn't update to the position of the laser marker. Add an Action to the Gunners Seat BLUSHQ1 addEventHandler ["getIn", { if (_this select 1 == "gunner") then { //add statement below [[bLUSHQ1,["Call Guided Strike",{call HMB_fnc_fireSupports}]],"addAction",true,true,false] call BIS_fnc_MP; };}]; fn_fireSupports _target = _this select 0; _caller = _this select 1; _id = _this select 2; _arguments = _this select 3; _designatedPos = position laserTarget _target; guidedTemplate = ["Bo_GBU12_LGB",1,1,1,1,0.1,0.1,true] call Zen_createFireSupport; [_designatedPos,guidedTemplate,_target] call Zen_InvokeFireSupport; Cheers Sam
  4. Nice Zen, Got some feedback/suggestions for you. We've been using your framework in our mission pack, I'll send you a copy. It's still a work in progress but here we go... Spawn Fortification occasionally gives an error when attempting to place a static weapon, I think it's due to the gradient of a random placement. BoatPatrols always end up stuck on the beach, but that's prob an Arma issue. Infantry Garrisons stay static, could they move about in house? ChopperMove - noticed if a chopper can't find a suitable space via BIS_fnc_findSafePos it defaults to the thin strip of land connecting the south island on Altis. Suggestion - CancelOrder, I recently had an extraction mission problem, if the hostage died after the chopper was enRoute, the chopper would complete extraction route before declaring hostage dead . Solution was to spawn the orderExtraction from a function and on hostage death use helicopterLand. Would be nice to have a cancel order. FireSupport is good, have you considered CAS? The built in CAS seems to hang about taking out as many targets as possible rather than single strike. Add Action - this has caused me no end of trouble, I understand it all now but if it was within your framework I bet it would have taken a lot of the pain away! Hint/PlaySound - again understanding BIS_fnc_MP was a challenge, I can now use it effectively, but for a new scriptwriter an easier Zen function would have been handy Thanks again for the effort.
  5. cpthammerbeard

    CH Mobile Headquarters

    Champ-1, this script is brilliant, I love it. Quick question, I tried to add an SDV, added the class list with [] for the composition and it won't take it. You get the Deploy MHQ near land, but not when at depth or away from shore, would be nice but not essential if there was a fix. Anyway, in our mission pack we're using Marids as MHQs, below is the composition we used for it, might be useful for someone. case (toLower "O_APC_Wheeled_02_rcws_F") : { _composition = [["CamoNet_INDP_big_Curator_F",[-2.18277,-0.473415,0.000566483],-359.981],["ModuleChemlightRed_F",[-1.36815,-2.9854,0.000566483],-359.981],["Land_Razorwire_F",[2.78963,1.75545,0.000566483],-99.2007],["Land_BarrelWater_F",[-0.666675,3.9968,0.000624657],-0.864716],["Land_BarrelWater_F",[0.0409352,4.27831,0.000624657],-0.875946],["O_CargoNet_01_ammo_F",[-2.27552,4.11548,0.000566006],-59.435],["Land_BarrelWater_F",[-0.592652,4.90351,0.000624657],-0.865234],["Land_BagFence_Long_F",[3.59061,-3.66229,0.000566483],-263.536],["ModuleChemlightRed_F",[-4.98858,2.10122,0.000566483],-359.981],["O_CargoNet_01_ammo_F",[-4.58421,3.83107,0.000566483],-339.013],["Land_Razorwire_F",[-0.57078,6.09882,0.000566483],-359.981],["Land_BagFence_Round_F",[2.33203,-6.04226,0.000566483],-20.0836],["Land_CampingChair_V1_F",[-5.15567,-4.23808,0.00369167],-258.723],["Land_CampingTable_F",[-6.01811,-4.65186,0.000565052],-119.639],["Land_CampingChair_V1_F",[-5.30711,-5.96654,0.00368977],-218.204],["FlexibleTank_01_forest_F",[-8.02475,0.478183,0.000669003],-359.887],["Land_MetalCase_01_large_F",[-8.23797,-0.551533,0.000566959],0.00421143],["Land_GasTank_01_blue_F",[-8.20019,-1.50711,0.000607967],-0.551971],["B_GMG_01_high_F",[-3.72459,-7.48854,-0.0112429],-245.001],["Land_Razorwire_F",[-7.88963,3.08117,0.000566483],-232.341],["Land_BagFence_Long_F",[-3.73847,-8.12623,0.000566483],-359.086],["Land_BagFence_Long_F",[-7.8955,-4.49842,0.000566483],-307.93],["Land_BagFence_Long_F",[-6.09499,-6.83445,0.000566483],-312.22],["Land_BagFence_Long_F",[-9.6531,-2.35283,0.00156641],-307.93]]; _cargoInfo = ["Land_Ammobox_rounds_F",[0,-1.2,0],0]; [_obj, _side, _cargoInfo, _composition] call CHHQ_fnc_startingSetup; }; }; Nice job, and thanks.
  6. Hi there, script is awesome in SP, but having some problems with MP execution. I have this script here _smAttachMine = getMarkerPos "smAttachMineTwo"; drugShip = "C_Boat_Civil_04_F" createVehicle _smAttachMine; I'm using the following for the addAction _attachCharge = [[drugShip,["Place Explosive Charge",{[drugShip,player,0] execVM "scripts\attach_charge.sqf"}]],"addAction",true,true,false] call BIS_fnc_MP; my problem is the error message shows drugShip as undefined for the pass through to the execVM. If I define as a publicVariable like below, the adddAction doesn't execute attach_charge. _smAttachMine = getMarkerPos "smAttachMineTwo"; drugShip = "C_Boat_Civil_04_F" createVehicle _smAttachMine; Any thoughts?
  7. I found this as well however, if they detect an enemy they'll disembark. Zen_orderExtraction, is it intended behaviour that when the vehicle gets to the 2nd marker the group that was extracted sit in the vehicle until you order them out?
  8. Nice one, thanks Zen, that's just given me my next mission to write.
  9. cpthammerbeard

    Scripted Mine Clearance

    That works wonderfully! Thanks Larrow.
  10. Hello, I'm looking for a bit of help with a condition. The task is to clear out mines. The mines are scripted and generated in random positions and therefore don't have names assigned to them so I can't check using !mineActive mine1 and !mineActive mine2......... //get the editor based marker _smNavalMinePos = getMarkerPos "smNavalClearOne"; //create visible area marker and area for enemy divers to patrol _smNavalMineArea = createMarker ["smNavalClearOneArea",_smNavalMinePos]; _smNavalMineArea setmarkerShape "ellipse"; _smNavalMineArea setMarkersize [130,130]; _smNavalMineArea setMarkerColor "colorBlack"; for "_i" from 1 to 8 do { //find a random location _minePos = [_smNavalMinePos,10,60,10,2,0,0] call BIS_fnc_findSafePos; //create a mine _mineSpawn = createMine ["UnderwaterMine",_minePos,[],0]; //sink mine 2m below the surface _mineSpawn setPosATL [_minePos select 0,_minePos select 1,(getPosATL _mineSpawn select 2) - 2]; }; //create tigger to check the state of placed mines _trgMineChecker = createTrigger ["EmptyDetector", _smNavalMinePos]; _trgMineChecker setTriggerArea[130,130,0,false]; _trgMineChecker setTriggerActivation["ANY","PRESENT",false]; _trgMineChecker setTriggerStatements["({!mineActive _x} count thisList) == 8","minesDefused = true", ""]; waitUntil{(!isNil ("minesDefused"))}; //win lose messages switch (minesDefused) do { case true: { hint "its true"; }; case false: { hint "its false"; }; }; Many thanks :)
  11. Perfect, thanks very much Zen ;)
  12. Ah yes, I see Zooloo75. You don't the forEach nice fix.
  13. cpthammerbeard

    Random Squad Spawn?

    EOS doesn't have to be located in towns, you can use any marker. Zenophons framework is really cool. Once in you could use something like //pick a random number of maximum squad to spawn _guerReinforcementRandomMax = [3,4] call BIS_fnc_selectRandom; for "_i" from 1 to _guerReinforcementRandomMax do { //find a random spawn point for each squad _guerInfSpawn = [_guerReinforcementPatrolArea,700,700,5,0,150,0] call BIS_fnc_findsafePos; //spawn in the squad with between 5 and 7 members _guerInfReinforcement = [_guerInfSpawn, independent, "infantry", [5,7]] call Zen_SpawnInfantry; //tell that squad to patrol in the marker area [_guerInfReinforcement,"YourMarkerAreaToBePatrolled",[],0,"normal"] spawn Zen_OrderInfantryPatrol; };
  14. To be honest I'm not sure if there's a difference, just thought I'd throw my 2 cents in. Your switch would look something like below, I think, I'm no expert. switch (typeOf) do{ case "CUP_O_RUS_Soldier_Marksman": { [_x] execVM "scripts\loadouts\MM.sqf"; foreach allunits; }; case "CUP_O_RUS_SpecOps_Scout": { [_x] execVM "scripts\loadouts\0-4RS.sqf"; foreach allunits; }; };
  15. The way I was taught was create your functions folder 'KO_functions' Inside that folder create a file called 'functions.h' and add the following code class KO_functions { tag = "KO"; class Main_Directory { file = "KO_functions"; class RSFgiveUniform{}; }; }; no create the following file in the KO_functions folder fn_RSFgiveUniform.sqf removeUniform _this; _this forceAddUniform "rhs_uniform_mflora_patchless"; to call on the function use, note you may have to pass your object variable to it [] spawn KO_fnc_RSFgiveUniform; You can keep adding scripts the folder and add them to your functions.h
  16. I love this framework it's taking so much of the troubleshooting out of mission making. I'm running a random reinforcement script, might be paratroops, might be enemy CAS called in etc. I'm having a problem with paratroopers, is there any plans to include a function? Right now I'm having bother getting troopers to spawn, in the air. I've tried using the findNearHeight using the chopper as an object but I think you have the findGroundPosition in the code for calling SpawnInfantry. Anyone any ideas on how I would spawn in infantry using the chopper spawn below as a spawn point? _bluforHeliArray = ["B_Heli_Light_01_armed_F","B_Heli_Attack_01_F"]; _bluforHeliSpawn = [_bluforReinforcementPatrolArea,600,600,8,0,150,0] call BIS_fnc_findsafePos; _bluforRHeli = [_bluforHeliSpawn, _bluforHeliArray] call Zen_spawnHelicopter; [_bluforRHeli, _bluforReinforcementPatrolArea,[],0,"normal"] spawn Zen_OrderAircraftPatrol;
  17. cpthammerbeard

    Hercx Task System

    Great task system, got it working nicely. We had an issue where we had two separate win conditions for OPFOR and BLUFOR, Herc was good enough to help us out. In case someone is scouring forums looking for a solution to this kind of problem the code ended up as follows. We set up two triggers with our conditions for each side winning. // in your trigger statement for west put _trg setTriggerStatements ["true","bluforWin = true;",""]; // in your trigger statement for east put _trg setTriggerStatements ["true","bluforWin = false;",""]; The following was added to the mission file. //Complete the task waitUntil{(!isNil ("BluforWin"))}; switch (BluforWin) do { case true: { _winningSide = [west]; [_taskNumber,_winningSide] call Hercx_fnc_taskOutcome; hint "BLUFOR WINS"; //for testing locally to ensure conditions have been met }; case false: { _winningSide = [east]; [_taskNumber,_winningSide] call Hercx_fnc_taskOutcome; hint "OPFOR WINS"; //for testing locally to ensure conditions have been met }; };
  18. cpthammerbeard

    [Beginners guide]: Arrays

    Thanks for reply Anim, The code is as follows within the sqf. the variables _pMissionElektorvadsk and _pMissionPusta are defined within a seperate sqf. I know that _pMissionCreate works, as it sets the task accordingly, even for JIP. This has been tested in a dedicated server environment. //Call the next town to be captured _pMission_array = [_pMissionElektrovadsk,_pMissionPusta] call BIS_fnc_selectRandom; _pMissionCreate = [_pMission_array call BIS_fnc_setTask] call BIS_fnc_MP; //setTask, without fnc_MP nothing works _pMission = (_pMission_array select 3) select 0; //this line is correct as without it the script would not know where to set the Task Marker, enemy spawns etc _pMissionId = _pMission_array select 0; //I am convinced this line is returning a value of the entire array Re call BIS_fnc_MP;, without that the BIS_fnc_setTask doesn't broadcast to all players, it also works with JIP. Many thanks again Cheers CptHammerBeard
  19. cpthammerbeard

    [Beginners guide]: Arrays

    Hello, I'm a bit confused over selecting from nested arrays, wellstuck for a few days now. I've read through the post and also KillzoneKids tutorials, the wiki also makes sense but nobody has the example below. I realise this is for an Arma 3 function but as I understand select hasn't changed and could find nothing relevant in the Arma 3 editing section. This is one array from a list of similar arrays that are randomy selected and then use the BIS_fnc_setTask; _pMissionMogilevka = ["taskOne",true,["Capture all bases at Mogilevka","Capture Mogilevka","Objective"],[d_target_1,true],"ASSIGNED",1,true,true]; _pMissionGugovo = ["taskTwo",true,["Capture all bases at Gugovo","Capture Gugovo","Objective"],[d_target_2,true],"ASSIGNED",1,true,true]; The code below will select a random objective and setTask _pMission_array = [_pMissionMogilevka,_pMissionChernogorsk] call BIS_fnc_selectRandom; _pMissionCreate = [_pMission_array call BIS_fnc_setTask] call BIS_fnc_MP; This section is then used to get the object location and uses it to spawn in markers, enemy patrols etc. e.g. it will return a value of d_target_# _pMission = (_pMission_array select 3) select 0; This is the section I am having trouble with, the above works great, random target town is selected, markers and enemy are spawned in, the task appears for everyone. However, as this is a TvT I need Victor/Loser parameters for task SUCCEEDED or FAILED, therefore I need to get the task ID to use later on in the script. The script below returns an error. The use of hint is just to let me know if it's pulling out the string. _pMissionId = _pMission_array select 0; sleep 5; hint ["%1",_pMissionId]; For context this is the line that will use the variable _taskSucceeded = [[_pMissionID,"SUCCEEDED"] call BIS_fnc_taskSetState] call BIS_fnc_MP; Many thanks in advance CptHammerBeard
×