Function parameter upgrade #6472
Unanswered
ScienceKit
asked this question in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I had an idea that if we have a function:
function example(p: player):
send "Hellp, %{_p}%" to {_p}
And we then have to type out {_p} every time we want to get a player. An idea to make skript even more intuitive would be to be able to use "player" instead of {_p} if there is only one player parameter, and we can extend this outside player type, we have keywords like "entity" "block" "item" "number".
We could also add "arg-1" and "arg-2" too if we have multiple of them. We can also add item-1, item-2... to differentiate them. We could throw an error if the programmer uses "player" in for example
function example2(p1: player, p2: player):
We could extend this further and add another way to declare a parameter without a namefunction example3(player, player, item):
They would be accessible only through this new syntax.This would allow people to copy code from a player event(like a command or on inventory click) to a function without meticulously replacing every "player" to "{_p}"
Beta Was this translation helpful? Give feedback.
All reactions