[Opensim-users] open sim on_touch method and OSForceDetach/Attach

Luisillo Contepomi luisillocontepomi at gmail.com
Sat Jul 12 08:17:31 UTC 2014


Look at the end of your script.
move Count= Count+1;  a line up, before of your "if" and work fine.



but I would simpler, and the prim remember the last texture when is
reezed or attached,  more or less some as this.

string textura1 = "ladrillos";
string textura2 ="madera vieja";
integer switch=TRUE;

default
{


    touch_start(integer total_number)
    {
        llOwnerSay("Touched.");
        if(switch)
        {
            llSetTexture(textura1, ALL_SIDES);
            switch=FALSE;
        }
        else
        {
            llSetTexture(textura2, ALL_SIDES);
            switch=TRUE;
        }

    }
}

Regards,

2014-07-11 18:35 GMT+02:00 Culbertson, Johanna <Johanna_Culbertson at sra.com>:
> Hi!
>
>
>
> I have a stand-alone grid that I have inherited. This is my first experience
> with OpenSim and LSL coding. My google Searches and API searches have been
> fruitless on these two issues. Please let me know what information may
> better help debug these issues!
>
>
>
> 1>     This first one is so frustrating because the answer should just be so
> simple, but I do not see it! I have a simple prim that is displaying a
> texture. On touch, I wish for it to switch to another texture.  This mostly
> works, except on first touch. When it does not work on first touch, I can
> hit the escape key and try again...then it always works.  I need to figure out
> how to make this work first time, every time.  Here is the script
> controlling it:
>
> integer Count=1;
>
> default
>
> {
>
> state_entry()
>
>     {
>
>         llOwnerSay("state entry first board");
>
>       string texture = llGetInventoryName(INVENTORY_TEXTURE, 0);
>
>       llSetTexture(texture, ALL_SIDES);
>
>     }
>
>     touch_start(integer id)
>
>     {
>
>         llOwnerSay("board touched");
>
>          string texture = llGetInventoryName(INVENTORY_TEXTURE, Count);
>
>         llSetTexture(texture, ALL_SIDES);
>
>         if(Count > 2) llResetScript();
>
>
>
>         Count= Count+1;
>
>     }
>
> }
>
>
>
> 2>     I have another, more complicated matter as well. This one has to do
> with a prim, whose inventory includes a script and another object.  The
> script attaches the object to the HUD of the user. Inside this object, there
> is a script that will then detach itself from the HUD after its purpose has
> been met. All of this seems to work just fine. However, when I teleport the
> user, the object shows back up, attached to the HUD. I've spent days
> researching this one and I can't find any resources on solving this issue. I
> can send code for this if necessary.
>
>
>
> I'm sure I am just making some simplistic newbie mistakes, and I apologize
> for wasting your time, but I am at my wits end in trying to figure this out
> on my own! Thanks for any help you can pass my way.
>
>
>
> Johanna
>
>
>
>
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at opensimulator.org
> http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users
>


More information about the Opensim-users mailing list