Jump to content
jchob

Tracking arrows, bullets, musket ball, etc

Recommended Posts

Hello. 

Maybe this was asked already, but we need a way to track where arrows, bullets musket balls, etc land. Or what item they hit. We can't get a ON damage for players. 

Actually I can make a work around with spawning a trigger zone and enabling/disabling it to follow a player. But only throwing grenades will trigger it.

Idea is, one example: shooting a "poison arrow" to damage a player over time.

I can make it work with NPCs because they have a ON damage event. I then check what active weapon is active on the player that is shooting. That kinda check if it is a template bow and then I can script the poison HP. 

Hope I make sense. 

??

Share this post


Link to post
Share on other sites

There is a way to rig an event listener to capture ON DAMAGE for players.  I have one in use as part of a custom hit point system in one of my game modes I'm working on.  I'll have to look it over when I get home, but I do know it can be done.

Share this post


Link to post
Share on other sites

The easiest solution would be to use an event listener for damage. You could have the bow deal a specific amount of damage as an "ID" and use that to trace back to who shot it.

For example bow 1 = 1dmg

Bow 2 = 2 damage

If there is no trigger entity and the damage amount = ....

Then Do X action

Share this post


Link to post
Share on other sites
6 hours ago, Indomitus said:

There is a way to rig an event listener to capture ON DAMAGE for players.  I have one in use as part of a custom hit point system in one of my game modes I'm working on.  I'll have to look it over when I get home, but I do know it can be done.

I didnt find anything on event listener that handles that. It might not be the easy way then... 

If you can show me some pics ?

Edited by jchob

Share this post


Link to post
Share on other sites

1.  Set your Event Listener to "Interaction Between 2 Entities."  Set Trigger Object to "Any Entity" and Target Object to "Any Player".  You can now select ON DAMAGE as the event.

Ylands_200107_192939.png.ec6cdb1cad6578c57c2902429f6252a6.png

 

2.  In the On Damage event, my system checks if the Target Entity (damaged player) has a specific Entity Storage, then passes the info to that for the calculations.

Ylands_200107_192958.png.40278f5d07c8666aa862fc78bd4a2cd6.png

 

3.  The first thing to check is the Trigger Entity.  You can use the "Is Entity" tile to verify it's an object (and not the ground) which will narrow it down to other players or animals (and maybe cars?)...  OR check it against an array such as the list of players in a Role or Label.  My system adjusts for all damage, depending on what caused it, so I have script for both.

Ylands_200107_193549.png.0fb0ba56220f1861b93fcad2eb18c8be.png

 

 

Edited by Indomitus

Share this post


Link to post
Share on other sites
2 hours ago, Indomitus said:

1.  Set your Event Listener to "Interaction Between 2 Entities."  Set Trigger Object to "Any Entity" and Target Object to "Any Player".  You can now select ON DAMAGE as the event.

Ylands_200107_192939.png.ec6cdb1cad6578c57c2902429f6252a6.png

 

2.  In the On Damage event, my system checks if the Target Entity (damaged player) has a specific Entity Storage, then passes the info to that for the calculations.

Ylands_200107_192958.png.40278f5d07c8666aa862fc78bd4a2cd6.png

 

3.  The first thing to check is the Trigger Entity.  You can use the "Is Entity" tile to verify it's an object (and not the ground) which will narrow it down to other players or animals (and maybe cars?)...  OR check it against an array such as the list of players in a Role or Label.  My system adjusts for all damage, depending on what caused it, so I have script for both.

Ylands_200107_193549.png.0fb0ba56220f1861b93fcad2eb18c8be.png

 

 

Omg, I feel so dumb now.. Yeah between 2 entities. I've used it many times before. Maybe I should put down the smokes. Lol

Lets pretend I didnt ask it ?

Edited by jchob

Share this post


Link to post
Share on other sites

To kind of backtrack a little, if you only want to detect PvP damage, you can set both to "Any Player".  (I got a little caught up in my specific settings, since I'm detecting all damage.)

 

...this is mostly for the sake of other players who need to learn how to do it, and find this thread.

Edited by Indomitus
  • Like 1

Share this post


Link to post
Share on other sites

It's like I always overthink on things. 

For example, some time ago I wanted to make a "driver" for cars. So only certain players could drive the car. Thus, I made all engines on/off depending on the players I wanted.... 

2 days after I realized there was a tile called SET vehicle driver ? ahaha

  • Haha 1

Share this post


Link to post
Share on other sites

@Adam Snellgrove would it be better to move this to the Editor Help subforum, I think.
I have a new question/problem/bug?

Edited by jchob

Share this post


Link to post
Share on other sites

@Igor Q. @Indomitus
I'm testing the poison "thing" that once a NPC is damaged it will loose HP over time.

I use a time trigger over 10 seconds and it "takes HP" from the NPC. The problem is, NPC doesn't die. It keeps walking at same spot. Yes... walking at same spot, i'm not crazy :D
Although if I hit NPC again it dies this time.

Anyway, for what i'm doing that wouldn't be a problem because I don't want players to die. Instead of, when their HP is bellow a certain amount, I'm going to set their position to the "starting point".

Well, take a look: 
 

 

Edited by jchob

Share this post


Link to post
Share on other sites

Maybe. If you could make a seperate forum post about this in the bug section @jchob (just copy what you just said here), we'll look at it tomorrow with the bug team.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×