Jump to content
Luft08

createMarker question

Recommended Posts

The wiki gives an example of the use of createMarker:

_marker1 = createMarker ["Marker1", position player];

It also explains the parameters as: name, position and says that it returns a string. However, I don't understand what the string is. How can I use it? Is it some kind of id?

Share this post


Link to post
Share on other sites
26 minutes ago, Luft08 said:

However, I don't understand what the string is.

It will be "Marker1" the name given to the marker, as all markers are referenced via their name.

For instance getMarkerPos

Quote

Syntax:

getMarkerPos markerName

Parameters:

markerName: String

 

Share this post


Link to post
Share on other sites

So it returns one of the parameters that I supply? I don't understand how that is helpful?

Share this post


Link to post
Share on other sites

You can then use that string to further manipulate the associated marker, for instance to move it, change its appearance, or delete it.

  • Like 1

Share this post


Link to post
Share on other sites

Yes, but my point is that it is a string that I supplied so I could do that even if it didn't return anything. I already have the string.  Maybe I'm not understanding something?

 

Oh well, it is what it is...

Share this post


Link to post
Share on other sites
4 minutes ago, Luft08 said:

Yes, but my point is that it is a string that I supplied so I could do that even if it didn't return anything. I already have the string.  Maybe I'm not understanding something?

 

Oh well, it is what it is...

You can use the returned string to check if the marker has been created successfully.

Marker creation can fail if the marker name is already used by a marker, the createMarker command returns an empty string in that case.

 

Cheers

  • Like 1

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

×