Jump to content
easyeb

Make marker on player position

Recommended Posts

Hi! Is there a way to create a marker on a players current position and leave it where it was created?

 

I want to make the dot marker on my current location to mark out a house I've searched, and then make another marker on another house I've searched to keep track on which buildings in a city I've looked through.

 

Note, I do not want to move one and the same marker to my current position, I want to create a new one each time.

Share this post


Link to post
Share on other sites

What you ask is literally the example from the biki https://community.bistudio.com/wiki/createMarker

a little searching before asking wouldn't hurt 😉
 

_markerName = createMarker ["markername", player];
_markerName setMarkerType "hd_dot";

 

  • Like 1

Share this post


Link to post
Share on other sites

You can open map and doubleclick on the house you searched, select dot marker and press enter

  • Like 2
  • Haha 1

Share this post


Link to post
Share on other sites
22 hours ago, Mr H. said:

What you ask is literally the example from the biki https://community.bistudio.com/wiki/createMarker

a little searching before asking wouldn't hurt 😉
 


_markerName = createMarker ["markername", player];
_markerName setMarkerType "hd_dot";

 


Well, no that's not what I want. That example is for making one marker once. I want to make a new marker every time.

 

A little reading before replying wouldn't hurt 😉

Share this post


Link to post
Share on other sites

Execute this code every time you want to put a marker !
 

45 minutes ago, easyeb said:

A little reading before replying wouldn't hurt 😉

This does answer your question!

 

moduleName_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown",{
if ((_this select 1) isEqualTo 32) exitWith {
        _markerName = createMarker ["markername", player];
		_markerName setMarkerType "hd_dot";
    };
}];

Everytime you press "M" key, this will create a marker on your pos. That's just an example, you can call it anyway you like, this will make a new marker and not erase the old one.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 9/7/2019 at 12:56 PM, killzone_kid said:

You can open map and doubleclick on the house you searched, select dot marker and press enter

I personally prefer just crossing it out by drawing two lines. I think CTRL+Click+Drag? Feels much faster than creating a marker.

Share this post


Link to post
Share on other sites

Presume you will search 50 buildings.

Place 50 dots along one edge of the map. Make them the smallest possible size being 1 x 1   Make them black. (Nobody will notice them.)

Name each dot -  dot01,  dot02, .........dot49,  dot50

Place a trigger over each of the 50 buildings. That of course makes 50 triggers.

Set each trigger so they will fire only once.

Name yourself  blue1

In trigger number 1 you write:   

dot01   setpos  getpos   blue1    ///This makes one dot appear over house 1

Then write another line to increase the size of the dot to a good size

Then write another line to change the colour of the dot to say, red.

 

Write code in each of the other 49 triggers.

 

So, you enter a trigger, the trigger fires and a dot is placed over the house.

As you search house after house dots will appear over each house and remain where they have appeared.

 

.

 

.

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

@easyeb,

What about an action to mark the house searched?

player addAction ["Mark Searched", {
_markerName = createMarker ["markername", player]; 
_markerName setMarkerType "hd_dot";
}];

Have fun!

Share this post


Link to post
Share on other sites

I appreciate the input guys!

 

But this:

 

Quote

_markerName = createMarker ["markername", player]; _markerName setMarkerType "hd_dot";

 

is only good for one marker. That marker is named "markername" and since that name is taken by the first marker created, no further markers will be created. 

 

I guess what I need is a counter and to insert that to "markername" so that the first one will be "markername1" and the second "markername2" for instance.

Share this post


Link to post
Share on other sites

not understanding the difficulty in this when youve already answered yourself on how to do it lol. this will create a new marker at the players location (locally) each time the player opens the map

MapOpenedCounter = 0;
AddMissionEventHandler["Map",
{
	Params ["_MapIsOpened", "_MapIsForced"];
	
	if (_MapIsOpened) then
	{
		_MarkerText = "Me";
		_MarkerName = ("Marker" + str MapOpenedCounter);
		_Marker = CreateMarkerLocal [_MarkerName, Player];
		_Marker SetMarkerType "hd_dot";
		_Marker SetMarkerColor "ColorBlue";
		_Marker SetmarkerText _MarkerText;
		
		MapOpenedCounter = MapOpenedCounter + 1;
	};
}];

 

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×