Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

No More Floor Collisions!

Haplo Voss
Registered User
Join date: 18 Nov 2006
Posts: 137
02-27-2008 12:06
Hi all. I've done plenty of simple work with collision prims - like trips for opening doors, telling platforms to die, etc. Easy stuffs. However, now I'm venturing into something I've not dealt with before and that is:

A collision detection attached to an avatar.

Problem1: I've looked through forums and wiki, but no matter what I try, unless I use a delimiter of some kind - I am getting all kinds of detections - even the floor I'm walking on!!! lol

Problem2: Related - I don't want people to be restricted by "my system". I want anyone to be able to come and knock themselves to bits in the arena and have a ball without having to buy my weapons or go beyond wearing my free to them HUD.

Why do I need this?:

I have built a small - sort of niche sim and have a small combat arena. In a nutshell it is for people to just have fun and have a place to blast each other around and keep it on that parcel.

The reason I would like not to have to discern "bullet" or "bump" or, etc. is that who knows what people have named their projectile or mele weapon's impact object. I want everyone to be able to participate in the arena - but I need to have a "point system" or something very simple of the kind so people don't have to break out into arguments and go away feeling cheated (or I should say - reduce that ;) )

I've made a very simple display HUD for the avatar that comunicates w/ attached av HUD and it seems to work fine. I just wonder:

Is there a way to detect incoming objects, or possibly moving objects only as opossed to anything you brush against, touch, or walk upon? (without limiting people to my own system requirements )

I know I've read or heard about Velocity detection and some other things somewhere, but I can't seem to find anything particularly that is helping me so far and I have searched my butt off. I've even searched for this CoLA / CCS I found some info about - but can't find the source no matter where I look to take a gander at it for hints.

Thanks all
- Hap

(Sorry for such a long read.)
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-27-2008 20:14
During the collision event(s), you can use llDetectedVel() to get the velocity of the object colliding with the avatar. You might also use llGetObjectMass() along with llDetectedKey(). Mass and velocity could be used to determine the momentum and kinetic energy of the object impacting the avatar, which might be useful both to determine whether an object should be considered harmful (rule out collisions with floors and walls, unless you want to decide whether hard falls and such should also be damaging), and also help decide "how much" damage is done by a particular collision.

You could also possibly use llDetectedType() to rule out objects from the collision that are not likely to be weapons (AGENTs and PASSIVE objects could probably be ruled out).

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llDetectedVel
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetObjectMass
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llDetectedType
Haplo Voss
Registered User
Join date: 18 Nov 2006
Posts: 137
02-28-2008 11:14
Thank you tons... fantastic information. I just didn't know what commands to search for and find info on. I really appreciate it. Now I know where to go from here.

Take care,
- Hap