Zaflis wrote: Sun Dec 03, 2023 11:46 am
Qon wrote: Sun Dec 03, 2023 11:18 amIt's meant to be usable even by players with no coding experience. Modders are expected to have higher technical abilities.
And i just demonstrated why the command is not very accessible to people without coding experience.
Git gud.
People without coding experience shouldn't complain about coding being too hard. They should try to learn, or just give up and not complain. You already have your pingmap() function, you wrote it, the API isn't improved by every possible use of rich text being reduced to a function with less power.
pingmap() broadcasts the message to all players. That's a decision you made. Not all users of a hypothetical pingmap() want that behavior.
Are you suggesting every rich text token, with every possible print function (on game, force, player, surface, RCON), gets it's own function?
something like surface.armor(player) so mods can "easily" print the armor (and nothing else) of 'player' to everyone on 'surface'?
Also, the rich text tokens are same syntax as phpBB codes, the codes we use to
format text on this forum. If you can do that then you can use [gps=x,y] as well.
Zaflis wrote: Sun Dec 03, 2023 11:46 am
Qon wrote: Sun Dec 03, 2023 11:18 amYou would need a reference either way, both are equally memorable. And looking up a reference is not that hard and also expected when writing code. That's what it is for.
Like i just said i looked for reference but i didn't find it. See for yourself:
https://www.google.com/search?q=factori ... ng+command
And i could memorize something like Ping() after seeing it once, it's trivial.
The API shouldn't be made for the lowest common denominator. That will make it worse and bloated.
Zaflis wrote: Sun Dec 03, 2023 11:46 am
Qon wrote: Sun Dec 03, 2023 11:18 am
Wrong, console command users can wrap it in a function.
That even more requires a reference, and how often do you see functions given for console commands? How would it make sense for this case?
The /c command is just Lua. If you know Lua it's obvious. If you don't know Lua of course you won't understand. Maybe make a first attempt at learning Lua before you complain about not understanding Lua?
Well, I see /c being used when
I use it. I don't expect players to use it normally (but /c has nothing to do with [gps=x,y]). So I would say it's fairly common to use functions in your /c code when you want to input anything non-trivial.
I'm arguing that this is so trivial that a function would be pointless, but if you want to ping your own location to everyone just paste this into console:
Code: Select all
/c
function pingmap(e)
game.print("[gps="..e.position.x..","..e.position.y..","..e.surface.name.."]")
end
pingmap(game.player)
Zaflis wrote: Sun Dec 03, 2023 11:46 am
Qon wrote: Sun Dec 03, 2023 11:18 am
The ping appears in chat. Rich text objects in chat are a part of messages in chat. You want a lot of unnecessary functions that removes functionality from the print functions, like differentiation between game.print(), force.print() and player.print(), and the ability to have more things than just a single ping in the message. If a mod is pinging the map in chat it's confusing for the players if the ping doesn't come with an explanation of why the mod is pinging your map.
Ping and the explanation can and should be in separate message lines. But for more comprehensive use the rich text option is still there.
Wrong. They should be together in the same message so that you know which explanation belongs to which coordinate.
Zaflis wrote: Sun Dec 03, 2023 11:46 am
Qon wrote: Sun Dec 03, 2023 11:18 am
Yes, surface.name. Your confusion is not an argument.
Part of the point was the necessity to even make such a function when using the pings. It's an unnecessary time waste.
And why arguing over this when it is only for benefit of players and modders?
You are arguing for wrapping a single line of trivial code in a function that then requires a line of code to call, and adding that to the API so everyone else can be read the documentation and think "WTF did they add this specific thing that can't even be configured to be used with the correct print method and can't use any other text with it!?!?"
You want a personal API, written specifically for your own usecase. That's useless.
Zaflis wrote: Sun Dec 03, 2023 11:46 am
And why arguing over this when it is only for benefit of players and modders?
"Benefit", LOL.
If you are using function calls then you are a modder. How is this at all useful to players? Players don't use Lua.