How to script a moutain cliff with rocks rolling down
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-20-2009 20:28
Hi guys I would like your precious help. I am currently making a mountain cliff, and I have to make rocks rolling down the cliff. There is this link I from the building subforum - /8/5b/356220/1.html#post2649023I do have the codes to implement a click, and a ball will roll down, but currently I need to have a click, and many rocks will roll down. How can I do so? Best regards Christopher
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-20-2009 21:01
show us what you've got so far, and we can suggest the modification to change it from one to multiple. (there are several ways to do this)
_____________________
| | . "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... | - 
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-21-2009 22:54
test
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-21-2009 22:56
how can i post the codes here i coudn post the codes if not the link will have error somehow
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-21-2009 22:56
OKay
The codes below will be a sensor at the mountain cliff top, so once it click rocks will come out and roll down:
>>
float i = 0.0; vector pos; vector fwd; rotation rot; string obj = "Round Ball"; string Time;
ball1() { rot = llGetRot(); fwd = llRot2Fwd(rot); llRezObject(obj, pos + <0.9,0.0,1.0>, fwd, rot, 2); }
default { state_entry() { llSensorRemove(); pos = llGetPos(); llSetText("Sensor Board", <1, 0, 0>, 1); }
touch_start(integer total_number) { ball1(); llSetTimerEvent(0.2); }
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-21-2009 23:00
timer() { llSensor("Round Ball", "", ACTIVE, 10.0, PI); i+=0.2; if (i>3.2) { llResetScript(); } }
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-21-2009 23:06
sensor(integer num_dectected) { integer j; for (j = 0; j < num_dected; j++) { llSay(0, (String)(i-0.2) + "s Distance = " + (string)llvecDist(pos, llDectedPos(j)) + "m"  ; } }
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-22-2009 01:24
ball1() { rot = llGetRot(); fwd = llRot2Fwd( rot ); integer count = 10; do{ llRezObject( obj, pos + < 0.9, llFrand( 5.0 ), 1.0 >, fwd, rot, 2 ); }while (--count); }
_____________________
| | . "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... | - 
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-22-2009 17:57
Hey thanks! I will just copy and paste this on that part you have edited for me?
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-22-2009 18:19
yup, just replace the original ball1 section with that... and it should do what you expect.. you can slow it down by adding a sleep if you like
_____________________
| | . "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... | - 
|
shootjutsu Absent
Registered User
Join date: 28 Oct 2009
Posts: 15
|
12-22-2009 18:25
Hey thanks! it really works! however, the rocks come out in the straight line and drop down, so, what can i do to make them appear about the tip of the mountain so they can roll down from around the place place? 
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-22-2009 19:41
play around with that position in rez object... I don't know what way it's facing, I only took a guess, that the cliff faced east (so added a random y element). change the random part to the x range if that helps spread it out, or just increase the random number range
examples < 0.9, llFrand( 10.0 ), 1.0 >, or < llFrand( 10.0 ), 0.0, 1.0 >,
_____________________
| | . "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... | - 
|