Jump to content

Temp Objects Rezzed from Two Prims on Rezzer


Existential Conundrum
 Share

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

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

Recommended Posts

I created an object that I want to be triggered on touch to rezz temp objects from two prims on the rezzer. Imagine the rezzer is two earrings that have a central rezzer inside the head. On click on one of the earrings, a bunch of random items are rezzed out of earrings. Instead of it being bling turning on and off, it's a one time rez of objects that are temporary. Like a gun shooting out bullets, but less drama and more silly. It needs to be both at the same time or it doesn't have the right effect. 

I have this from a silly hud that rezzes one object (meme text) a distance from the hud, so it's missing the two prim part. It has the right idea though. I assume I'd have to tell it which prims and from what face or what direction and then how many...? Am I making sense? I'm looking for a short cascade of random objects placed in the rezzer.

vector vel=<0,2,5>;
vector rot=<PI_BY_TWO,0,-PI_BY_TWO>;

dolol()
    {
        vector pos = llGetPos();
        pos.z += 2.0;
        vel = llRot2Fwd(llGetRot()) * 2;
        vel.z = 5;
        llRezObject("Big LAWL", pos, vel, llEuler2Rot(rot) * llGetRot(), -1);
        llTriggerSound("lawl",1);
        llPlaySound("lawl",1);
    }

default
{
    state_entry()
    {
        llListen(0,"",llGetOwner(),"lawl");
    }
    touch_start(integer times)
    {
        dolol();
    }
    listen (integer channel, string name, key id, string message)
    {
       dolol();
    }
    
    on_rez(integer param)
    {
        llResetScript();
    }
}
 

Link to comment
Share on other sites

If this is an attachment (suggested by "two earrings that have a central rezzer inside the head") it's not going to be satisfactory no matter what you do and it'll be much more compelling to use a particle effect (which would also work on no-build land if that's ever a consideration). To see why a rezzer in an attachment can't be reliably accurate enough to appear to be emitted from an origin as small as an earring, see "Caveats" for llGetPos().

You wouldn't actually use llGetPos(), but rather llGetLinkPrimitiveParamsFast() for the two child-prim earrings, and this could be accurate enough to be compelling for a free-standing unattached object.

Link to comment
Share on other sites

12 minutes ago, H3thr Swashbuckler said:

can it switch from object to particle based on land rights? Or is that impossible?

Oh it definitely can, and I wrote a script for an attachment that did exactly that (based on PARCEL_FLAG_ALLOW_CREATE_OBJECTS among a host of other things), but the problem remains that the rezzed objects just can't look like they're emitting from anything so specific as a particular earring. In fact, it won't even reliably look like it's coming from one or another side of the avatar, depending on how animations move the avatar.

Link to comment
Share on other sites

Admittedly I haven't scripted a gun in years, and I'm not sure I've ever fired one except in mouselook (and without looking at the script I've always assumed the bullet came from avatar center, not the gun barrel), but if there were a gun to my head (so to speak), I'd script that gun to force an overriding animation on the attaching avatar to have some better hope of guessing where the gun might be, compared to letting the avatar animate at will, thus offsetting the gun arbitrarily from the avatar center.

I mean, you could also futz around with the attachment point, if that's something that could change from one wearing to the next, but you'd still need to know what any animation does to that attachment point geometry, which you'd just have to code into the script (perhaps scaled by avatar size) because the sim simply has no idea what's happening to the avatar skeleton, which is only known to the viewer when playing the animation. That's why a viewer-side effect such as particles can be specific to the viewer-side geometry of an attachment.

I dunno, maybe a weapons scripter has some other tricks that could make the effect better, but there's a big constraint on how precise it could possibly be.

Link to comment
Share on other sites

Guns dont rez bullets out of the barrel. They are rezzed from avatar center plus an offset to get the approx position of the gun and a few m in front of the avatar. (or you hit yourself) The direction will be where you look at in mouselook. You can not point at that position and client side animations absolutely don't match with server side positions.

Same for earrings. The server has no clue at what exact position you and anybody else see the earrings but the scripts are server sided. You get the idea. Only rough positioning is possible and you shouldn't move much by using animations.

Not sure why you think you need 2 rezzers. One script can rez 10 objects per second and that can be different ones of course. To get out more objects per second you need more rezzer scripts or rez coalesced objects.

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...