Tuesday, December 02, 2008
USERLOGIN PASSWORD Remember?
You are here » Learning Center ยป Forums

Openlife Forums

 Openlife Grid Forums
Minimize
 
  Openlife Forums  Scripting  LSL Discussion  problem with scripts using touch_start
Previous Previous
 
Next Next
New Post 4/23/2008 5:26 PM
User is offline Pablo Pharmanaut
56 posts
Openlife Apprentice




problem with scripts using touch_start 

I noticed recently that some of my old scripts using touch_start had stopped working.  I'll use llLoadURL as an example.

This is the script that I had been using without problems before:

 

default

{

    touch_start(integer total_number)

    {

        llLoadURL(llDetectedKey(0), "Google", "http://www.google.com");

    }

}

 I noticed that the script had quit working and now I found out why.  The script needs a state_entry event to preceed the touch_start event for it to work.  Previous OS versions did not require this, but apparently now it's required.  Here's the corrected script:

 

 

default

{

    state_entry()

    {

        llSleep(0.5); //do something here

    }

    touch_start(integer total_number)

    {

        llLoadURL(llDetectedKey(0), "Google", "http://www.google.com");

    }

}

 

That little issue has caused me some problems, so I thought I would mention it here.  This applies (at least) to any scripts using touch_start.  The LSL wiki has several script examples that don't have this, including llLoadURL, so beware.

 
Previous Previous
 
Next Next
  Openlife Forums  Scripting  LSL Discussion  problem with scripts using touch_start
Privacy Statement | Terms Of UseAll Rights Reserved 2007,2008 3DX - Openlifegrid.com