Alo Keen 7 Posted March 22, 2013 (edited) Either there is a very easy way to do this and I've missed it, or I just couldn't find it on its own... but anyway: A script to display friendly units on the map, nothing fancy. Requires units in the editor to be named. Will deal with it if needed. I'd appreciate feedback on performance, or anything else you might think of. Optional name tags on players in the field sounds like an idea someone's going to have - yeah, thought of that but didn't want/need it. Could squeeze it in as an option, I guess. if(!isDedicated) then { waitUntil {!isNull player && isPlayer player}; private["_unit", "_unitList", "_mySide", "_unitName", "_aMarker", "_aMarker"]; player addMPEventHandler ["MPRespawn", { [_this select 0] spawn pinMarkerF;}]; pinMarkerF = { _unit = (_this select 0); _unitList = allUnits; _mySide = side _unit; { if((side _x) == _mySide) then { _unitName = name _x; _aMarker = vehicleVarName _x; _aMarker = createMarkerLocal [_aMarker,[0,0]]; _aMarker setMarkerShapeLocal "ICON"; _aMarker setMarkerTypeLocal "mil_dot"; _aMarker setMarkerTextLocal _unitName; _aMarker setMarkerSizeLocal [1,1]; _aMarker setmarkerDirLocal (getdir _x); _aMarker setMarkerPosLocal (getPos _x); _aMarker setMarkerTextLocal _unitName; _aMarker setMarkerColorLocal "ColorGreen"; }; } foreach _unitList; while {alive _unit} do { { _aMarker = vehicleVarName _x; _aMarker setMarkerDirLocal (getDir _x); _aMarker setMarkerPosLocal (getPos _x); } foreach _unitList; sleep 0.2; }; _myVarName = vehicleVarName _unit; _myVarName setMarkerColorLocal "ColorBlack"; sleep 3; deleteMarkerLocal _myVarName; }; [player] spawn pinMarkerF; };if(!isDedicated) then { waitUntil {!isNull player && isPlayer player}; private["_unit", "_unitList", "_mySide", "_unitName", "_aMarker", "_aMarker"]; player addMPEventHandler ["MPRespawn", { [_this select 0] spawn pinMarkerF;}]; pinMarkerF = { _unit = (_this select 0); _unitList = allUnits; _mySide = side _unit; { if((side _x) == _mySide) then { _unitName = name _x; _aMarker = vehicleVarName _x; _aMarker = createMarkerLocal [_aMarker,[0,0]]; _aMarker setMarkerShapeLocal "ICON"; _aMarker setMarkerTypeLocal "mil_dot"; _aMarker setMarkerTextLocal _unitName; _aMarker setMarkerSizeLocal [1,1]; _aMarker setmarkerDirLocal (getdir _x); _aMarker setMarkerPosLocal (getPos _x); _aMarker setMarkerTextLocal _unitName; _aMarker setMarkerColorLocal "ColorGreen"; }; } foreach _unitList; while {alive _unit} do { { _aMarker = vehicleVarName _x; _aMarker setMarkerDirLocal (getDir _x); _aMarker setMarkerPosLocal (getPos _x); } foreach _unitList; sleep 0.2; }; _myVarName = vehicleVarName _unit; _myVarName setMarkerColorLocal "ColorBlack"; sleep 3; deleteMarkerLocal _myVarName; }; [player] spawn pinMarkerF; }; Include this line in your init.sqf, the script does the server check. Or feel free to mess around, this is what I was working with :) [] execVM "marker.sqf"; Edited March 22, 2013 by Ceh Layout and clarity Share this post Link to post Share on other sites
farooqaaa 2 Posted March 24, 2013 Can you post a screenshot please? Share this post Link to post Share on other sites
farooqaaa 2 Posted March 25, 2013 Thanks. This will come in handy. Share this post Link to post Share on other sites
Alo Keen 7 Posted March 25, 2013 NP, if anyone uses this I'd appreciate feedback on performance, and if any experienced coders bump into this, I'm open to suggestions on best practices etc. Is there benefit from formally releasing this in the other topic, does it warrant a release and all that....? I saw a tutorial that should allow the same functionality through use of modules in the editor, but couldn't find mentioned module in A3. Will look in A2. Perhaps an old tut, or I was too tired.... Share this post Link to post Share on other sites
saetheer 9 Posted June 17, 2013 Request: in my Team vs. team mission I want markers to follow specified units. blufor cant se opfor markers, and opfor can't see blufor markers. I don't want to use colored text like your screenshot, but a simple Infantry marker Share this post Link to post Share on other sites
Scorch052 1 Posted June 18, 2013 this should be in mission editing, no? Share this post Link to post Share on other sites
Alo Keen 7 Posted June 18, 2013 Request: in my Team vs. team mission I want markers to follow specified units. blufor cant se opfor markers, and opfor can't see blufor markers. I don't want to use colored text like your screenshot, but a simple Infantry marker OK, I understand blufor/opfor not seeing each other, I have solved that in a version of script we are using in some missions, but can you be a bit more clear on "specified units" or was it with regard to BLUFOR/OPFOR seeing each other? Also, which kind of marker would you like? An arrow (useful for showing direction of player) or...? Share this post Link to post Share on other sites
Valixx 11 Posted August 4, 2013 I don't know if you are still maintaining the script but here is a suggestion: Your script is showing also AI. Could you build-in a possibility to show only the players? Share this post Link to post Share on other sites
Alo Keen 7 Posted August 4, 2013 (edited) Heh, never thought of them - we weren't using AI :D Will look into it, gotta find an updated version somewhere... EDIT: got a file from one of my folders - haven't tested it to see if it's the working version, got some work to do ATM. If it doesn't drop a note here I'll try to look into it ASAP. if(!isDedicated) then { waitUntil {!isNull player && isPlayer player}; private["_unitList", "_mySide", "_unitName", "_aMarker", "_dMarker", "_killedMarker"]; player addMPEventHandler ["MPRespawn", { [_this select 0] spawn nc_pinMarkerF;}]; player addMPEventHandler ["MPKilled", {[_this select 0] spawn nc_playerKilledF}]; nc_playerKilledF = { private["_unit"]; _unit = (_this select 0); _killedMarker = vehicleVarName _unit; _killedMarker setMarkerAlphaLocal 0.5; _killedMarker setMarkerColorLocal "ColorBlack"; sleep 3; deleteMarkerLocal _killedMarker; }; nc_pinMarkerF = { private["_unit"]; _unit = (_this select 0); _unitList = allUnits; _mySide = side _unit; { if(isPlayer _x) then { if((side _x) == _mySide) then { if (getMarkerColor _aMarker == "") then { _unitName = name _x; _aMarker = vehicleVarName _x; _aMarker = createMarkerLocal [_aMarker,[0,0]]; _aMarker setMarkerShapeLocal "ICON"; _aMarker setMarkerTypeLocal "mil_arrow2"; _aMarker setMarkerTextLocal _unitName; _aMarker setMarkerSizeLocal [0.5,0.75]; _aMarker setmarkerDirLocal (getdir _x); _aMarker setMarkerPosLocal (getPos _x); _aMarker setMarkerTextLocal _unitName; _aMarker setMarkerColorLocal "ColorGreen"; _aMarker setMarkerAlphaLocal 0.5; }; }; }; } foreach _unitList; while {alive _unit} do { _unitList = allUnits; if (cameraView == "External") then { _unit switchCamera "Internal"; }; { if(isPlayer _x) then { _aMarker = vehicleVarName _x; _unitName = name _x; if((side _x) == _mySide) then { if (getMarkerColor _aMarker == "") then { _aMarker = createMarkerLocal [_aMarker,[0,0]]; _aMarker setMarkerShapeLocal "ICON"; _aMarker setMarkerTypeLocal "mil_arrow2"; _aMarker setMarkerSizeLocal [0.5,0.75]; _aMarker setMarkerColorLocal "ColorGreen"; _aMarker setMarkerAlphaLocal 0.5; }; }; _aMarker setMarkerTextLocal _unitName; _aMarker setMarkerDirLocal (getDir _x); _aMarker setMarkerPosLocal (getPos _x); }; } foreach _unitList; sleep 0.3; }; }; [player] spawn nc_pinMarkerF; }; Edited August 4, 2013 by Ceh Share this post Link to post Share on other sites
joplin66 10 Posted September 19, 2013 Hey id like to see all the opponents on a mod im making, is there a script to make the other team visible on my map? i want team A to see team B and team B NOT to be able to see team A. id also like this to be from the start of the mission regardless of visible sight or contact. Share this post Link to post Share on other sites