Spring.AddMarkerPoint()

Spring.AddMarkerPoint()

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
LEDZ
Posts: 66
Joined: 27 Jun 2011, 13:43

Spring.AddMarkerPoint()

Post 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?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Spring.AddMarkerPoint()

Post by SirMaverick »

5th argument is boolean to set local or non-local points. Default is local points (=false).
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring.AddMarkerPoint()

Post 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. :(
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Spring.AddMarkerPoint()

Post 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.
LEDZ
Posts: 66
Joined: 27 Jun 2011, 13:43

Re: Spring.AddMarkerPoint()

Post 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?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Spring.AddMarkerPoint()

Post 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
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Spring.AddMarkerPoint()

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Spring.AddMarkerPoint()

Post 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. :|
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Spring.AddMarkerPoint()

Post by zwzsg »

Make it local. I hate it when people with widgets that autospam markers join my games.
LEDZ
Posts: 66
Joined: 27 Jun 2011, 13:43

Re: Spring.AddMarkerPoint()

Post 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.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Spring.AddMarkerPoint()

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Spring.AddMarkerPoint()

Post 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 :)
LEDZ
Posts: 66
Joined: 27 Jun 2011, 13:43

Re: Spring.AddMarkerPoint()

Post 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).
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Spring.AddMarkerPoint()

Post 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)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Spring.AddMarkerPoint()

Post 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.
LEDZ
Posts: 66
Joined: 27 Jun 2011, 13:43

Re: Spring.AddMarkerPoint()

Post 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?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Spring.AddMarkerPoint()

Post 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)
Post Reply

Return to “Lua Scripts”