Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Okay, how can something like this be scripted.

Hotspur Otoole
Registered User
Join date: 4 Jan 2007
Posts: 95
01-31-2007 12:35
Okay I'm curious. can an object be scripted so that it falls when dropped?

Can an object be scripted so that it disappears after being "deployed", after a certain time period? To return to the owner's inventory?

Can an object be scripted to do the above two things and set of an animation of some type?

I was thinking of making a water balloon, but don't know a few basic facts.
Johan Durant
Registered User
Join date: 7 Aug 2006
Posts: 1,657
01-31-2007 12:53
Use a timer and llDestroy (I think that's the name of the command) to delete an object after a certain time. Dunno if you can send an object back to inventory, doubt it. The 'changed' event can detect when an object is detached/dropped, but I'm not sure it'll work the way you want because SL drops the object to the ground.
_____________________
(Aelin 184,194,22)

The Motion Merchant - an animation store specializing in two-person interactions
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
01-31-2007 13:12
Yes.

No script is needed to make something fall when dropped, just check "physical" in object properties.

The other things can be done with scripts. However, animations only apply to avatars, if I'm not mistaken. So you can't apply an animation to the balloon to show it bursting.

Instead, you'd want to use a particle system for the balloon bursting. It's what's used to make things like waterfalls, bling in jewelry, 'poofs' that burst images out, or seeds drifting from a dandelion. Particle systems aren't quite as realistic as physical prims since there's no collision with inworld objects. But they have the serious advantage that they don't slow the server down; particle systems are implemented almost entirely on the client.

A prim can have at most one particle system.

For an incredible intro to particle systems, see the "Particle Laboratory" ingame. Big thanks to Jopsy for creating and maintaining it, as well as hanging out there and helping folks out! Highly recommended.

There are a couple tricks for you to sort out. For example, you can make the balloon disappear when it strikes anything (using the collision event handler, and calling llDie()). However, the particle system will die with the object, so you'll need to do something like making the object nonphysical (so it stops and doesn't fall) and making it invisible (setting the texture alphas to 100, IIRC). There may be more clever ways, too.

Cheers and good luck. BTW, you'll get more help for this in the "scripting tips" forum.
Hotspur Otoole
Registered User
Join date: 4 Jan 2007
Posts: 95
Dropped Objects
01-31-2007 13:45
Second question:

Can a Physical Object only be dropped from a certain height? How far up can you drop it?

H.
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
01-31-2007 15:53
One thing you may want to look at as an inspiration, though I don't think the code for it is open and modifyable, is the "Snowball Thrower" that LL gives away in Winter.

It's essentially a round prim that you wear on your hand, containing, I think, a basic 'gun' script. You wear it and go into mouselook, and what you click on, it throws a physical snowball at.

The snowball in this case is the 'bullet' for the gun script, and as I recall, it does a particle 'splat' when it hits.

In your case, the water balloon would be worn on the hand. So "throwing" the balloon fires a balloon projectile at the target. The projectile would have to be scripted to vanish with a wet-looking particle poof when it hits anything.

llDie is the LSL command to make an object de-rez itself. It just self-deletes. and won't return to inventory. With the above method, you wouldn't need to have it return, and the 'water balloon gun' would remain in your hand.

You could also add scripting to the 'gun' so it becomes invisible and can't be fired for a 'reload cycle' after you fire it.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
Angelique LaFollette
Registered User
Join date: 17 Jun 2004
Posts: 1,595
01-31-2007 20:43
I did a Fun experiment once with my Melon Launcher. The melons are Physics enabled so they Bounce, and Roll. I was in my skybox in One Sim, about three or four hundred meters up, and roughly in the Middle of My Sim, With permission (And participation) of the owner of the neighboring Sim i did a series of Balistic shots into his sim. I found i could Land them Well over half way across His sim (With a Fair amount of accuracy using the Mini Map) The Melons dropped 300 meters, and Shot laterally almost as far so I'm sure you can drop Physics enabled items from a Fairly Impressive hight and have them Land roughly where you want. 300+ meters up at least. The melons are Temp-on-Res meaning they vanish after a Minute. I had someone script some Projectiles for me so they would stick where they struck like a Wad of Gum, With Physics, also enabled i am able to do Balisic shots with these sticky Prims, and Not have them Bounce away from thier Target (This was as a Promising Basis for Real Archery, where Skill mattered more than anything else for accuracy). I don't think it's Impossible to script a Water Baloon to Burst on Contact, there ARE exploding projectiles that work on Contact.

Yes, what you propose sounds Very possible. You just need the right scripter.

Angel.
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
01-31-2007 21:33
Water balloons sound like something to make with flexi-spheres, if only we had flexi-spheres.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Angelique LaFollette
Registered User
Join date: 17 Jun 2004
Posts: 1,595
01-31-2007 21:40
From: SuezanneC Baskerville
Water balloons sound like something to make with flexi-spheres, if only we had flexi-spheres.

If there aren't Flex Spheres, How do they make those Flex Boobies i've seen for Sale? :confused:

NM, Not really relevant.

Angel.
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
02-01-2007 05:05
I heard somewhere about a limit to how high physical objects can be taken. IIRC, it's very high, so not an issue even for most skyboxes.

Angelique -- not relevant, but definitely intriguing! ;)
Ayu Sura
Registered User
Join date: 1 Oct 2006
Posts: 67
02-01-2007 08:29
Flexi cones ftw :)
Hotspur Otoole
Registered User
Join date: 4 Jan 2007
Posts: 95
Water Balloon bombs.. just around the corner!
02-01-2007 08:44
From: Angelique LaFollette
I did a Fun experiment once with my Melon Launcher. The melons are Physics enabled so they Bounce, and Roll. I was in my skybox in One Sim, about three or four hundred meters up, and roughly in the Middle of My Sim, With permission (And participation) of the owner of the neighboring Sim i did a series of Balistic shots into his sim. I found i could Land them Well over half way across His sim (With a Fair amount of accuracy using the Mini Map) The Melons dropped 300 meters, and Shot laterally almost as far so I'm sure you can drop Physics enabled items from a Fairly Impressive hight and have them Land roughly where you want. 300+ meters up at least.

Yes, what you propose sounds Very possible. You just need the right scripter.


Fantastic answer, Angelique. That's exactly what I was hoping to hear.

Where is all this going? Well, in younger days (back in school) I used to live in a fairly crime riddled housing section of an Eastern U.S. city. The brownstones either connected to each other or had a short jump to the roof of the next apt. building *usually*. As a sort of urban Robin hood thing my roomates used to drop water balloons on junkies congregating in the alleys to do drug deals. Cruel, perhaps, but it always had us doubled over with laughter when we managed to hop back to our own apt. I recalled this the other day and thought "You know, Second Life needs a good water balloon that you can drop from a high distance"... which got me to thinking. Thanks for some of the suggestions, everyone.
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
02-01-2007 10:04
You might want to start out scripting simpler things, if you haven't already. I just finished script for tossing a wedding bouquet or garter, lotsa fun. It's not what I call advanced work, but it's not beginner stuff either.

You can learn some of the important stuff starting with the gun script available at the LSL Wiki (not the official one, but the mirror of the original one, at http://www.lslwiki.org.