Jump to content

Sartek Rosca

Resident
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Sartek Rosca

  1. Hi, Here is the door script. Like I said, it works just fine as long as the door is not linked into the cabin structure. float delay = 3.0; // time to wait before // automatically closing door vector delta = <0.0, -0.8, 0.0>; // amount to move door // when we open it// Variables you will most likely leave the samevector closed_position; // original position of the // door when closed// Processing for the script when it first starts updefault { // What we do when we first enter this state state_entry() { closed_position = llGetPos(); // Save position when door is closed state closed; // Move to the closed state }}// Processing for the script when it is in the closed statestate closed { // What we do when we first enter this state state_entry() { llSetPos(closed_position); // Move door to closed position } // What we do when the door is clicked ("touched") with the mouse touch_start(integer total_number) { state open; // Move to the open state } // What to do when the timer goes off timer() { llSetTimerEvent(0.0); // Set the timer to 0.0 to turn it off }}// Processing for the script when it is in the open statestate open { // What we do when we first enter this state state_entry() { llSetPos(closed_position + delta); // Move door to open position llSetTimerEvent(delay); // Set the timer to automatically close it } // What we do when the door is clicked ("touched") with the mouse touch_start(integer total_number) { state closed; // Move to the closed state } // What to do when the timer goes off timer() { llSetTimerEvent(0.0); // Set the timer to 0.0 to turn it off state closed; // Move to the closed state }} Also, replacing llGetPos with llGetLocalPos doesn't solve it.
  2. Warning: I'm quite new to LSL scripting. I created a simple sliding door script, that does exactly what I want and uses the llGetLocalPos and llSetPos functions to change it's position. This door is part of a little cabin i'm creating. The door operates on a simple touch, nothing fancy. However, when I link the door with the cabin, the script doesn't work and my door doesn't move. The door is NOT the root prim of the cabin. I notice that when I hover my mouse cursor of the door, it changes to the "hand" icon, which is typical for objects that can be touched. So the script is somehow active. As soon as I unlink the cabin, I can click the door and it slides again. Also, the door is a single prim, so don't point me to scripts for "multiprim doors", as this is something different from my issue. I hope someone here can shed some light on how to do this. I tried Google, but I get a lot of references to the lsl wiki about the different ll-functions, but not a single introduction on how it all fits together. Thanks for any assistance.
×
×
  • Create New...