Jump to content
  • 0

Scripting Query


DejahLove1
 Share

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

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

Question

I am just learning scripting, though I have a solid and comprehensive background in programming, especially C++.  But here is my problem.  I am using a cube to learn the basics of scripting, such as changing the color of the cube when I touch it, recognizing the avatar who touched the cube and greeting them by name, displaying the date, and so on.  But often when I change the script I can no longer "touch" the object (get that little hand icon) to trigger the script.  But when I create a new cube and copy the script (from the now no-longer-functioning cube) into the new cube's script, everything works fine.  Evidently I am doing something wrong when it comes to changing a script.  Am I not saving it properly or something?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

When you save your script, be sure that it compiles successfully.  If there is an error, the script won't run.

Also, the script may simply have stopped running.  Try the Build menu, and choose Scripts, either Reset Scripts in Selection, or Set Scripts to Running.

  • Like 2
Link to comment
Share on other sites

  • 0

Lindal's explanation is the likely one.  If your script is not running, it will not respond to any event triggers.  It may stop running for any number of reasons, but if you create a new object and paste the same script in as a "new script", it should restart unless you somehow damaged it.  Next time, just open the script and click the Reset button.

I think you'll find that the internal script editor is amazingly unhelpful when you're debugging a script, BTW.  In most cases, it will simply tell you that there is an error, and nothing more.  You will get much better debugging information with an external editor.  I generally use the LSL Editor, but you can make your choice from among a large selection at http://wiki.secondlife.com/wiki/LSL_Alternate_Editors

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3518 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...