Don't click here unless you want to be banned.

LSL Wiki : LibraryReduxOneLineDoor

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl435.us.archive.org
If you're in a laggy sim (aren't we all?), you probably want doors that don't take 30 seconds to open. There are a ton of fancy doors, but no basic stripped down doors! Such a shame. This is the absolute most stripped down door possible. The whole operation is only one line of code! A call to llGetFreeMemory() returns 16078 on this one. A blank script with a memory call is 16172. That means that the entire door is less than 100 bytes of code!

This is rather a moot issue since the full 16k is allocated even if you don't use it, but less code does mean a faster script. -BW
Brevity is the soul of code. -Redux

It's not fancy, but if you want something simple, then this is for you.

For attached rotation: To link this door to another prim or set of prims: rotate to 0, 90, 0, change the size to <2, 2, .1> and path cut it from 0.375 to 0.875.
For rotating around a remote axis: If you path cut it a little more and make it hollow, you can create the illusion of rotating around a remote axis. It will take some creative texturing, but try using a hollow of 65 with a path cut 0.500 to 0.750

//a door in only 1 line of code!
//Ultra compact rotating door by Redux Dengaku.  Lagless, small, and quick.  Pass it around!

integer direction = 1;
default { 
  touch_start(integer total_number) {
     llSetRot(llGetRot() * <0, 0, (direction = -direction) * 0.70711, 0.70711>); //the line!
  } 
}

if you want one that opens in 2 steps instead of 1 step, you can use this:

//Ultra compact rotating door by Redux Dengaku.  Lagless, small, and quick.  Pass it around!
integer direction = 1;
default { 
  touch_start(integer total_number) {
     llSetRot(llGetRot() * <0, 0, (direction = -direction) * 0.38268, 0.92388>);
     llSetRot(llGetRot() * <0, 0, direction * 0.38268, 0.92388>);
  } 
}

That adds another 81 bytes, bringing the grand total to 175 bytes. This will still work when linked. Enjoy!
There is one comment on this page. [Display comments/form]