Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: "Fran Rocks" Random Rock Maker

Torley Linden
Enlightenment!
Join date: 15 Sep 2004
Posts: 16,530
12-18-2005 11:00
Got rocks?

Before I post this script, which was made by Francis Chung, only to have her mysteriously disassociate herself from it (I jest ;) ), I'd like to shed light on the background of how this came to me. I was musing in my blog about the challenges of making a Rock Tumbler in SL, and it came to mind that at least part of it was achievable.

I thot about landscaping in SL, and how many rocks are used, but how it can get tedious to cut and shape each rock yourself, not to mention how odd that can seem from a certain perspective.

So, after being trapped in a giant jar by Fran who came over, I shared my ideas with her, and she came up—live on the spot, like what Harlan Ellison would do in the window of a cafe if he were a scripter—with a Random Rock Maker, which I've lovingly dubbed "Fran Rocks".

Instructions are EASY PEASY!
  1. Rez a cube, give it a rock (or anything!) texture, put this script inside.
  2. Take the new rock back into the inventory and rez it, and ROCK ON!
  3. You'll see each rezzed rock has a different shape. Click on the rock again for another round of random!
  4. When you're done rocking and rolling, just type "/rock off" and the scripts in the rocks will all disappear.

Make any tweaks you'd like, and you're off and sprinting to a beautiful rock garden! :)


CODE

// Fran wuz here

randomize_rock() {
vector size;
float magnitude;

magnitude = llFrand(1.5) + 0.5;
size.x = (0.1 + llFrand(0.9)) * magnitude;
size.y = (0.1 + llFrand(0.9)) * magnitude;
size.z = (0.1 + llFrand(0.9)) * magnitude;

{ // Box type
float f;
integer holeshape;
vector cut;
float hollow;
vector twist;
vector topsize;
vector topshear;

f = llFrand(1);
if ( f < 0.33 )
holeshape = PRIM_HOLE_SQUARE;
else if ( f < 0.67 )
holeshape = PRIM_HOLE_CIRCLE;
else
holeshape = PRIM_HOLE_TRIANGLE;

cut.x = llFrand(1);
cut.y = cut.x + llFrand(1);
cut.z = llFrand(1);

hollow = llFrand(0.95);

twist.x = llFrand(1) - 0.5;
twist.y = llFrand(1) - 0.5;
twist.z = llFrand(1) - 0.5;

topsize.x = llFrand(1);
topsize.y = llFrand(1);
topsize.z = llFrand(1);

topshear.x = llFrand(1);
topshear.y = llFrand(1);
topshear.z = llFrand(1);

llSetPrimitiveParams( [PRIM_SIZE, size,
PRIM_TYPE, PRIM_TYPE_BOX, holeshape, cut, hollow, twist, topsize, topshear] );
}
}

default {
state_entry() {
randomize_rock();
llListen(0, "", llGetOwner(), "/rock off" );
llListen(1, "", llGetOwner(), "/rock off" );
}

touch_start(integer total_number) {
randomize_rock();
}

on_rez(integer code) {
llResetScript();
}

listen( integer channel, string name, key id, string msg ) {
llRemoveInventory( llGetScriptName() );
}
}
_____________________
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
12-19-2005 20:11
/15/71/78150/1.html
_____________________
i've got nothing. ;)
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
12-19-2005 20:23
o_o why didn't i think of that?
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Ghordon Farina
Script Poet
Join date: 1 Nov 2005
Posts: 126
12-19-2005 21:39
Neat!

I don't really have a use for it at the moment.... But it's still pretty cool.

^.^
Torley Linden
Enlightenment!
Join date: 15 Sep 2004
Posts: 16,530
12-20-2005 02:29
Thanxies for modding, Nada. It is appreciated. :)

Hehe Strife, I'll be all over your interface to easily edit settings.ini.

Ghordon, since the script is open, you can make it do other things too, not just rocks, but it surely leaves room for lotsa possibilities. But should a need for ROCKS one day strike, you know what to do!
_____________________
Ghordon Farina
Script Poet
Join date: 1 Nov 2005
Posts: 126
12-20-2005 14:46
I could make a rock candy machine! Switch the texture to a semi-transparent fun-colored sugary-goodness texture, and voila! Rock candy!

Problem is we can't eat it.

Yet.



*suspense!*
Kala Bijoux
Material Squirrel
Join date: 16 Nov 2004
Posts: 112
01-02-2006 00:12
I just tried this out. This is a really cool script :) I changed some of the parameters, because I was trying for a "pieces of a broken wall" look more than rocks, so I needed more block-like shapes.

Anyway, if anyone wants to see the results, you can take a look here. A big thank you to Francis for writing this and Torley for posting it :)

Pyrrhia (61, 9, 31)

The 'rocks' are strewn around the corners of the building.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-02-2006 09:05
From: Torley Torgeson
Hehe Strife, I'll be all over your interface to easily edit settings.ini.


all of my personal projects have been put on hold. I don't know when i'll be able to work on it let alone release it.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey