Hit detection of the shoot command with item_projectile
-
- User
- Posts: 22
- Joined: August 6th, 2016, 4:53 pm
- Location: Germany
- Contact:
Hit detection of the shoot command with item_projectile
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.
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
- Site Admin
- Posts: 299
- Joined: August 5th, 2016, 7:27 pm
- Location: Los Angeles, California, USA
- Contact:
Re: Hit detection of the shoot command with item_projectile
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
That should help clarify which part is going wrong
Denizen lead developer. On Discord as
mcmonkey#6666
.-
- User
- Posts: 22
- Joined: August 6th, 2016, 4:53 pm
- Location: Germany
- Contact:
Re: Hit detection of the shoot command with item_projectile
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
Using the hurt command directly with an "/ex hurt <npc[1111]> 5" works 100% btw
- mcmonkey
- Site Admin
- Posts: 299
- Joined: August 5th, 2016, 7:27 pm
- Location: Los Angeles, California, USA
- Contact:
Re: Hit detection of the shoot command with item_projectile
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. On Discord as
mcmonkey#6666
.-
- User
- Posts: 22
- Joined: August 6th, 2016, 4:53 pm
- Location: Germany
- Contact:
Re: Hit detection of the shoot command with item_projectile
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.
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
- Site Admin
- Posts: 299
- Joined: August 5th, 2016, 7:27 pm
- Location: Los Angeles, California, USA
- Contact:
Re: Hit detection of the shoot command with item_projectile
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. On Discord as
mcmonkey#6666
.-
- User
- Posts: 22
- Joined: August 6th, 2016, 4:53 pm
- Location: Germany
- Contact:
Re: Hit detection of the shoot command with item_projectile
For someone who might find this thread. Issue was fixxed.
Who is online
Users browsing this forum: No registered users and 2 guests