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

Want to add a script or a project? Upload it and a half million poeple will see it.

w.outworl
Home   Show All
Category: Contributor: Creator
Animation Easy Ladder  

Easy Ladder

Easy ladder script

Category: Animation
By : Ferd Frederix
Created: 2015-07-15 Edited: 2016-05-02
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. climb-rope.bvh
Get file # 2. EZ Ladder.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
2 // Rev 2: 12-18-2015 added region pos for return
3
4 /* Climb ladder
5 http://community.secondlife.com/t5/Scripting/Ladder-Climb/td-p/256433
6 Edited for opensimulator to unsit user at top via offset vector
7
8 BVH: climb-rope
9
10 Ferd Frederixz - removed cruft, added offsets and removed ugly hacks.
11
12 */
13
14
15 float LADDERHEIGHT= 7.0; // how far to move up
16 float STEPHEIGHT = 0.25; // how far to move each step
17 float OFFSET = 3; // tilt of the ladder;
18 float Extra = 1; // extra move onto the roof or in the door before unsit
19
20 climbup()
21 {
22
24 llStopAnimation("sit");
26
27
28 integer i;
29 vector original;
30 float steps = LADDERHEIGHT / STEPHEIGHT;
31 float offset = OFFSET / steps; // to one side
32
33 original = llGetPos();
34 do
35 {
36 i++;
37 vector newPos = llGetPos() + <offset,0, STEPHEIGHT> * llGetRot();
38 llSetPos(newPos);
39 } while(i <= (steps));
40
41 llSetPos(llGetPos() + <Extra, 0, 0> * llGetRot()); // extra, then unsit
42
44
46 { // somebody is sitting on me
47 llUnSit(llAvatarOnSitTarget()); // unsit him or her
48 }
49
50 llSetRegionPos(original);
52 } // end climbup
53
54 default
55 {
56
57 state_entry() {
58 llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
59 }
60
61 changed(integer change)
62 {
63 if(change == CHANGED_LINK)
64 {
65 key avatar = llAvatarOnSitTarget();
66
67 if(avatar != NULL_KEY)
68 {
70 climbup();
71 }
72 }
73 } //end changed
74 } //end default

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