エンティティからエンティティまで、線のようなパーティクルを出す方法

on rightclick holding diamond axe:
loop all entities in radius 5 around player:
if loop-entities isn't "%player%":
set {_loc1} to location of loop-entity
set {_loc2} to location of the player
set {_v} to vector between {_loc1} and {_loc2}
play flame on player's location ~ {_v}
on rightclick holding diamond axe:
loop all entities in radius 5 around player:
if loop-entities isn't "%player%":
set {_loc1} to location of loop-entity
set {_loc2} to location of the player
set {_v} to vector between {_loc1} and {_loc2}
play flame on player's location ~ {_v}
15 Replies
makaronipizaa
makaronipizaaOP2mo ago
今とりあえず自分から周囲にいるエンティティに向かってパーティクルを出そうと思っているのですが vectorの教育が甘く何も手を付けられない状況です
yukkina
yukkina2mo ago
rayfallかなdragonかな drawLINEみたいなエフェクトもありますよ
月猫ch
月猫ch2mo ago
普通に今のうちvectorに手を出した方が良さそう ちなみにA地点からB地点までのvectorは vector from A to B
makaronipizaa
makaronipizaaOP2mo ago
ありがとうございます!頑張ってみます それでも無理そうだったらまたここにきます skdragonの仕様がよくわかんなかったんですよね
makaronipizaa
makaronipizaaOP2mo ago
これ真反対にエフェクトは出るのはなんでだ
No description
makaronipizaa
makaronipizaaOP2mo ago
{_v}がそもそもクリーパーを指してない感じっぽい? どういう仕様なんだ なんか{_loc2}と{_loc1}で順番変えたら普通にいけた まじで線で出す方法がわからん
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
今どういうコード?
makaronipizaa
makaronipizaaOP2mo ago
on rightclick holding diamond axe:
loop all entities in radius 5 around player:
if loop-entities isn't "%player%":
set {_loc1} to location of loop-entity
set {_loc2} to location of the player
set {_v} to vector from {_loc2} to {_loc1}
play flame on player's location ~ {_v}
on rightclick holding diamond axe:
loop all entities in radius 5 around player:
if loop-entities isn't "%player%":
set {_loc1} to location of loop-entity
set {_loc2} to location of the player
set {_v} to vector from {_loc2} to {_loc1}
play flame on player's location ~ {_v}
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
これじゃあentityの位置にパーティクル出すだけだね vectorの長さを0からplayerとloop-entity間の距離まで変えながら表示しよう
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
Skript Hub - Documentation
Vectors - Length (Expression) - Skript
Gets or sets the length of a vector.
月猫ch
月猫ch2mo ago
まあどうしてもわからなかったら、サンプルコード出すから りばーすえんじにありんぐ というやつで学べばよろし
___
___2mo ago
AからBに向かって線を出したいからAの座標に線分の長さを変えて足していく だから線分の長さによって各座標が変わってほしい 2次元の場合は ax + b = y でxの値によってyが変化する だからxが線分の長さでyが各座標にしてみる ABの長さをnとしてkを0からnの範囲で変えてみる k (0≦k≦n) 各成分がABの長さによって変化するから a_1 × k + b_1 = x a_2 × k + b_2 = y a_3 × k + b_3 = z k = 0 のとき b_1 = x1 b_2 = y1 b_3 = z1 k = n のとき a_1 × n + x1 = x2 a_2 × n + y1 = y2 a_3 × n + z1 = z2 だから a_1 = (x2 - x1) / n a_2 = (y2 - y1) / n a_3= (z2 - z1) / n a × k + b に代入して x1 + k × (x2 - x1) / n = x y1 + k × (y2 - y1) / n = y z1 + k × (z2 - z1) / n = z これくらいならなんかそれっぽくやればベクトルなしでもいけるかもしれない
makaronipizaa
makaronipizaaOP2mo ago
なるほど、やってみます
loop all entities in radius 9 around player:
if loop-entities isn't "%player%":
set standard length of {_v} to 0
set {_kyori} to 1
set {_loc1} to location of loop-entity
set {_loc2} to location of the player
set {_v} to vector from {_loc2} to {_loc1}
set {_dist} to distance between {_loc2} and {_loc1}
loop {_dist} times:
set standard length of {_v} to {_kyori}
drawDot count 1, particle "redstone", RGB 250, 250, 110, center player's location ~ {_v}, rainbowMode false, visibleRange 32, pulseDelay 0, keepFor 20 ticks
drawDot count 1, particle "redstone", RGB 245, 130, 43, center player's location ~ {_v}, rainbowMode false, visibleRange 32, pulseDelay 0, keepFor 20 ticks
add 1 to {_kyori}
loop all entities in radius 9 around player:
if loop-entities isn't "%player%":
set standard length of {_v} to 0
set {_kyori} to 1
set {_loc1} to location of loop-entity
set {_loc2} to location of the player
set {_v} to vector from {_loc2} to {_loc1}
set {_dist} to distance between {_loc2} and {_loc1}
loop {_dist} times:
set standard length of {_v} to {_kyori}
drawDot count 1, particle "redstone", RGB 250, 250, 110, center player's location ~ {_v}, rainbowMode false, visibleRange 32, pulseDelay 0, keepFor 20 ticks
drawDot count 1, particle "redstone", RGB 245, 130, 43, center player's location ~ {_v}, rainbowMode false, visibleRange 32, pulseDelay 0, keepFor 20 ticks
add 1 to {_kyori}
このようにしたらいけました!ありがとうございます!!
月猫ch
月猫ch2mo ago
Vector 「(´・ω・`)」
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server