Page 1 of 1

Spring.AddMarkerPoint()

Posted: 05 May 2012, 18:43
by LEDZ
The Spring.AddMarkerPoint() device is local only; what is that shares a marker point placed by a player in-game with the other players? I assumed when using Unit Markers v3 that everyone could see the marks.
How can this be accomplished?

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 01:06
by SirMaverick
5th argument is boolean to set local or non-local points. Default is local points (=false).

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 01:15
by very_bad_soldier
That argument was added at some point, right? Quite strange that it defaults to local points since it changes the behavior of all widgets. All old widgets that used to do "global" markers need to be modified to work as they did in the past. :(

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 02:09
by SirMaverick
very_bad_soldier wrote:That argument was added at some point, right?
Because some widgets were spaming points. That got more annoying the bigger the game was.
Quite strange that it defaults to local points since it changes the behavior of all widgets. All old widgets that used to do "global" markers need to be modified to work as they did in the past. :(
That is a good point.

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 13:44
by LEDZ
Thanks guys. SirMaverick, where can I look to find out this sort of information (all the arguments to a function) so I don't have to ask these sort of questions?

As for the spam, I plan to add a widget:Intialise message (that come from the player that starts the widget) saying something "I am using unit marker v4"
Also, I have added functionality that automatically deletes old commander markers after ~15 secs so that it doesn't become annoying.

What I plan on doing next is to make delete an old marker if the same commander is spotted again.
What do you think?

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 13:52
by gajop
so you're creating a widget that will spam "enemy commader here" points?
rather make it local, if people want that info they can get the widget themselves

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 14:49
by SirMaverick
LEDZ wrote:Thanks guys. SirMaverick, where can I look to find out this sort of information (all the arguments to a function) so I don't have to ask these sort of questions?
Normally they are documented in the wiki. But it's not up to date.
What always works: engine source code.
As for the spam, I plan to add a widget:Intialise message (that come from the player that starts the widget) saying something "I am using unit marker v4"
As said, make the points only locally. No one want's point spam.

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 15:17
by FLOZi
It's up to date with everything recorded in the changelog form 83 onwards. If you know something is missing - add it in the right place. :|

Re: Spring.AddMarkerPoint()

Posted: 06 May 2012, 17:00
by zwzsg
Make it local. I hate it when people with widgets that autospam markers join my games.

Re: Spring.AddMarkerPoint()

Posted: 07 May 2012, 17:18
by LEDZ
I understand that people find it annoying but I have put emphasis on making sure it tidies up after itself and doesn't spam everytime something is seen (if it hasn't moved very far).
I can always turn it off it is annoying someone on my team. I think the problem was people have a had a bad experience with previous unit markers.

Re: Spring.AddMarkerPoint()

Posted: 07 May 2012, 18:35
by very_bad_soldier
I guess the most important part is WHAT you are actually marking. The original unit marker did it only for nukes and antinukes which I am still considering as useful information for the whole team.
On the other hand I am not interested to know every time a commander is spotted on the other side of the map.

Re: Spring.AddMarkerPoint()

Posted: 07 May 2012, 18:46
by knorke
SirMaverick wrote:
very_bad_soldier wrote:Quite strange that it defaults to local points since it changes the behavior of all widgets. All old widgets that used to do "global" markers need to be modified to work as they did in the past. :(
That is a good point.
I guess the idea was that some players would still use outdated widgets (that spam global) so it was the goal to "break" those.

thanks for updating arguements LEDZ :)

Re: Spring.AddMarkerPoint()

Posted: 08 May 2012, 22:53
by LEDZ
Knorke: No worries, I thought I ought to help where I can since people have helped me. I noticed I didn't do it exactly right but I couldn't find a template for adding those sorts of arguments.
One point of confusion; it's boolean (true or false) but with trial and error I figured that it accepts 0 or 1 in the Local argument. What's the precedent?
The units it marks:
Image

The commander is marked with the player's name for easy recognition of who you are against on the front line and notice that the marker text is coloured to the same colour of that of the owner. It removes old marks automatically once the same unit is spotted in a different position (at least 100 meters away).

Re: Spring.AddMarkerPoint()

Posted: 09 May 2012, 01:46
by gajop
lua like c/c++ is weaker typed than f.e java, so statements like f.e "if 5 then" are considered valid and evaluate to true (all non 0 is true)

Re: Spring.AddMarkerPoint()

Posted: 09 May 2012, 02:11
by jK
gajop wrote:lua like c/c++ is weaker typed than f.e java, so statements like f.e "if 5 then" are considered valid and evaluate to true (all non 0 is true)
Even 0 is true in Lua, only nil & false translate to boolean false.

Re: Spring.AddMarkerPoint()

Posted: 09 May 2012, 11:35
by LEDZ
What I mean is that on the wiki the argument for localOnly is boolean, but to me that means true or false, when it actually accepts 0 or 1. How should that be represented in the wiki?

Re: Spring.AddMarkerPoint()

Posted: 09 May 2012, 17:51
by FLOZi
Yeah that was my mistake, misread the code. However jk chagned it to now accept booleans as well (which in the future should probably be preferred)