Search the Community
Showing results for tags 'createmarker'.
Found 2 results
-
HELP: Scripting a motorised mortar section for a multiplayer mission..
cli0003_geoff posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello! I have been attempting to create 3 scripts with 5 main functions in MP editor. I am brand new to scripting (only 3-4 days), and have gotten very close to my goal. However, I am at my last legs for the near future. I need help chiefly with getting the positional coordinates from the map click into a marker used by a mortar section for a fire mission and/or relocation. Initially using the action menu: Set Fire Mission -Uses mouse on map to set a marker labelled "Fire Mission". Relocate Mortar Section -Uses mouse on map to set a marker labelled "New Position" Unpack/Pack Mortars -Uses if, then, else to minimise action menu options Commence Fire Mission -Uses Fire mission marker. Initially limited to 2 round salvos but as I learned more and went on i intend to make a menu with different sheafs, etc. Script 1: Function 1: Use the map to create a marker labelled "Fire Mission" with hints. To be used for the fire mission. Script 2: Function 2: Fire on the position. Script 3: Function 3: Mortar section gets in a Stryker, travels to a selected point "Relocation" on the map. Function 4: Unpacks their mortars and is ready for tasking Function 5: Packs mortars and awaits a relocation tasking. So far I have achieved function 2. 3 I can get partially there with a moving marker on the Stryker and scripted orders to mount up. 4 and 5 I have not properly attempted yet due to function 1's stone wall. I don't know much so any help would be appreciated. My scripts so far: Function 1: createfiremission.sqf: (Shortended version) openmap true, hint "Mark Fire Mission"; _pos = [] _firemissionlocation = _pos // as far as i figured this cleared previous marks addMissionEventHandler ["MapSingleClick", {params ["_units", "_pos", "_alt", "_shift"]}]; //don't really know what this is doing tbh, I figured it was grabbing the data and If I used "_result = _array select 1;" it would select the positional data. _firemissionlocation = "createMarker [firemissionlocation, _pos]"; //where things appear to go wrong. No matter what combination I can not get this to work. I did at one point momentarily have it working (no errors) but the marker would not appear. _firemissionlocation setMarkerType "hd_destroy"; _firemissionlocation setMarkerText "Fire Mission"; Function 2: I can't find my scripting for this at the moment. Function 3: player addAction ["Mortar Reposition", { //contains my initial attempt at getting marker pos params ["","_pos","",""]; openmap [true,false]; ["click", "onMapSingleClick", { titleText["Select Map Position", "PLAIN"]; _wp1 = badger addWaypoint [_pos [getmarkerPos mother_1],0]; _wp1 setWaypointType "getin"; deleteMarker "customObjective"; _mk = createMarker ["customObjective",_pos]; _mk setMarkerText "Go here"; _mk setMarkertype "hd_objective"; openmap [false,false]; onMapSingleClick ""; false }] call BIS_fnc_addStackedEventHandler; }]; Function 4: private _wp1 = _group addWaypoint [_pos getmarkerPos "MortarPit", 10]; //Not at all mine but I was to attempt to adapt it once i figured out the markers. _wp1 setWaypointType "MOVE"; _wp1 setWaypointStatements ["true", " group this allowFleeing 0; [group this, 'StaticWeaponUnpacked', { _this spawn { sleep 7; [_this select 0] call BIS_fnc_packStaticWeapon; }; }] call BIS_fnc_addScriptedEventHandler; [ this, this, this getPos [1000, random 360], this getPos [10, 0] ] call BIS_fnc_unpackStaticWeapon; Funtion 5: Nothing done yet.- 1 reply
-
- mapsingleclick
- createmarker
- (and 3 more)
-
Map Marker on Screentoworld Keypress
shrike88 posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Trying to clean up a script running when in a air vehicle using the gunner optics or pilot FLIR optics that on Keypress it will create a mapmarker for wherever I am zeroed on and looking though the targeting pod. I also want the markers to stay until they are deleted from the map. So multiple instances of created markers will be possible. For marking enemy positions etc. for troops for ground or other forces. Limited scripting knowledge. I know i need to retrive a value from screentoworld, then create a map marker on that value. Im assuming i dont need to create the laser marker. any assistance is appreciated. Guessing just work on the value from _wPos and create off of that ? //Place in player init: _this = execVM "target.sqf"; // if ((vehicle player isKindof "FIR_UH80R") or (vehicle player isKindof "111_Ghosthawk_Black") or (vehicle player isKindof "111_Ghosthawk_Sand")) then { //while(true) do { wPos = screenToWorld [0.5,0.5]; hint format["%1",wPos]; }; }; [] spawn { while {IP_LaseTargets} do { waitUntil {(!isNull (laserTarget IP_Main)) && {isNull ((laserTarget IP_Main) getVariable ["IP_LaserTarget", ObjNull])}}; _target = laserTarget IP_Main; _pos = getPosATL _target; _laserTarget = "LaserTargetW" createVehicle _pos; _laserTarget attachTo [_target, [0, 0, 3]]; _target setVariable ["IP_LaserTarget", _laserTarget]; _marker = createMarker[(str(_target)), _pos]; _marker setMarkerShape "ICON"; _marker setMarkerType "mil_destroy"; _marker setMarkerColor "colorRed"; _marker setMarkerText "Laser Target"; // Killed EH workaround. _target spawn { waitUntil {(!alive _this) OR ((damage _this) > 09)}; _laserTarget = _this getVariable ["IP_LaserTarget", ObjNull]; if (!isNull _laserTarget) then { deleteVehicle _laserTarget; _marker = str(_this); deleteMarker _marker; }; }; ["TargetLased"] call bis_fnc_showNotification; waitUntil {isNull (laserTarget IP_Main)}; }; };-
- screentoworld
- createmarker
-
(and 1 more)
Tagged with: