Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading
Home   Show All
Category: Contributor: Creator
Animation Easy Ladder  

Easy Ladder

Easy ladder script

Category: Animation
By : Ferd Frederix
Created: 2015-07-15 Edited: 2015-07-15
Worlds: Second Life

the Zip file

Download all files for Easy Ladder
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Script.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 /* Climb ladder
2 http://community.secondlife.com/t5/Scripting/Ladder-Climb/td-p/256433
3 Edited for opensimulator w/ugly hack to unsit user at top via offset vector
4 fixme: would be nicer to have a llRotLookAt for dismounting ladder
5 BVH: 13_33 climb ladder
6
7 Ferd Frederixz - removed cruft, added offsets and removed ugly hacks.
8
9 */
10
11
12 float LADDERHEIGHT= 7.0; // how far to move up
13 float STEPHEIGHT = 0.25; // how far to move each step
14 float OFFSET = 3; // tilt of the ladder;
15 float Extra = 1; // extra move onto the roof or in the door before unsit
16
17 climbup()
18 {
19
21 llStopAnimation("sit");
23
24
25 integer i;
26 vector original;
27 float steps = LADDERHEIGHT / STEPHEIGHT;
28 float offset = OFFSET / steps; // to one side
29
30 original = llGetPos();
31 do
32 {
33 i++;
34 vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot();
35 llSetPos(newPos);
36 } while(i <= (steps));
37
38 llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit
39
41
43 { // somebody is sitting on me
44 llUnSit(llAvatarOnSitTarget()); // unsit him or her
45 }
46
47 llSetPos(original);
49 } // end climbup
50
51 default
52 {
53
54 state_entry() {
55 llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
56 }
57
58 changed(integer change)
59 {
60
61
62 if(change == CHANGED_LINK)
63 {
64 key avatar = llAvatarOnSitTarget();
65
66 if(avatar != NULL_KEY)
67 {
69 //hide poseball
70
71 climbup();
72 }
73 }
74 } //end changed
75 } //end default

Back to the Best Free Tools in Second Life and OpenSim.