Releases: bi0qaw/Vectors-Skript
Version 1.1.2
Changed the syntax for the length of a vector as it conflicted with skript's length of text expression.
New syntax:
(vector|standard|normal) length of %vector%
%vector%['s] (vector|standard|normal) length of %vector%
Old syntax:
length of %vector%
%vector%['s] length
Version 1.1.0 - Tilde Notation
This version adds tilde notation to skript. With tilde notation you can easily offset a location by a vector. It uses the following syntax:
%location% ~ %vectors%
Example usage:
teleport player to player ~ vector 1, 2, 3
Teleports the player to the location 1 east, 2 above, and 3 south of his current location.
Version 1.0.1 - Location fix
I removed the auto conversion from location to vector. The reason is that skript does not behave as expected.
You can always get the vector of a location with:
vector of %location%
%location%'s vector
Initial Release
Creating a new vector:
[new] vector [(from|at|to)] %number%,[ ]%number%(,[ ]| and )%number%
[new] vector from yaw %number% and pitch %number%
vector (of|from|to) %location%
%location%['s] vector
vector (from|between) %location% (to|and) %location%
random vector
[new] cylindrical vector [from|with] [radius] %number%, [yaw] %number%(,| and) [height] %number%
[new] spherical vector [from|with] [radius] %number%, [yaw] %number%(,| and) [pitch] %number%
Vector arithmetic:
%vector% ++ %vector%
%vector% -- %vector%
%vector% ** %vector%
%vector% // %vector%
Note: Locations and numbers are automatically converted to vectors!
The following syntaxes are all valid:
set {_v} to vector 1, 2, 3 // 5
set {_v} to player ++ vector 1, 2, 3
set {_v} to (attacker ++ victim) // 2
Getting a vector from a location:
vector (of|from|to) %location%
Converting a vector to a location:
%vector% [to location] [in] %world%
location (from|of) %vector% [(from|in)] %world%
%vector% [to location] [in] %world% with yaw %number% and pitch %number%
location (from|of) %vector% [(in|from)] %world% with yaw %number% and pitch %number%
Properties of vectors:
(x|y|z) of %vector%
vector (yaw|pitch) of %vector%
length of %vector%
%vector%['s] length%
squared length of %vector%
%vector%['s] squared length
Rotating a vector:
rotate %vector% around %vector% by %number% [degrees]
rotate %vector% around (x|y|z)(-| )axis by %number% [degrees]
Some other expressions:
angle between %vector% and %vector%
normalize %vector%
%vector% normalized
%vector% cross %vector%
%vector% dot %vector%