daniel-davies
Member-
Content Count
31 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout daniel-davies
-
Rank
Private First Class
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
MapSingleClick problem
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I ended up figuring it out, but coming back to this topic and seeing Larrow once again being a godsend is so nice. Thank you so much Larrow! Some of these scripting commands I didn't even realize existed actually haha -
MapSingleClick problem
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Right, my bad. I was indeed. Could either of you, or anyone else, help me figure out how to allow for a two-click verification of the choice that the player selects? -
MapSingleClick problem
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I was using it in other scripts in my mission (this code is currently run in initServer.sqf) -
Hi guys! I want to create a script where the player clicks on a marker on the map (taken from the array "availableBuildings") in order to confirm their "base location". They have to click the same marker location twice in order to confirm. This is what I got so far: /////////////////////////////////////// // Click on map to choose base location /////////////////////////////////////// _blds = nearestObjects [[worldSize / 2, worldSize / 2, 0], ["Land_i_Shed_Ind_F"], 15000]; missionNamespace setVariable ["availableBuildings", _blds, true]; _markerArray = []; playSound "BIS_WL_Sector_WEST"; { _markerName = format ["marker_%1", _forEachIndex]; _markerstr = createMarker [_markerName, position _x]; _markerstr setMarkerShape "ICON"; _markerstr setMarkerText ""; _markerstr setMarkerType "loc_Tourism"; _markerstr setMarkerSize [0.85, 0.85]; _markerstr setMarkerColor "ColorOrange"; _markerArray pushBack _markerName; } forEach (missionNamespace getVariable "availableBuildings"); markerstr = createMarker ["marker_confirmation", [0,0,0]]; _handleMarker = ["marker_confirmation", 0, 1] spawn BIS_fnc_blinkMarker; markerstr setMarkerShape "ICON"; markerstr setMarkerText " Selected Starting Zone - close map to confirm"; markerstr setMarkerType "Select"; markerstr setMarkerSize [1.8, 1.8]; markerstr setMarkerColor "ColorBlue"; markerstr setMarkerAlpha 0; addMissionEventHandler ["MapSingleClick", { params ["_units", "_pos", "_alt", "_shift"]; _nearestMarker = [allMapMarkers, _pos] call BIS_fnc_nearestPosition; markerstr setMarkerPos (getMarkerPos _nearestMarker); markerstr setMarkerAlpha 1; if (isNil _nearestMarker) then { if (getMarkerPos _nearestMarker distance _pos >= 300) then { playSound "BIS_WL_Selected_WEST"; markerstr setMarkerColor "ColorGreen"; { deleteMarker _x } forEach (missionNamespace getVariable "availableBuildings"); }; }; }]; Obviously this isn't completely functional yet. I need help to make it fully functional. Can anyone please help? Thanks for your time!
-
Utilization of the marker/map briefing
daniel-davies replied to M. Glade's topic in ARMA 3 - DEVELOPMENT BRANCH
Hey M. Glade, I was also as interested as you in the new animation map/briefings added in the Tac-Ops DLC. I sifted through the Functions in the Functions Viewer and found the functions that are used by the briefings: Filter your Functions Viewer by A3_TacOps and check the Map and System tabs out! There's some pretty damn cool functions added :) If you need help with the application of some of the functions, let me know! -
Passing marker to setTriggerStatements
daniel-davies posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, I know there's been topics created about this issue in the past but I'm having issues even after looking at previous solutions. I'm creating three warehouses in my function. The loop loops 3 times and each time it creates two triggers: private _threeWarehouses = []; private _warehouseList = ["marker_warehousesite1","marker_warehousesite2","marker_warehousesite3","marker_warehousesite4","marker_warehousesite5","marker_warehousesite6","marker_warehousesite7","marker_warehousesite8","marker_warehousesite9","marker_warehousesite10","marker_warehousesite11"]; for "_i" from 1 to 3 do { private _trg = _warehouseList call BIS_fnc_selectRandom; _warehouseList = _warehouseList - [_trg]; _threeWarehouses pushBack _trg; _trg setMarkerType "mil_unknown"; _msg = format ["Warehouse location %1", _i]; _trg setMarkerText _msg; _trg setMarkerColor "ColorRED"; _msg2 = format ["markerWarehouseZone%1", _i]; _zoneMarker = createMarker [_msg2, getMarkerPos _trg]; _zoneMarker setMarkerShape "ELLIPSE"; _zoneMarker setMarkerSize [125,125]; _zoneMarker setMarkerColor "ColorOPFOR"; _zoneMarker setMarkerBrush "FDiagonal"; [getMarkerPos(_trg), (ceil (random 2)), 150] call DAN_fnc_spawnRandomInfantry; _buildings = nearestObjects [getMarkerPos _trg, ["Land_i_shed_ind_F"], 100]; //object array _enemies = nearestObjects [getMarkerPos _trg, ["Man"], 150]; _nul = [getMarkerPos _trg,_enemies, 150] execVM "scripts\shk_buildingpos.sqf"; {[_x] joinSilent grpNull; doStop _x; _x setDir random 360; if ((random 1) > 0.5) then { _x setUnitPos "UP"; } else { _x setUnitPos "MIDDLE"; }; } forEach _enemies; [getMarkerPos(_trg), (ceil (random 2)), 60] call DAN_fnc_spawnRandomInfantry; _loopRandom = 1 + (ceil (random 4)); private _flagPos = [(getMarkerPos _trg), 2, 6, 3, 0, 20, 0] call BIS_fnc_findSafePos; _flag = "Flag_AAF_F" createVehicle _flagPos; for "_j" from 1 to _loopRandom do { private _safeLoc = [(getMarkerPos _trg), 4, 60, 3, 0, 20, 0] call BIS_fnc_findSafePos; private _veh = ["I_MRAP_03_F","I_Truck_02_Transport_F","I_Truck_02_Covered_F"] call BIS_fnc_selectRandom; _ambientVehicle = _veh createVehicle _safeLoc; _ambientVehicle setVehicleLock "LOCKED"; _ambientVehicle setDir (random 360); _nearRoads = _safeLoc nearRoads 10; if(count _nearRoads > 0) then { _road = _nearRoads select 0; _roadConnectedTo = roadsConnectedTo _road; _connectedRoad = _roadConnectedTo select 0; _direction = [_road, _connectedRoad] call BIS_fnc_DirTo; }; clearBackpackCargoGlobal _ambientVehicle; clearItemCargoGlobal _ambientVehicle; clearWeaponCargoGlobal _ambientVehicle; clearMagazineCargoGlobal _ambientVehicle; }; _newtrg = createTrigger ["EmptyDetector", getMarkerPos _trg]; _newtrg setTriggerArea [125, 125, 0, false]; _newtrg setTriggerActivation ["WEST", "PRESENT", true]; _newtrg setTriggerStatements ["this", "{if ((side _x) == INDEPENDENT) then { if ((leader (group _x))==_x) then { [group _x, getPos _x, 250] call bis_fnc_taskPatrol; }; }; } forEach thisList;", ""]; _newtrg2 = createTrigger ["EmptyDetector", getMarkerPos _trg]; _newtrg2 setTriggerArea [125, 125, 0, false]; _newtrg2 setTriggerActivation ["GUER", "NOT PRESENT", true]; _newtrg2 setTriggerStatements ["this",(format ["%1 setMarkerColor ""ColorRed""; %2 setMarkerColor ""ColorRed"";",_trg,_zoneMarker]),""]; }; This doesn't work - the marker is correct (I used a hint to check) but nothing happens (the colour is not changed). Could anyone help? -
Checking if there is no passengers in crew vehicle
daniel-davies posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi guys, I'm back again! I have another problem - essentially, my mission is for thirty players, and uses two Huron helicopters (each with 20 passenger seats) to transport players from the base to the AO, piloted by AI. I'd like to check whether there are no passengers within the second Huron, so I don't have to make it take off and fly the insertion route when it doesn't need to (kinda looks a bit stupid for the players). I'm not sure how I'd go about doing so however, I know I have to use crew and I'm assuming I get the fourth element from the array [driver,gunner,commander,turrets,cargo]? But I'm not sure about writing a condition to check against an empty array. Any help would be appreciated. -
Getting highest ranked player out of all playable units
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Amazing guys, thank you all so much! Issue is resolved :) -
Getting highest ranked player out of all playable units
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That's far better than the code I wrote! Haha I didn't even realise there was such a thing as rankId! Thank you very much! EDIT: How would I get the _candidate variable to return from the function? -
Getting highest ranked player out of all playable units
daniel-davies posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi guys, I'm creating a function ran by the server for my multiplayer mission which will update a variable with an array containing details about the highest ranked player currently alive and in the mission. The object 'COMMAND_officer' is the highest possible ranking officer (he is the Platoon commander and the rank of Captain). However if the commander dies, I need to check each playable unit to see if it is the highest ranking officer left alive on the field. This is what I've wrote so far. I'm not sure if it is the best way of doing things however. 'TOUR_core' is the name of a game logic ingame. fn_getHighestRankingOfficer.sqf: if (!isNil { COMMAND_officer } ) then { exitWith { TOUR_CORE setVariable ["DAN_var_highestRankingOfficer",[COMMAND_officer, rank COMMAND_officer, name COMMAND_officer],true]; }; }; //ALIVE LIEUTENANTS { if (_foundhighestOfficer == false) then { _rank = (rank _x); _myProfileName = name _x; _foundHighestOfficer = false; if ((rank _x) == "LIEUTENANT") exitWith { _foundHighestOfficer = true; _unitsName = (vehicle _x)}; }; } forEach (playableUnits+switchableUnits); if (_foundHighestOfficer == true) then { TOUR_CORE setVariable ["DAN_var_highestRankingOfficer",[_unitsName, _rank, _myProfileName],true]; _bypassOtherRankChecks = true; }; //////////////////////////////////////////////////////////////// //ALIVE SERGEANTS? //////////////////////////////////////////////////////////////// if (_bypassOtherRankChecks == false) then { { if (_foundhighestOfficer == false) then { _rank = (rank _x); _myProfileName = name _x; _foundHighestOfficer = false; if ((rank _x) == "SERGEANT") exitWith { _foundHighestOfficer = true; _unitsName = (vehicle _x)}; }; } forEach (playableUnits+switchableUnits); if (_foundHighestOfficer == true) then { TOUR_CORE setVariable ["DAN_var_highestRankingOfficer",[_unitsName, _rank, _myProfileName],true]; _bypassOtherRankChecks = true; }; }; //////////////////////////////////////////////////////////////// //ALIVE CORPORALS? //////////////////////////////////////////////////////////////// if (_bypassOtherRankChecks == false) then { { if (_foundhighestOfficer == false) then { _rank = (rank _x); _myProfileName = name _x; _foundHighestOfficer = false; if ((rank _x) == "CORPORAL") exitWith { _foundHighestOfficer = true; _unitsName = (vehicle _x)}; }; } forEach (playableUnits+switchableUnits); if (_foundHighestOfficer == true) then { TOUR_CORE setVariable ["DAN_var_highestRankingOfficer",[_unitsName, _rank, _myProfileName],true]; _bypassOtherRankChecks = true; }; }; //////////////////////////////////////////////////////////////// //ALIVE PRIVATES????? //////////////////////////////////////////////////////////////// if (_bypassOtherRankChecks == false) then { { if (_foundhighestOfficer == false) then { _rank = (rank _x); _myProfileName = name _x; _foundHighestOfficer = false; if ((rank _x) == "PRIVATE") exitWith { _foundHighestOfficer = true; _unitsName = (vehicle _x)}; }; } forEach (playableUnits+switchableUnits); if (_foundHighestOfficer == true) then { TOUR_CORE setVariable ["DAN_var_highestRankingOfficer",[_unitsName, _rank, _myProfileName],true]; _bypassOtherRankChecks = true; }; }; Could this be made better in any way? Thanks -
Zero divisor error in addAction
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That worked! Thank you Fiddi! :) -
Zero divisor error in addAction
daniel-davies posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello all, I'm trying to create an action for an MP mission that simulates the lighting of a fuel can (which will then light oil on fire, leading to some explosives). The script will still run, but I receive an error. I'm really struggling to fix it, any help will be greatly appreciated. From my RPT file: 20:54:57 Error in expression <) do { case (Fuel_Can_04) : { {[(_this select 1)] execVM "Mission\Fuel_Can_Ligh> 20:54:57 Error position: <select 1)] execVM "Mission\Fuel_Can_Ligh> 20:54:57 Error Zero divisor initPlayerLocal: if (!isNil { Explosives_B }) then { Fuel_Can_04 addAction ["Light fuel can", "mission\runFuelCanScript.sqf", nil,8,true,true,"","((_this distance _target) < 1.5)"]; }; runFuelCanScript: (_this select 1) playMove "AinvPercMstpSrasWrflDnon_Putdown_AmovPercMstpSrasWrflDnon"; switch ((_this select 0)) do { case (Fuel_Can_04) : { [(_this select 1)] execVM "Mission\Fuel_Can_Light_A.sqf" remoteExec ["bis_fnc_call", 2]; }; case (Fuel_Can_06) : { [(_this select 1)] execVM "Mission\Fuel_Can_Light_B.sqf" remoteExec ["bis_fnc_call", 2]; }; case (Fuel_Can_05) : { [(_this select 1)] execVM "Mission\Fuel_Can_Light_C.sqf" remoteExec ["bis_fnc_call", 2]; }; case (Fuel_Can_01) : { [(_this select 1)] execVM "Mission\Fuel_Can_Light_D.sqf" remoteExec ["bis_fnc_call", 2]; }; case (Fuel_Can_02) : { [(_this select 1)] execVM "Mission\Fuel_Can_Light_E.sqf" remoteExec ["bis_fnc_call", 2]; }; }; Thanks in advance. From my RPT file: {[(_this select 1)] execVM "Mission\Fuel_Can_Ligh> 20:54:57 Error position: <select 1)] execVM "Mission\Fuel_Can_Ligh> 20:54:57 Error Zero divisor -
Creating custom marker on map for a town?
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is exactly what I was looking for, thank you sir! -
Creating custom marker on map for a town?
daniel-davies posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I'd like to make a marker on the map that has the Purista font which is used in the towns on the map, along with the correct colour and lack of icon next to the marker. However, I don't know how to go about doing this. This is what I'd like the marker to look like on the map: I know it's possible, as it is working in Sa-Matra's Wasteland. However, I don't know how to do it myself, so if anyone could help that'd be fantastic! Thank you in advance. -
Require help with making script MP-compatible
daniel-davies replied to daniel-davies's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ah ha, got it Larrow! Thank you very much, fixed it now :)