Hit detection of the shoot command with item_projectile

Discuss any issues with Denizen-Bukkit scripts or functionality you may have while using it.
Post Reply
Goma_Terzu
User
User
Posts: 22
Joined: August 6th, 2016, 4:53 pm
Location: Germany
Contact:

Hit detection of the shoot command with item_projectile

Post by Goma_Terzu » November 18th, 2016, 12:25 pm

Hey mcmonkey,

it seems like the hit detection of "item_projectile" is somehow messed up. I am using the latest 1.11 dev builds.

the command is:

- shoot ITEM_PROJECTILE[item=magma_cream] origin:<player.location.add[0,1.1,0]> speed:3 script:P30Damage spread:0

the P30Damage script just says

P30Damage:
type: task
script:
- announce "<def[hit_entities]>"
- hurt 5 <def[hit_entities].get[1]>

Most of the time it announces just an empty list even if I clearly hit the mob. This was working fine.

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 199
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Hit detection of the shoot command with item_projectile

Post by mcmonkey » November 18th, 2016, 6:08 pm

Try an entity damaged event, see if you can detect the impact of the projectile into its target that way?
That should help clarify which part is going wrong
Denizen lead developer.
http://mcmonkey.org

Goma_Terzu
User
User
Posts: 22
Joined: August 6th, 2016, 4:53 pm
Location: Germany
Contact:

Re: Hit detection of the shoot command with item_projectile

Post by Goma_Terzu » November 19th, 2016, 3:53 am

You mean using the hurt argument with a cause and the check the event like "on npc damaged by cause"?

Using the hurt command directly with an "/ex hurt <npc[1111]> 5" works 100% btw

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 199
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Hit detection of the shoot command with item_projectile

Post by mcmonkey » November 19th, 2016, 12:37 pm

No. Listen for the entity being damaged by the projectile in a damaged event. No commands needed, outside 'announce' in the event.
Denizen lead developer.
http://mcmonkey.org

Goma_Terzu
User
User
Posts: 22
Joined: August 6th, 2016, 4:53 pm
Location: Germany
Contact:

Re: Hit detection of the shoot command with item_projectile

Post by Goma_Terzu » November 19th, 2016, 2:05 pm

I made

On sheep damaged:
- narrate targets:<player[Goma_terzu]> "<context.entity.name> <context.damager.name> <context.damage> <context.cause>"

Then shot the sheep with my weapons. Most of the time I did not get any narrate, only the few times the sheep got visibly damaged I got a narrate

I also made a small change to the P30Damage script from above. I also narrated the <def[location].simple> tag that comes with the shoot command and it's script argument. It always gave a reasonable location! So the bullet sometimes just went right through the sheep and hit the ground behind it.

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 199
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Hit detection of the shoot command with item_projectile

Post by mcmonkey » November 19th, 2016, 2:20 pm

If the weapon did not visibly hurt the sheep, there's no way for the shoot command to know it hit the entity :/ there's no "projectile touches entity but doesn't hurt it" event, only a damage event, and a block hit event.
Denizen lead developer.
http://mcmonkey.org

Goma_Terzu
User
User
Posts: 22
Joined: August 6th, 2016, 4:53 pm
Location: Germany
Contact:

Re: Hit detection of the shoot command with item_projectile

Post by Goma_Terzu » December 2nd, 2016, 11:34 am

For someone who might find this thread. Issue was fixxed.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest