Jump to content

Auto Reset Feature


Ziyal Ochs
 Share

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

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

Recommended Posts

Hi everyone.

I have this wonderful script which shows the name and description of an object in a hovertext. The only thing that really annoys me, is that I have to manually reset the script every time I make a change.... can someone please tell me how I can make it auto reset... or at least show me a menu with a reset option:

 

default
{
state_entry()
{
llSetText((string)llGetObjectName() + "\n" + (string)llGetObjectDesc(), <1,1,1>,1);
}
}

Link to comment
Share on other sites

You may use a touch_start event and reload the float text when the owner touching the object.

 

Code will look like this:

// Code snippet - Reload object name and description as float texttouch_start(integer num){    if(llDetectedKey(0)==llGetOwner())    {        llSetText((string)llGetObjectName() + "\n" + (string)llGetObjectDesc(), <1,1,1>,1);    }}

 

  • Like 1
Link to comment
Share on other sites

True, but it's a waste of resources just leaving the script in the object once the hovertext is set.

So that raises the question of what the OP is actually doing such that a hovertext label is useful. Maybe we can get by with dropping a script in the object each time it's to be named, just chat the name and description (or use llGetText to collect them), then have the script change the name, description, and hovertext accordingly, then remove itself. It's quicker and easier to drop a script on an object and answer a couple llGetText dialogs than it is to right-click and edit the object and change those name and description fields in the build tool.

But we don't really know what the OP is doing. For example, maybe these objects get their names and descriptions through some other script, or something else that would make this even easier.

Link to comment
Share on other sites

is this correct or don't I need the state entry?

 

default
{
state_entry()
{
llSetText((string)llGetObjectName() + "\n" + (string)llGetObjectDesc(), <1,1,1>,1);
}
touch_start(integer num)
{
if(llDetectedKey(0)==llGetOwner())
{
llSetText((string)llGetObjectName() + "\n" + (string)llGetObjectDesc(), <1,1,1>,1);
}
}
}

Link to comment
Share on other sites

You really don't need the state entry
The only time it is executed is when the script is saved/compiled or reset
Even then you will only see the difference when the script is in a new prim because the floating text is a prim property that remains until you actively change it

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

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