Jump to content

Stop a physical object with a static object


You are about to reply to a thread that has been inactive for 1185 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Is it possible to make an object lose "physics" if it touches a scripted object that orders this to lose the physics? 

my intention is to make a protective barrier against projectiles 

there are projectiles that go through walls, I want to cancel these projectiles

or failing that, something similar, but when the projectile touches the barrier (dies)

I'm at zero with this project I do not have any base script if someone is so kind to give me a start! thank you! ;C 

 

 

 

 

 

Link to post
Share on other sites

In theory, yes.   Having the projectile call llDie() in the collision_start event is the simplest way to do what you describe.   See  http://wiki.secondlife.com/wiki/LlDie and http://wiki.secondlife.com/wiki/Collision_start for more details.

I wouldn't advise having the barrier try to communicate with the projectile unless you've got a good reason to (I can't think of one, offhand, but there is a reason, I'll try to help if you explain what's supposed to happen).  

However, please be aware that a lot depends on the projectile's speed.  If it's going too fast and the barrier is too thin, it may pass through the mesh before the script and simulator have the chance to register that anything's happened (that's one way to make attachments that let you walk through walls) so you will need to experiment a bit with the projectile's speed to ensure it will be reliable in practice.

  • Confused 1
Link to post
Share on other sites

It sounds like you don't have any access to the projectiles themselves, because they're probably created by other people with no respect to your barrier.

In that case, no script will help you. You simply need a thick enough prim to make sure the projectile isn't moving so fast that the physics will "skip" through the wall between physics updates.

In SL, the positions of physical objects are updated 45 times per second. If the projectile is flying at 150 meters per second, the wall needs to be roughly 3.33333 meters thick to reliably block it. (Or 4.44444 meters if the projectile is moving at 200m/s.)

You can calculate the requirement yourself simply by dividing the meters per second with 45.

Edited by Wulfie Reanimator
  • Like 2
  • Sad 1
Link to post
Share on other sites

Well, I have seen many weapons that have 100% damage in their bullets, I want to make a barrier that annuls the absurd damage when my user decides it.

then if a bullet of any type of weapon hits this barrier, it is erased or it simply dies 

Link to post
Share on other sites
7 minutes ago, HzFox said:

Well, I have seen many weapons that have 100% damage in their bullets, I want to make a barrier that annuls the absurd damage when my user decides it.

then if a bullet of any type of weapon hits this barrier, it is erased or it simply dies 

There are two problems with that.

  1. You can't prevent the damage done by objects using llSetDamage.
  2. A bullet using llSetDamage doesn't die when it collides with other objects unless they are scripted by the creator to do so.
    They only die if they collide with an avatar (and kill them). You can't just force other objects to die.
  • Like 1
Link to post
Share on other sites

initiate the search of the script that allows me this, for the simple reason that the shield (of several layers) that I made, sometimes lets pass 1 bullet  

and there are other magical effects, which are ghosts, and go through all and impact on the avatar D; 

Link to post
Share on other sites
22 minutes ago, HzFox said:

initiate the search of the script that allows me this, for the simple reason that the shield (of several layers) that I made, sometimes lets pass 1 bullet  

and there are other magical effects, which are ghosts, and go through all and impact on the avatar D; 

Bullet projectiles tend to be long, usually at least as long as the numbers I gave earlier, for the exact same reason. People don't want their bullets going through their targets either, so, a 5-7 meters long bullet (which is typical) can go partly through a wall, be in contact with an avatar, and then hit it before disappearing. Other factors such as the speed and lower physics FPS can make the problem worse, as fewer updates will allow bullets to skip further into large objects between the updates.

I guess one thing you could do is use llSensorRepeat and llPushObject if the sim allows that. The idea being that you push the bullets to the side, causing them to miss the avatar.

Edited by Wulfie Reanimator
  • Like 2
Link to post
Share on other sites

As Innula and Wulfie have explained, changes in SL don't happen continuously.  Time is divided into frames (45 per second), so we experience change as if we were watching a movie on film -- 45 separate static images per second. There's no way for a bullet to even know that it hit a wall until it has already passed at least partway through it and is in the next frame. Communication also takes time, and so do each of the other scripted calculations that need to take place if you want to deflect or dodge something like a bullet.   In the end, there are two basic rules:

1. There is no defense against a determined offense.

2. The best defense, as Mr. Miyagi taught us, is "Not Be There."

  • Like 2
Link to post
Share on other sites

I made an auto-shielding spell for my wizardy dueling system... Any time an object is moving faster than an avatar can run, and gets within range, a shield pops up and knocks it aside (kind of like in Dune, something would have to move slowly not to set off the shield). Also, I've noticed that in many cases, if the shield is angled, rather than square to the projectile, it tends to do a better job of deflecting. I tried a cylindrical, around-the-body shield, but everything went right through it. A flat 2 meter by 2 meter plate, tilted at an angle, seemed to do the best job.

Of course, if people are using needle-thin, 7-meter-long, maximum velocity bullets, you might just want to learn to get out of the way... or just avoid combat areas and all those pesky shooty people.

^-^;

Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 1185 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...