Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: Land mine set

Katerina Morgwain
Registered User
Join date: 30 Apr 2008
Posts: 12
11-11-2008 13:24
This set of scripts permits to build a simple land mine that explodes whenever someone steps on it. For "explodes" I mean that it turns itself invisible/phantom while rezzing a burst of 10 temporary-prim bullets.

No: no orbit, no push, no griefing sorry! :)

1) create a cube

2) create a sphere, resize it to 0.25x0.25x0.25, name it "bullet"

3) put the "Landmine's anti prim-littering bullet" script into the sphere, as soon as you've done it pick it up before it selfdeletes

4) open your cube's inventory and drop inside the bullet

5) put the "Landmine" script into the cube

6) close your cube's inventory

7) step over your Landmine

Note: after the explosion, it will take 10 minutes to reset itself (of course you can modify this time in the Landmine script).


-----------
Landmine
-----------
vector pos; // Used to store the current position.

// Follows the function used to rez in random position a burst of
// ten bullets.
// Be sure that they are temporary prims!

burst()
{
llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);
// The bullet contained into your object's inventory is rezzed at
// the acquired position with random initial velocity and zero
// rotation.

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);

llRezObject("bullet", pos, <llFrand(9) + llFrand(-9),
llFrand(9) + llFrand(-9),
llFrand(9)>,
ZERO_ROTATION, 0);
}

default
{
on_rez(integer start_param)
{
llResetScript();
}
// Script is resetted to its default values on object's rezzing
// (state_entry section).

state_entry()
{
llSetAlpha(1, ALL_SIDES);
// This makes your object visible.

llSetStatus(STATUS_PHANTOM, FALSE);
// This makes your object solid.

pos = llGetPos();
// Used to acquire the actual position.

pos = pos + <0.0, 0.0, 0.5>;
// Used to add a little offset to the bullets rezzing point.
}

collision_start(integer num_detected)
{
llSetAlpha(0, ALL_SIDES);
// This makes your object invisible.

llSetStatus(STATUS_PHANTOM, TRUE);
// This makes your object "phantom" (non solid).

llSay(0, llDetectedName(0) + " you just stepped on a landmine!";);
// Whenever someone walks on your object, will receive this
// message.

burst();
// Bullets are rezzed.

llSleep(600);
// This makes the script sleep for 600 seconds (10 minutes)
// before your object's initial status is restored.

llResetScript();
// Script is resetted and your object's initial status
// is restored (state_entry section).
}
}


--------------
Landmine's anti prim-littering bullet
--------------
default
{
on_rez(integer a)
{
llResetScript();
}
// Script is resetted to its default values on object's rezzing
// (state_entry section).

state_entry()
{
llSetTimerEvent(7);
// Timer event set on 7 seconds.

llSetStatus(STATUS_PHYSICS, TRUE);
// Object's physics status set to TRUE
// http://lslwiki.net/lslwiki/wakka.php?wakka=STATUS_PHYSICS

llSetStatus(STATUS_DIE_AT_EDGE, FALSE);
// Object can do sim crossing.
// Set to TRUE to make it selfdelete on sim crossing.

llSetPrimitiveParams(
[PRIM_TEMP_ON_REZ, TRUE,
PRIM_MATERIAL, PRIM_MATERIAL_METAL]
);
// Object is set to be a temporary prim (if not yet): it will
// selfdelete after 60/70 seconds in sims where scripts are
// disabled. Object's material is set to METAL.
// http://wiki.secondlife.com/wiki/PRIM_MATERIAL

llSetBuoyancy(0.5);
// Gravity's effect on the object.
// 0.5 means less or more "slow fall".
// http://wiki.secondlife.com/wiki/LlSetBuoyancy

llSetDamage(5);
// In damage active sims, the object will do 5% of damage
// when colliding with avatars.
// http://wiki.secondlife.com/wiki/LlSetDamage
}

collision_start(integer a)
{
llDie();
}
// Object selfdeletes on avatar or object collision.

touch_start(integer a)
{
llDie();
}
// Object selfdeletes on touch.

land_collision_start(vector a)
{
llDie();
}
// Object selfdeletes on land collision.

timer()
{
llDie();
}
// Object selfdeletes on timer event.
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Library bump
11-12-2008 06:15
:)
_____________________
i've got nothing. ;)
melissa Tracer
Registered User
Join date: 2 Dec 2006
Posts: 14
11-13-2008 12:33
Just cool ;)

Grts Melissa
Katerina Morgwain
Registered User
Join date: 30 Apr 2008
Posts: 12
11-14-2008 04:31
From: melissa Tracer
Just cool ;)

Grts Melissa


Thank you! :)
_____________________
Goffy Collas
Amnesia CEO
Join date: 21 Mar 2007
Posts: 8
06-25-2009 02:44
Nice one!