1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to get player on seeing line

Discussion in 'Development' started by korado531m7, Apr 17, 2018.

  1. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    can you understand....?
    Sorry for bad expression.
    how to write this, like railgun?
    Thank you for answering.
     
  2. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    Please elaborate
     
  3. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    $event->getPlayer();?
     
  4. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    i want to get player where a player is
    on the line-of-sight
     
  5. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    So you want to get the players which are in your line of sight?
     
  6. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    yes
     
  7. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Check if your x or z is similar to the other players
     
  8. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    but,it is possible to get player where is too far away?
     
  9. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    Please stop pushing him in the wrong direction
     
  10. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    he should get the Yaw and Pitch
     
  11. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    how do i use that?
     
  12. yuko fuyutsuki

    yuko fuyutsuki Slime

    Messages:
    77
    GitHub:
    fuyutsuki
    NOTE:
    Since both he and I lives in Japan, think that Japanese will be transmitted better, so I use it. I'm sorry.

    すみませんが日本語で失礼します。
    とある通り、YawとPitchを取得してから三角関数を使用して、その向きの座標を求める必要があります。
    が、pmmpではEntityクラスにgetDirectionVector()という関数があるので、それを使用します。
    あとは矢などのプロジェクタイル等の応用で、取得した座標に向けて発射するだけです。
     
  13. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    Yes i know that function getDirectionVector, also it can with using yaw pitch.
    but i don’t know how do i write about that.
    in addition, is it possible to get player from received coordinates?

    getDirectionVector関数は知っています
    また、yaw, pitchで何かしらの処理をしたらできるのだとは分かります
    が、書き方が思いつかないんです…
    また、その取得した座標からプレイヤーがいるかどうかの取得は可能ですか?
     
  14. yuko fuyutsuki

    yuko fuyutsuki Slime

    Messages:
    77
    GitHub:
    fuyutsuki
    https://github.com/BEcraft/GunShop/blob/master/src/Gun/Main.php
    Ok, this repo would be of use to you.
    このレポジトリが役に立つでしょう。

    飛翔体はこのように書きますが、これに当たり判定($player->distanceもしくはAxisAlignedBBなどを用いる)、及び演出パーティクルを出さないといけません。
    そのため、tick毎に位置を確認する、等の重い処理が必要になります。
     
  15. korado531m7

    korado531m7 Slime

    Messages:
    77
    GitHub:
    korado531m7
    I’ll check it out later
    Thanks

    後で確認します
    ありがとう
     
  16. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    Im guessing they helped each other.
     
  17. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Yeh, but not another people that search that thread, with that chinese or another kind of language that for me they are just drawings..
    by the way, I wonder how they can make drawing letters and normal letters together at the same time? in Japan is so advanced that the keyboard should be for both things
     
    Last edited: Apr 18, 2018
    yuko fuyutsuki likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.