Hit detection of the shoot command with item_projectile

Goma_Terzu

Member
Aug 6, 2016
22
0
0
Germany
www.toxicwars.com
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.
 

mcmonkey

Administrator
Staff member
Helper
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
 

Goma_Terzu

Member
Aug 6, 2016
22
0
0
Germany
www.toxicwars.com
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.
 

mcmonkey

Administrator
Staff member
Helper
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.