skript-particle
使用最少麻烦创建复杂粒子效果的 Skript 插件。
需要 Skript 2.7+、Java 17+、Paper 1.18 - 1.20.4
在 发布页面 下载。
你可以在这里的 Issues 标签页 寻求帮助、提出建议或表达不满,或者在 skript-chat discord 上交流。
Skript-Particle 旨在提供用于通过粒子创建复杂形状的语法。虽然像 SkBee 这样的插件已经存在强大且高效的粒子语法,但创建形状需要更多的努力和专业知识。
此外,即使不考虑每次绘制时都需要重新计算形状这一通常需求,它们的性能也天生低于 Java。
Skript-Particle 的目标是提供易于使用、灵活且强大的语法来创建粒子形状。
基本结构是一组各种形状,如圆形、线条、多边形等。这些形状相对于一个中心点定义,并不固定在特定位置。
绘制语法接受一组形状和一个位置,并围绕该位置绘制所有形状。
这允许定义一组只需定义一次的形状,然后可以在许多位置和许多旋转角度下绘制它们。
由于形状可以作为一个整体进行旋转,因此只需一行代码即可轻松更改形状的旋转和方向。
以下是一些示例代码:
command /magic:
trigger:
set {_shapes::outer-circle} to a circle of radius 2.225
set {_shapes::inner-circle} to a circle of radius 2
set {_shapes::tiny-circle} to a circle of radius 0.875
set {_shapes::triangle-1} to a triangle with radius 2
set {_shapes::triangle-2} to a triangle with radius 2
rotate shapes {_shapes::triangle-2} around y axis by 60 degrees
set particle of {_shapes::*} to electric spark
循环 200 次:
设置 {_view} 为从玩家视角的偏航角(yaw)和俯仰角(pitch)生成的向量
设置 {_yaw} 为 {_view} 的偏航角
# 计算旋转形状所需的旋转角度
设置 {_rotation} 为从向量(0, 1, 0)到 {_view} 的旋转
在玩家的视线位置 ~ {_view} 处绘制形状 {_shapes::*}:
# 仅在此绘制调用中生效,原始形状不会被修改
# 注意:这会对每个形状调用一次,因此是“绘制的形状”而非“绘制的形状们”
将绘制的形状按 {_rotation} 进行旋转
# 形状会选择最短路径旋转到目标角度,但这会导致在我们转动时它看起来像是在旋转。
# 因此,我们通过让形状绕 Y 轴旋转玩家偏航角的负值来纠正这一点
将绘制的形状绕相对 Y 轴旋转 -1 * {_yaw}
等待 1 刻
当前功能:
- 形状:
- 贝塞尔曲线
- 圆、椭圆、球体和椭球体
- 圆柱体和椭圆柱体
- 弧线和球冠
- 螺旋线
- 直线
- 二维正多边形和不规则多边形及棱柱
- 正多面体
- 矩形和长方体
- 绘制:
- 三种样式:轮廓、表面和填充。部分形状仅支持其中一种或两种样式。
- 可旋转至任意方向。
- 缩放和平移偏移。
- 同时绘制多个形状。
- 可选粒子可见对象(针对特定玩家)
- 自定义粒子数据和每种形状的密度
- 调试坐标轴,清晰展示形状的朝向。
- 仅在形状实际发生变化时才进行计算,因此你可以多次绘制相同的形状而没有任何性能损耗。
- 可选择使所有计算和绘制同步执行(默认异步)
- 动态位置,粒子可跟随实体移动,无需用户额外操作
- 粒子:
- 动画:
计划中的特性:
- 形状:
- 由函数定义的自定义形状
- “常见但难以编码”的形状,如心形、星形等
- 绘制:
- 将多个形状组合成一个自定义形状,并作为单一形状进行绘制。
- 渐变色场,支持自定义颜色节点。
- 动画:

skript-particle
Skript addon for creating complex particle effects with minimal hassle.
Requires Skript 2.7+, Java 17+, Paper 1.18 - 1.20.4
Download at the releases page.
You can find help, give suggestions, or voice complaints in the Issues tab here, or on the skript-chat discord here.
Skript-Particle is intended to provide syntax for creating complex shapes with particles. Competent and powerful particle syntaxes exist in addons like SkBee, but creating shapes requires a lot more effort and know-how.
They're also inherently slower and less performant than Java, even without considering the usual need to re-calculate the shape each time it's drawn.
The goal for Skript-Particle is to provide easy-to-use, flexible, and powerful syntax to create particle shapes.
The basic structure is a set of various shapes, like circles, lines, polygons, and more. These shapes are relative to a center point and aren't positioned anywhere specific.
The drawing syntax takes a set of shapes and a location and draws all the shapes relative to that location.
This allows the definition of a bunch of shapes that only need to be defined once and can then be drawn in many places and in many rotations.
Since shapes can be rotated as a group, it's also very simple to change the rotation and orientation of your shapes with a single line.
Here's some example code:
command /magic:
trigger:
set {_shapes::outer-circle} to a circle of radius 2.225
set {_shapes::inner-circle} to a circle of radius 2
set {_shapes::tiny-circle} to a circle of radius 0.875
set {_shapes::triangle-1} to a triangle with radius 2
set {_shapes::triangle-2} to a triangle with radius 2
rotate shapes {_shapes::triangle-2} around y axis by 60 degrees
set particle of {_shapes::*} to electric spark
loop 200 times:
set {_view} to vector from yaw player's yaw and pitch player's pitch
set {_yaw} to yaw of {_view}
# figure out the rotation needed to rotate the shape
set {_rotation} to rotation from vector(0, 1, 0) to {_view}
draw the shape {_shapes::*} at player's eye location ~ {_view}:
# only happens for this draw call, the original shape is not modified
# note that this is called once for each shape, hence `drawn shape` and not `drawn shapes`
rotate drawn shape by {_rotation}
# the shape takes the shortest path to rotate to the desired rotation, but that causes it to appear to rotate as we turn.
# so we'll correct for it by rotating the shape around the y axis by the yaw of the player
rotate drawn shape around relative y axis by -1 * {_yaw}
wait 1 tick
Current Features:
- Shapes:
- Bezier Curves
- Circles, Ellipses, Spheres, and Ellipsoids
- Cylinders and Elliptical Cylinders
- Arcs and Spherical Caps
- Helices
- Lines
- 2D Regular and Irregular Polygons and Prisms
- Regular polyhedra
- Rectangles and cuboids
- Drawing:
- Three styles: outline, surface, and filled. Some shapes only support one or two of these styles.
- Rotation to any orientation.
- Scaling and offsetting.
- Drawing multiple shapes at once.
- Options for who sees the particles (player specific)
- Custom particle data and density per shape
- Full support for SkBee's particle data syntaxes
- Debug axes for clear visualization of the orientation of your shape.
- Shapes are only calculated when they actually change, so you can draw the same shape many times without any performance hit.
- Option to make all calculation and drawing synchronous (async by default)
- Ability to continuously draw a shape for a timespan (async only)
- Dynamic locations, so particles can follow an entity with no additional user effort
- Particles:
- Expression for custom particles
- Section for custom particles
- Animation:
- Ability to stretch out drawing a shape over a timespan
Planned Features:
- Shapes:
- Custom shapes defined by a function
- "Common but difficult to code" shapes like hearts, stars, and more
- Drawing:
- Combining shapes into a custom shape to be drawn as a single shape.
- Gradient colour fields, with custom colour nodes.
- Animation:
- Set up a pre-made animation in a custom structure, play back with one draw call

评论 0
登录后参与评分
还没有评论,来抢沙发吧