|
Mephistopheles Wingtips
Registered User
Join date: 17 Oct 2007
Posts: 10
|
02-02-2008 01:59
Hello everyone. Could someone please tell me the correct code ill need to rez an object on connection with another avatar, at the moment ive created the blood splatter object and poped a copy of it into the item i want it to rez from. At the moment im going down the path of using a sensor at 2.5m as that is where the combat system im working in recognizes the hit. The format at the mo is esentially. Detect avatar, hit, trigger sound, rez object(damage), Timer event(.5 secs). Im thinking that i could just slip in the blood splatter object with the damager to rez for .5 secs on hit. but it doesnt work. Any ideas? if you could give me the code ill need or direct me to somewhere i could purchase a full perms copy of a blood splatter object already id appreciate it 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-02-2008 03:21
your rez object wouldn't be very effective since av's move and have irregular surfaces... assuming you combat system recognizes the hit on the avatar wearing, it could rez the splatter itse;f (or rather make it visible), negating the need to calulate where it needs to be, or follow an av, etc
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Lance Sismondi
Registered User
Join date: 28 Apr 2006
Posts: 21
|
02-05-2008 14:09
would an transparent object that attaches to the AV (the target zone), registers a collision, then rezzes a blood spatter at the point of collision on the attachment work?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-05-2008 18:50
I can't remember 100% but I believe attachments won't register collisions, so your bullet would have to register the collision and send a message to the attachment if that's the case. also getting the exact position of the collision may be difficult.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Rob Adelaide
Cream Cheese Fanatic
Join date: 19 Oct 2006
Posts: 34
|
02-05-2008 20:37
If I am reading my code and the effects it generates correctly, attachments will register a collision in the same way a child prim would - if something collides with the actual agent, but not the prim of the attachment. This is how many combat systems I have seen code for apparently work.
You could use a collision_start(int num) event to register the hit, but you'd want some way to filter if someone runs into a wall or if it's a projectile or blade rezzing the object. Some I have seen do this by filtering the name of the colliding object, and some use velocity of the incoming object to determine if it's a static object or is hostile, but this can be less than effective (flying into a wall at 700m can be as fast as an incoming arrow or something).
-R
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
02-05-2008 22:35
That's correct. Attachments get collision events when the avatar collides with something. llDetectedLinkNumber() doesn't mean anything in this case, I believe.
This is how most of those old attached shields worked that tried to reflect a projectile back at the shooter or whatever. They never actually prevented a collision, since attachments are essentially phantom; all they did was look pretty and do something with the event (e.g. llPushObject()) AFTER the fact of the object-avatar collision. A few of them might have tried to use sensors instead, but if you looked at 99% of the freebies out there, you'd just see a collision event handler.
|