MrsDarth / Skirt

2 stars 2 forks source link

Raytracing: Entities #5

Closed eem50 closed 2 years ago

eem50 commented 2 years ago

Hey MrsDarth,

I'm a big fan of your Skirt addon, especially the raytracing feature. I've got two issues with it though.

First of all the entity detection doesn't seem to work, or I'm just doing something wrong. Here is the code I'm using: image

And here is the result I'm getting: image The problem is that it doesn't seem to hit entities, When broadcasting the raytracing result it just says hitEntity=Null though I'm clearly targeting an entity.

My second problem is that there raytracing isn't mentioned at all in the Skirt Wiki, the only place where you can find the syntax for it is on skripthub. Some examples or a wiki page of it would be more than welcome :D

I hope you can help me with my issues :)

Greetings Eem50

MrsDarth commented 2 years ago

You are using the first syntax which is ray trace from living entities and this only accounts for blocks. If u want to account for entities you should use the entity ray trace or generic

edit: I’ll work on wiki one day

eem50 commented 2 years ago

Thanks for you response :D

Currently testing generic ray trace using this code: afbeelding When I reload the skript it gives me no errors, however the command doesn't seem to exist. I've tested this multiple ways and generic ray trace just seems to break the skript every time... Proof: afbeelding

I also tried using entity ray trace, that one didn't break my skript but I just couldn't get a result (I'm suspecting it's broken too...) afbeelding Whenever I'm using it and standing south of a mob, it just says . I also tried getting a 'hit entity of {_raycast::*}' but no luck either. Also no compile errors on the second skript btw

MrsDarth commented 2 years ago

Are you using the pre release? I haven’t tested almost anything at all on it and can only work on it next week when I’m free

eem50 commented 2 years ago

Thanks for the fast response.

Yes, I’m using the pre-release. I’m assuming that is the problem. Then I’ll just have patience till you have fixed it (which I hope you will). Good luck :)

MrsDarth commented 2 years ago

I updated the release and tested with entity ray trace from player's eyes using forward filtering player and works now.

eem50 commented 2 years ago

Thanks again for helping me :D. I've worked with the entity ray trace and it works great! Skirt is truly the missing addon I need for my server.

I also tried generic ray trace but that didn't seem to give me any response... Here the code that shows off the problem

command /raytracetest:
    trigger:
        broadcast " "
        set {_raycast::*} to ray trace from player
        broadcast "Default ray trace: %hit location of {_raycast::*}%"
        broadcast "Default ray trace: %hit entity of {_raycast::*}%"
        broadcast "Default ray trace: %hit block of {_raycast::*}%" 
        broadcast " "

        set {_raycast::*} to entity ray trace from player's eyes using forward filtering player
        broadcast "Entity ray trace: %hit location of {_raycast::*}%"
        broadcast "Entity ray trace: %hit entity of {_raycast::*}%"
        broadcast "Entity ray trace: %hit block of {_raycast::*}%"
        broadcast " "

        set {_raycast::*} to generic ray trace from player's eyes using forward filtering player
        broadcast "Generic ray trace: %hit location of {_raycast::*}%"
        broadcast "Generic ray trace: %hit entity of {_raycast::*}%"
        broadcast "Generic ray trace: %hit block of {_raycast::*}%"

And here the console afbeelding

MrsDarth commented 2 years ago

my bad wrote the syntax wrong should work now

eem50 commented 2 years ago

I tested it just 5mins ago, works great! You have no idea how much this helps me with my server :D Thanks for the help!