Jump to content

Simple Player Marker


Toby77

Recommended Posts

So i wanted to share a script that make's players navigate a bit easier.

I do not know who created this script its been out there for awhile otherwise i would've share'd his Credits for making this.

In your init.sqf :

// Player Location

execVM "marker.sqf";

Create a file called marker.sqf and paste this code into it:

if(hasInterface)then{
[] spawn {
		waitUntil{uiSleep 0.2;!isNil "EPOCH_playerEnergyMax"};  //wait for player to load
		_playerPos = createMarkerLocal ["PlayerPOS", position player];  //create marker
		"PlayerPOS" setMarkerTextLocal "";  // Player marker text eg: You
		"PlayerPOS" setMarkerTypeLocal "Select";  // Player Marker icon
		"PlayerPOS" setMarkerColorLocal "ColorBlack";  
		while{true}do{
			waitUntil {uiSleep 0.2;visibleMap};  //update marker only while map is open
			"PlayerPOS" setMarkerPosLocal position player;
		};
	};
};

Now paste both .sqf files into your mission.pbo.

I can't remember wich BE filters i added to prevent kicking, But if you need help paste your BE kicks here.

 

location.jpg

Link to comment
Share on other sites

You need to change the script, But yea, Group members are already defined by 3d (hexegon) symbols. (not 2d map markers).

But if you really want to, you could try this:

/*
playerMarker.sqf

*/
private["_markers","_members"];
_markers = [];
_members = [];

while {true} do {
    sleep 0.5;
    if(visibleMap) then {
        _members = units (group player);
        //Create markers
        {
            _marker = createMarkerLocal [format["%1_marker",_x],visiblePosition _x];
            _marker setMarkerColorLocal "ColorGreen";
            _marker setMarkerTypeLocal "Mil_dot";
            _marker setMarkerTextLocal format["%1", _x getVariable["realname",name _x]];
        
            _markers pushBack [_marker,_x];
        } foreach _members;
            
        while {visibleMap} do {
            {
                private["_marker","_unit"];
                _marker = _x select 0;
                _unit = _x select 1;
                if(!isNil "_unit") then {
                    if(!isNull _unit) then {
                        _marker setMarkerPosLocal (visiblePosition _unit);
                    };
                };
            } foreach _markers;
            if(!visibleMap) exitWith {};
            sleep 0.02;
        };

        {deleteMarkerLocal (_x select 0);} foreach _markers;
        _markers = [];
        _members = [];
    };
};

I have not tested it out, Because i posted the similar script on the other mod 'which shall not be named'  and someone else posted this Group marker system.

 

Link to comment
Share on other sites

I tried the one from first post and sometimes the marker stucks and when you move it doesnt show your right position. I also changed to mil_dot as marker and blue color but it sometimes appears black.

Thx for the 2nd posting think thats what im looking for will try tomorrow :)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...