Skip to content
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

random vector ruturn only positive #3135

Closed
Anarchick opened this issue Jul 11, 2020 · 3 comments
Closed

random vector ruturn only positive #3135

Anarchick opened this issue Jul 11, 2020 · 3 comments
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@Anarchick
Copy link

Description

Use the expression random vector on skript 2.5 alpha5 return only positive axies

Steps to Reproduce

broadcast "%random vector%"

@Anarchick
Copy link
Author

It seems that it's not a bug but a normal utilisation of Vector#getRandom() https://papermc.io/javadocs/paper/1.15/org/bukkit/util/Vector.html#getRandom--
https://github.com/SkriptLang/Skript/blob/master/src/main/java/ch/njol/skript/expressions/ExprVectorRandom.java

So I suggest to add negative value support for the skript expression %random vector%

@ShaneBeee
Copy link
Contributor

ShaneBeee commented Aug 11, 2020

If that is the intended behaviour of Vector, please explain why Skript should break its intended behaviour and add negative values?

Couldn't you just create a new vector and use random values of your choosing?

@ShaneBeee ShaneBeee added the waiting for reply The report needs a response from the reporter to determine course of action. label Aug 11, 2020
@Anarchick
Copy link
Author

The question is why bukkit return only positive values ? it's intended or a mistake ? what is the benefit for only positive ?

When someone espect to use a random vector he would like to have a vector with 360° yaw and 180° pitch.

Yes it's easy to make a vector with random values BUT :

  • When you write some code, you try to optimize the performance ?
  • Cause of the Skript parsing, the code needed to create the +/- random vector is not optimized as it should be.
  • And after creating a random vector, you (maybe) need to set the length of this vector / normalize

What do you think about creating a new expression :
[a] random vector of length %number%

@TPGamesNL TPGamesNL added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. PR available Issues which have a yet-to-be merged PR resolving it and removed waiting for reply The report needs a response from the reporter to determine course of action. labels Mar 18, 2021
@TPGamesNL TPGamesNL added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

4 participants