-
-
Notifications
You must be signed in to change notification settings - Fork 392
calloption function #4786
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
Comments
A default function to get an option would certainly be possible (likely after #4108 is merged). Either that or an expression maybe |
I don't think options should be used for this purpose, this is what variables are for: #1140 (comment) |
Also, if you really wanted to use an option but be able to reference it at runtime in addition to at parse time, you can already do that by setting a variable to the option |
It might be useful IMO, sometimes you may not want to use variables to avoid storing specific data in variables file as they may not need to be there (for any reason) and just use it directly from options. I just don't see a disadvantage in such enhancement unless it's complex to implement. |
The original thought I had for this came after trying to figure out a way to make a configurable shop-gui. Basically the idea was, if someone wanted to make a shop they would just have an option named like And I think that it would just be kinda weird to make the user write code like Oh also this would help a great amount with just making one config file for a script has many files. Instead of needing to make a function that makes you account for every option individually, you could just make a function that's like
This would also allow (for custom item making scripts) to be much better. For example what if you could make a script where you could create a fully custom item just by doing this:
Idk if this made any sense I'm not very good at getting my points across in written words. Basically: Would make, making scripts that are more complex but also user non-developer friendly, possible. |
This is not an appropriate use of options, there are many other (better) ways to achieve the same thing. |
Uh oh!
There was an error while loading. Please reload this page.
Suggestion
I was talking to some people yesterday in the SkUnity discord to try and see if it was possible to get skript options without hard code calling them.
on example being
command /getoption [<text>]: trigger: send "{@%arg 1%}"
Figured out this was impossible but I had an idea, what if there was a function for example, calloption(), that would allow you to get an option converted into a string like
calloption("prefix")
and it would return the prefix as a string, even if the prefix wasn't necessarily written as a string. You could maybe make this work with numbers or integers but idk enough about java for that.Just thought this would be a neat idea and would help with making better configs in script.
Why?
Would be very useful
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: