Floating text not going away

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Floating text not going away

Robert Klein
I have a script that puts the current time floating above an object. When I remove the script from the object contents the text still remains floating above the object showing the time from when the script was removed. The time does not continue to update but it will not go away. Anyone else have this problem and if so how did you get the text to go away without deleting the object and starting over?

Here is the script:

// HoverText Clock Script
// By Ben Linden
//
// Drop on an object to make it display the PST time.
//
// If you are interested in scripting, check out
// the Script Help under the help menu.

// The double slash means these lines are comments
// and ignored by the computer.




// Global Variables
// a string is a collection of characters.
string smin; // Represents minutes
string sseconds; //Represens seconds

// All scripts have a default state, this will be
// the first code executed.
default
{
    // state_entry() is an event handler, it executes
    // whenever a state is entered.
    state_entry()
    {
        // llSetTimerEvent() is a function that sets
        // up a timer event in seconds.
        llSetTimerEvent(2.0);  // call a timer event
                               // every 2 seconds.
    }
   
   
    // timer() is an event handler, it executes on an
    // interval defined by llSetTimerEvent()
    timer()
    {
       // llFloor is a function that rounds down all numbers.
       // llGetWallClock is a function that returns the time
       // of day in seconds, on a 24 hour clock.
       integer seconds =  llFloor(llGetWallclock());
       // Convert the total number of seconds into a integer (whole number)
       integer min = llFloor(seconds/60);
       // Figure out how many minutes that is
       seconds = seconds - (min*60);
       //Work out the remaining number of seconds
       integer hour = llFloor(min/60);
       // figure out how many hours it represents.
       min = min - (hour*60);
       // figure out the number of minutes remaining
       
       // if is a conditional statement, it will only execute if the conditions are met.
       if(hour > 12) {hour = hour - 12;} // if the hours are greater than 12, convert to 12 hour time
       string shour = (string)hour; //convert the number into a string
       if(min < 10) {smin = "0"+(string)min;} // if less than 10 minutes, put a 0 in the minute string
       else { smin = (string)min;}
       if(seconds < 10) { sseconds = "0"+(string)seconds;} // if less than 10 sec, put a 0 in the second string
       else {sseconds = (string)seconds;}
       
       
       string time = shour + ":" + smin; // build the seperate strings into a complete string, with colons
       
       // llSetText is a function that displays a string over the object.
       llSetText(time, ZERO_VECTOR, 1.0); //Display the string in solid black.
    }

}


Thanks,

Robert
Reply | Threaded
Open this post in threaded view
|

Re: Floating text not going away

Vanish Seriath
1. Make new script in object.
2. copy/paste this script: 
default { state_entry() { llSetText("",<1,1,1>,1); } }
3. remove new script again

This behaviour is normal for floating text; the floating text becomes part of the object, and needs to be set to "" (no text) to disappear.

2011/3/16 Robert Klein <[hidden email]>
I have a script that puts the current time floating above an object. When I
remove the script from the object contents the text still remains floating
above the object showing the time from when the script was removed. The time
does not continue to update but it will not go away. Anyone else have this
problem and if so how did you get the text to go away without deleting the
object and starting over?

Here is the script:

// HoverText Clock Script
// By Ben Linden
//
// Drop on an object to make it display the PST time.
//
// If you are interested in scripting, check out
// the Script Help under the help menu.

// The double slash means these lines are comments
// and ignored by the computer.




// Global Variables
// a string is a collection of characters.
string smin; // Represents minutes
string sseconds; //Represens seconds

// All scripts have a default state, this will be
// the first code executed.
default
{
   // state_entry() is an event handler, it executes
   // whenever a state is entered.
   state_entry()
   {
       // llSetTimerEvent() is a function that sets
       // up a timer event in seconds.
       llSetTimerEvent(2.0);  // call a timer event
                              // every 2 seconds.
   }


   // timer() is an event handler, it executes on an
   // interval defined by llSetTimerEvent()
   timer()
   {
      // llFloor is a function that rounds down all numbers.
      // llGetWallClock is a function that returns the time
      // of day in seconds, on a 24 hour clock.
      integer seconds =  llFloor(llGetWallclock());
      // Convert the total number of seconds into a integer (whole number)
      integer min = llFloor(seconds/60);
      // Figure out how many minutes that is
      seconds = seconds - (min*60);
      //Work out the remaining number of seconds
      integer hour = llFloor(min/60);
      // figure out how many hours it represents.
      min = min - (hour*60);
      // figure out the number of minutes remaining

      // if is a conditional statement, it will only execute if the
conditions are met.
      if(hour > 12) {hour = hour - 12;} // if the hours are greater than
12, convert to 12 hour time
      string shour = (string)hour; //convert the number into a string
      if(min < 10) {smin = "0"+(string)min;} // if less than 10 minutes,
put a 0 in the minute string
      else { smin = (string)min;}
      if(seconds < 10) { sseconds = "0"+(string)seconds;} // if less than
10 sec, put a 0 in the second string
      else {sseconds = (string)seconds;}


      string time = shour + ":" + smin; // build the seperate strings into
a complete string, with colons

      // llSetText is a function that displays a string over the object.
      llSetText(time, ZERO_VECTOR, 1.0); //Display the string in solid
black.
   }

}


Thanks,

Robert

--
View this message in context: http://opensim-users.2152040.n2.nabble.com/Floating-text-not-going-away-tp6177053p6177053.html
Sent from the opensim-users mailing list archive at Nabble.com.
_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users



--
The Twilight’s Green Illuminate Beam,
This Great ImBalance, that I’ve seen,
That Trees Got Icy Branches and,
The Good In Bad, That God I’ve Been.


_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Floating text not going away

Lindy (McKeown) Orwin
In reply to this post by Robert Klein

Prims always remember floating text even  after the script creating it are removed. So to remove you have to put nothing  in the floating text. Then it will replace your time with nothing and remember that when you remove the floating text  script. It allows you to label and unlabel items. Useful for objects that give their contents so you don't also get the floating text script given to you.
Lindy

On Mar 16, 2011 8:47 AM, "Robert Klein" <[hidden email]> wrote:
> I have a script that puts the current time floating above an object. When I
> remove the script from the object contents the text still remains floating
> above the object showing the time from when the script was removed. The time
> does not continue to update but it will not go away. Anyone else have this
> problem and if so how did you get the text to go away without deleting the
> object and starting over?
>
> Here is the script:
>
> // HoverText Clock Script
> // By Ben Linden
> //
> // Drop on an object to make it display the PST time.
> //
> // If you are interested in scripting, check out
> // the Script Help under the help menu.
>
> // The double slash means these lines are comments
> // and ignored by the computer.
>
>
>
>
> // Global Variables
> // a string is a collection of characters.
> string smin; // Represents minutes
> string sseconds; //Represens seconds
>
> // All scripts have a default state, this will be
> // the first code executed.
> default
> {
> // state_entry() is an event handler, it executes
> // whenever a state is entered.
> state_entry()
> {
> // llSetTimerEvent() is a function that sets
> // up a timer event in seconds.
> llSetTimerEvent(2.0); // call a timer event
> // every 2 seconds.
> }
>
>
> // timer() is an event handler, it executes on an
> // interval defined by llSetTimerEvent()
> timer()
> {
> // llFloor is a function that rounds down all numbers.
> // llGetWallClock is a function that returns the time
> // of day in seconds, on a 24 hour clock.
> integer seconds = llFloor(llGetWallclock());
> // Convert the total number of seconds into a integer (whole number)
> integer min = llFloor(seconds/60);
> // Figure out how many minutes that is
> seconds = seconds - (min*60);
> //Work out the remaining number of seconds
> integer hour = llFloor(min/60);
> // figure out how many hours it represents.
> min = min - (hour*60);
> // figure out the number of minutes remaining
>
> // if is a conditional statement, it will only execute if the
> conditions are met.
> if(hour > 12) {hour = hour - 12;} // if the hours are greater than
> 12, convert to 12 hour time
> string shour = (string)hour; //convert the number into a string
> if(min < 10) {smin = "0"+(string)min;} // if less than 10 minutes,
> put a 0 in the minute string
> else { smin = (string)min;}
> if(seconds < 10) { sseconds = "0"+(string)seconds;} // if less than
> 10 sec, put a 0 in the second string
> else {sseconds = (string)seconds;}
>
>
> string time = shour + ":" + smin; // build the seperate strings into
> a complete string, with colons
>
> // llSetText is a function that displays a string over the object.
> llSetText(time, ZERO_VECTOR, 1.0); //Display the string in solid
> black.
> }

>
> }
>
>
> Thanks,
>
> Robert
>
> --
> View this message in context: http://opensim-users.2152040.n2.nabble.com/Floating-text-not-going-away-tp6177053p6177053.html
> Sent from the opensim-users mailing list archive at Nabble.com.
> _______________________________________________
> Opensim-users mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/opensim-users

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Floating text not going away

InuYasha Meiji
On 3/16/2011 11:57 AM, Lindy McKeown wrote:

Prims always remember floating text even  after the script creating it are removed. So to remove you have to put nothing  in the floating text. Then it will replace your time with nothing and remember that when you remove the floating text  script. It allows you to label and unlabel items. Useful for objects that give their contents so you don't also get the floating text script given to you.
Lindy

On Mar 16, 2011 8:47 AM, "Robert Klein" <[hidden email]> wrote:
> I have a script that puts the current time floating above an object. When I
> remove the script from the object contents the text still remains floating
> above the object showing the time from when the script was removed. The time
> does not continue to update but it will not go away. Anyone else have this
> problem and if so how did you get the text to go away without deleting the
> object and starting over?
>
> Here is the script:
>
> // HoverText Clock Script
> // By Ben Linden
> //
> // Drop on an object to make it display the PST time.
> //
> // If you are interested in scripting, check out
> // the Script Help under the help menu.
>
> // The double slash means these lines are comments
> // and ignored by the computer.
>
>
>
>
> // Global Variables
> // a string is a collection of characters.
> string smin; // Represents minutes
> string sseconds; //Represens seconds
>
> // All scripts have a default state, this will be
> // the first code executed.
> default
> {
> // state_entry() is an event handler, it executes
> // whenever a state is entered.
> state_entry()
> {
> // llSetTimerEvent() is a function that sets
> // up a timer event in seconds.
> llSetTimerEvent(2.0); // call a timer event
> // every 2 seconds.
> }
>
>
> // timer() is an event handler, it executes on an
> // interval defined by llSetTimerEvent()
> timer()
> {
> // llFloor is a function that rounds down all numbers.
> // llGetWallClock is a function that returns the time
> // of day in seconds, on a 24 hour clock.
> integer seconds = llFloor(llGetWallclock());
> // Convert the total number of seconds into a integer (whole number)
> integer min = llFloor(seconds/60);
> // Figure out how many minutes that is
> seconds = seconds - (min*60);
> //Work out the remaining number of seconds
> integer hour = llFloor(min/60);
> // figure out how many hours it represents.
> min = min - (hour*60);
> // figure out the number of minutes remaining
>
> // if is a conditional statement, it will only execute if the
> conditions are met.
> if(hour > 12) {hour = hour - 12;} // if the hours are greater than
> 12, convert to 12 hour time
> string shour = (string)hour; //convert the number into a string
> if(min < 10) {smin = "0"+(string)min;} // if less than 10 minutes,
> put a 0 in the minute string
> else { smin = (string)min;}
> if(seconds < 10) { sseconds = "0"+(string)seconds;} // if less than
> 10 sec, put a 0 in the second string
> else {sseconds = (string)seconds;}
>
>
> string time = shour + ":" + smin; // build the seperate strings into
> a complete string, with colons
>
> // llSetText is a function that displays a string over the object.
> llSetText(time, ZERO_VECTOR, 1.0); //Display the string in solid
> black.
> }
>
> }
>
>
> Thanks,
>
> Robert
> ttps://lists.berlios.de/mailman/listinfo/opensim-users
Adding my two cents.,.  This is also true for objects that produce particle efects.

-InuYasha

-- 
________________________________________________________________
Opensim User: Standalone Grid on Version 0.7.0.2 with 49 Regions
On Windows 7, 64-bit. Quad Core With a Terrabyte Drive, and 8gig
Used XAMPP to load PHP Version 5.3.0, and MySQL 5.1.41-community
________________________________________________________________

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Floating text not going away

Jor3l Boa
And you can do the same HOUR:MINUTES thing with just:

---
default
{
state_entry()
{
llSetTimerEvent(30); // Why every 2 seconds if you show minutes :)
}
timer()
{
list timestamp = llParseString2List(llGetTimestamp(), ["-", ":"], ["T"]);
llSetText(llDumpList2String(llList2List(timestamp, 4, 5), ":"), <1,1,1>, 1);
}
}
----

2011/3/16 InuYasha Meiji <[hidden email]>
On 3/16/2011 11:57 AM, Lindy McKeown wrote:

Prims always remember floating text even  after the script creating it are removed. So to remove you have to put nothing  in the floating text. Then it will replace your time with nothing and remember that when you remove the floating text  script. It allows you to label and unlabel items. Useful for objects that give their contents so you don't also get the floating text script given to you.
Lindy

On Mar 16, 2011 8:47 AM, "Robert Klein" <[hidden email]> wrote:
> I have a script that puts the current time floating above an object. When I
> remove the script from the object contents the text still remains floating
> above the object showing the time from when the script was removed. The time
> does not continue to update but it will not go away. Anyone else have this
> problem and if so how did you get the text to go away without deleting the
> object and starting over?
>
> Here is the script:
>
> // HoverText Clock Script
> // By Ben Linden
> //
> // Drop on an object to make it display the PST time.
> //
> // If you are interested in scripting, check out
> // the Script Help under the help menu.
>
> // The double slash means these lines are comments
> // and ignored by the computer.
>
>
>
>
> // Global Variables
> // a string is a collection of characters.
> string smin; // Represents minutes
> string sseconds; //Represens seconds
>
> // All scripts have a default state, this will be
> // the first code executed.
> default
> {
> // state_entry() is an event handler, it executes
> // whenever a state is entered.
> state_entry()
> {
> // llSetTimerEvent() is a function that sets
> // up a timer event in seconds.
> llSetTimerEvent(2.0); // call a timer event
> // every 2 seconds.
> }
>
>
> // timer() is an event handler, it executes on an
> // interval defined by llSetTimerEvent()
> timer()
> {
> // llFloor is a function that rounds down all numbers.
> // llGetWallClock is a function that returns the time
> // of day in seconds, on a 24 hour clock.
> integer seconds = llFloor(llGetWallclock());
> // Convert the total number of seconds into a integer (whole number)
> integer min = llFloor(seconds/60);
> // Figure out how many minutes that is
> seconds = seconds - (min*60);
> //Work out the remaining number of seconds
> integer hour = llFloor(min/60);
> // figure out how many hours it represents.
> min = min - (hour*60);
> // figure out the number of minutes remaining
>
> // if is a conditional statement, it will only execute if the
> conditions are met.
> if(hour > 12) {hour = hour - 12;} // if the hours are greater than
> 12, convert to 12 hour time
> string shour = (string)hour; //convert the number into a string
> if(min < 10) {smin = "0"+(string)min;} // if less than 10 minutes,
> put a 0 in the minute string
> else { smin = (string)min;}
> if(seconds < 10) { sseconds = "0"+(string)seconds;} // if less than
> 10 sec, put a 0 in the second string
> else {sseconds = (string)seconds;}
>
>
> string time = shour + ":" + smin; // build the seperate strings into
> a complete string, with colons
>
> // llSetText is a function that displays a string over the object.
> llSetText(time, ZERO_VECTOR, 1.0); //Display the string in solid
> black.
> }
>
> }
>
>
> Thanks,
>
> Robert
Adding my two cents.,.  This is also true for objects that produce particle efects.

-InuYasha

-- 
________________________________________________________________
Opensim User: Standalone Grid on Version 0.7.0.2 with 49 Regions
On Windows 7, 64-bit. Quad Core With a Terrabyte Drive, and 8gig
Used XAMPP to load PHP Version 5.3.0, and MySQL 5.1.41-community
________________________________________________________________

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users



_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Floating text not going away

aiaustin
In reply to this post by Robert Klein
There are a number of persistent properties of objects which stay
even when the scripts which originally set up the values or
properties are removed.  You can explicitly remove the properties
with a script which sets things to some null or empty state
typically.  The properties include:

Text Label
Rotation
Particle Effect
Sound Emitted and Volume Level
Sit Position

Here is an LSL script I keep handy to pup in a prim I want to remove
properties from.  I just put this in the object and then remove it
again, just to make sure I start with things in a default or empty
state where I reuse complicated objects.

// Prim Turn Off Properties

default
{
     state_entry()
     {
         // Turn off any previously set sit target on prim
         llSitTarget(ZERO_VECTOR,ZERO_ROTATION);

         // Stop any rotation
         llTargetOmega(<0,0,0>,0,0);

         // Turn off any particle effects in prim
         llParticleSystem([]);

         // Turn off any sounds in prim - see
http://wiki.secondlife.com/wiki/LlStopSound
         llStopSound();

         llSetText("", <1,1,1>, 1.0);
         llSetSitText("");
     }

     touch_start (integer num_detected) {
         // Turn off any previously set sit target on prim
         llSitTarget(ZERO_VECTOR,ZERO_ROTATION);

         // Stop any rotation
         llTargetOmega(<0,0,0>,0,0);

         // Turn off any particle effects in prim
         llParticleSystem([]);

         // Turn off any sounds in prim - see
http://wiki.secondlife.com/wiki/LlStopSound
         llStopSound();

         llSetText("", <1,1,1>, 1.0);
         llSetSitText("");

         llSitTarget(ZERO_VECTOR,ZERO_ROTATION);

     }

}

_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users
Reply | Threaded
Open this post in threaded view
|

Re: Floating text not going away

GarminKawaguichi
// Prim Turn Off Properties

default
{
     state_entry()
     {
         // Turn off any previously set sit target on prim
         llSitTarget(ZERO_VECTOR,ZERO_ROTATION);

         // Stop any rotation
         llTargetOmega(<0,0,0>,0,0);

         // Turn off any particle effects in prim
         llParticleSystem([]);

         // Turn off any sounds in prim - see
http://wiki.secondlife.com/wiki/LlStopSound
         llStopSound();

         llSetText("", <1,1,1>, 1.0);
         llSetSitText("");
     }

     touch_start (integer num_detected){llResetScript();}

    on_rez(integer iPNumb){llRsetScript();}
}

:)))

GCI

----- Original Message -----
From: "Ai Austin" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, March 17, 2011 12:19 PM
Subject: Re: [Opensim-users] Floating text not going away


> There are a number of persistent properties of objects which stay
> even when the scripts which originally set up the values or
> properties are removed.  You can explicitly remove the properties
> with a script which sets things to some null or empty state
> typically.  The properties include:
>
> Text Label
> Rotation
> Particle Effect
> Sound Emitted and Volume Level
> Sit Position
>
> Here is an LSL script I keep handy to pup in a prim I want to remove
> properties from.  I just put this in the object and then remove it
> again, just to make sure I start with things in a default or empty
> state where I reuse complicated objects.
>
> // Prim Turn Off Properties
>
> default
> {
>     state_entry()
>     {
>         // Turn off any previously set sit target on prim
>         llSitTarget(ZERO_VECTOR,ZERO_ROTATION);
>
>         // Stop any rotation
>         llTargetOmega(<0,0,0>,0,0);
>
>         // Turn off any particle effects in prim
>         llParticleSystem([]);
>
>         // Turn off any sounds in prim - see
> http://wiki.secondlife.com/wiki/LlStopSound
>         llStopSound();
>
>         llSetText("", <1,1,1>, 1.0);
>         llSetSitText("");
>     }
>
>     touch_start (integer num_detected) {
>         // Turn off any previously set sit target on prim
>         llSitTarget(ZERO_VECTOR,ZERO_ROTATION);
>
>         // Stop any rotation
>         llTargetOmega(<0,0,0>,0,0);
>
>         // Turn off any particle effects in prim
>         llParticleSystem([]);
>
>         // Turn off any sounds in prim - see
> http://wiki.secondlife.com/wiki/LlStopSound
>         llStopSound();
>
>         llSetText("", <1,1,1>, 1.0);
>         llSetSitText("");
>
>         llSitTarget(ZERO_VECTOR,ZERO_ROTATION);
>
>     }
>
> }
>
> _______________________________________________
> Opensim-users mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/opensim-users
_______________________________________________
Opensim-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/opensim-users