-
-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Function Call: #7049
Comments
I can't see anything you can do with this that you couldn't do by just putting your code inside the function itself. |
Could be handy to let Skript users make 'API' endpoints to listen to custom events of some sorts. |
This comment was marked as abuse.
This comment was marked as abuse.
Not commenting on the usefulness or lack of here, but this event does existing in skript internally already, however it is disabled due to performance concerns and must be enabled by (and syntax implemented by) an addon. |
Hello, please try to behave politely on the issue tracker. In case it wasn't clear, which I suppose it may not have been, listening to a specific function by its literal name as you suggested will not create any new possibilities that you couldn't achieve by putting your code into the function itself. To use the example you gave:
would be functionally identical to just doing
or, if that's not to your liking,
|
This comment was marked as abuse.
This comment was marked as abuse.
Hey, there's no need to insult someone because they disagree with your suggestion. |
I don't think this would actually result in cleaner code, as calling the function now has side effects you can't identify by looking at the function itself. You could use skript-reflect to make a custom event, or use the dynamic function call capabilities that are being worked on in #6713. |
Suggestion
an on Function Call event:
for example:
i have a function "broadcast(message: text)"
so id do:
on function "broadcast" call:
add 1 to {functioncalledamount}
event values:
Why?
so id do:
on function "broadcast" call:
add 1 to {functioncalledamount}
obviously this is a very basic example.
and obviously you can just add 1 in the function itself
but it's for code to look cleaner,
for example a quests system, where lets say you must open crates 5 times
and if you use a function to open crates, "openCrate(p: player, crate: text)"
you could just do on function call, for --every single quest type-- in one script file.
making it very clean
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: