Jump to content

Switch Activate by Non Owner


Prokofy Neva
 Share

You are about to reply to a thread that has been inactive for 1941 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So there are a number of scripts that don't have any switch put on them -- particles in particle, but also one called "float" that makes that trademark floating avatar or pet or thing go up and down.

So I got a switch script on the MP which works great, you pop it into a prim with that non-stoppable script and you can now at least stop and start it on touch. But the creator didn't make an option for a third party to be able to click on the prim, and doesn't think it exists.

Let's say there's a hovering creature, you as a visitor, not the creator of the object, want to come in, and click and making that float script stop. Is there any way to do this, i.e. a switch a non-prim-owner can activate. BTW putting the prim on share doesn't work; perhaps deeding might but the script is proprietary and not on transfer so I can't test this.

Link to comment
Share on other sites

1 hour ago, Prokofy Neva said:

So there are a number of scripts that don't have any switch put on them -- particles in particle, but also one called "float" that makes that trademark floating avatar or pet or thing go up and down.

So I got a switch script on the MP which works great, you pop it into a prim with that non-stoppable script and you can now at least stop and start it on touch. But the creator didn't make an option for a third party to be able to click on the prim, and doesn't think it exists.

Let's say there's a hovering creature, you as a visitor, not the creator of the object, want to come in, and click and making that float script stop. Is there any way to do this, i.e. a switch a non-prim-owner can activate. BTW putting the prim on share doesn't work; perhaps deeding might but the script is proprietary and not on transfer so I can't test this.

http://wiki.secondlife.com/wiki/LlSetHoverHeight

http://wiki.secondlife.com/wiki/User:Kimm_Paulino/Scripts#Floating_Script

You can insert a touch event and set it to TRUE or FALSE on the second script example.

Edited by steph Arnott
Link to comment
Share on other sites

float meters = 1.09;  // Range of hover movement in meters.
float delay = 0;  //  Delay in seconds between movements.
integer steps = 9;  //  Higher steps mean smoother and slower movement but more server load.
integer i;  // Used to increment our steps.
string upDown = "down";  // Keeps track of up and down state

hoverPrim()
{
    while(0 == 0)
    {
        if(upDown = "down")  //  If object is down...
        {
            while(i++ < steps + 1)
            {
                llSetPos(llGetPos() + <0,0,meters/steps>);  // ...move it up.
                llSleep(delay);  // Allow delay between movements.
            }
            upDown = "up";  // Now it's up!
        }
        if(upDown = "up")  // If object is up...
        {
            while(i-- >= 0) 
            {
                llSetPos(llGetPos() - <0,0,meters/steps>);  // ...move it down.
                llSleep(delay);  // Allow delay between movements.
            }
            upDown = "down";  // Now it's down!
        }
    }
}

default
{
    state_entry()
    {
        hoverPrim();
    }
}

This script is by William Koba. It makes his superheroes and other figures hover.

But this is just one of many scripts that don't have an "on" or "off" switch. The point is to be able to take any script, and just add another script to the prim to switch it on and off, the way you have "animate on attach" and things like that. But maybe it's not possible.

Edited by Prokofy Neva
Link to comment
Share on other sites

40 minutes ago, Prokofy Neva said:

The point is to be able to take any script, and just add another script to the prim to switch it on and off, the way you have "animate on attach" and things like that.

Well, if this is what you want then there is a function called llSetScriptState. It can turn on/off other scripts in the object's inventory.
This would work as a toggle for another script (even if it uses an infinite loop like yours), for example:

string script_name = "this must exist";
integer status = TRUE;

default
{
    touch_start(integer n)
    {
        llSetScriptState(script_name, status = !status);
    }
}
Edited by Wulfie Reanimator
  • Like 1
Link to comment
Share on other sites

6 minutes ago, Wulfie Reanimator said:

Well, if this is what you want then there is a function called llSetScriptState. It can turn on/off other scripts in the object's inventory.
This would work as a toggle for another script (even if it uses an infinite loop like yours), for example:


string script_name = "this must exist";
integer status = TRUE;

default
{
    touch_start(integer n)
    {
        llSetScriptState(script_name, status = !status);
    }
}

Setting a script to non active without knowing what that script is doing is not clever at all. Simply adding a state change with the closing commands on touch and back again will suffice.

Link to comment
Share on other sites

3 hours ago, Prokofy Neva said:

So there are a number of scripts that don't have any switch put on them -- particles in particle, but also one called "float" that makes that trademark floating avatar or pet or thing go up and down.

So I got a switch script on the MP which works great, you pop it into a prim with that non-stoppable script and you can now at least stop and start it on touch. But the creator didn't make an option for a third party to be able to click on the prim, and doesn't think it exists.

Let's say there's a hovering creature, you as a visitor, not the creator of the object, want to come in, and click and making that float script stop. Is there any way to do this, i.e. a switch a non-prim-owner can activate. BTW putting the prim on share doesn't work; perhaps deeding might but the script is proprietary and not on transfer so I can't test this.

You could do something like :

float meters = 1.09;  // Range of hover movement in meters.
float delay = 0;  //  Delay in seconds between movements.
integer steps = 9;  //  Higher steps mean smoother and slower movement but more server load.
integer i;  // Used to increment our steps.
string upDown = "down";  // Keeps track of up and down state

integer switch=FALSE;

hoverPrim()
{
    if(upDown = "down")  //  If object is down...
    {
        while(i++ < steps + 1)
        {
            llSetPos(llGetPos() + <0,0,meters/steps>);  // ...move it up.
            llSleep(delay);  // Allow delay between movements.
        }
        upDown = "up";  // Now it's up!
    }
    if(upDown = "up")  // If object is up...
    {
        while(i-- >= 0) 
        {
            llSetPos(llGetPos() - <0,0,meters/steps>);  // ...move it down.
            llSleep(delay);  // Allow delay between movements.
        }
        upDown = "down";  // Now it's down!
    }
}

default
{
    touch_start(integer x){
        if(switch){
            llSetTimerEvent(0.0);
        }else{
            llSetTimerEvent(0.05);
        }
        switch=!switch;
    }
    timer(){
        hoverPrim();
    }
}

This would turn it on and off when touched. It would finish its vertical cycle and then stop moving.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1941 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...