Jump to content

No Notecard Writing in LSL is Driving me Crazy


Shivan Zhang
 Share

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

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

Recommended Posts

I have a huge project with two different values that can go up or down based on listens. Since a script can only have one listen the only way to keep one value between the up and down listen scripts is writing to a darn notecard. Its been offered as a requested feature ages ago, but Linden Labs continues to be great big jerks! I'd love to poke the Lindens in the head over and over until they agree, but they apparantly are afraid of reading standard feedback. Wish it was easier to direct my comments to the correct place. Sorry you guys have to put up with my rant (but I'm even more sorry you put up with Linden Lab's constant screw ups).

Link to comment
Share on other sites


... the only way to keep one value between the up and down listen scripts is writing to a darn notecard. 

Although there are occasions where it would be very handy for a script to be able to update a notecard, this sure doesn't sound like one of them. Could you explain more about what you're trying to do here? There must be some reason why you arrived at notecard-writing as the only solution, so there may be much more to this problem that we're all missing.

Link to comment
Share on other sites


Darkie Minotaur wrote:

 

There are many ways to store data - why don't you just use an outworld database?

I'd be far happier if there was a hosted database solution from Linden Lab, but yes, depending upon what exactly you're doing an outside database should work just fine.

Link to comment
Share on other sites


Qwalyphi Korpov wrote:

I'm thinking the OP was saying a script can have only one 'listen' event.  Not that a script can have only one Listener.

 

Yeah, but I dont' understand why that's an issue.    The script hears something in the listen event and does something or not.    Why would it want two listen events and what have notecards got to do with it?   

Link to comment
Share on other sites


Innula Zenovka wrote:


Qwalyphi Korpov wrote:

I'm thinking the OP was saying a script can have only one 'listen' event.  Not that a script can have only one Listener.

 

Yeah, but I dont' understand why that's an issue.    The script hears something in the listen event and does something or not.    Why would it want two listen events and what have notecards got to do with it?   

For sure it's a puzzle.  I expect the OP had a momentary melt down and will return soon to apologize to the LL and the forum in general for the rant.  The pressure of a huge project and all.

Also - I meant to say I wasn't replying to you specifically but I forgot.  My bad.

Link to comment
Share on other sites


Innula Zenovka wrote

Yeah, but I dont' understand why that's an issue.    The script hears something in the listen event and does something or not.    Why would it want two listen events and what have notecards got to do with it?   


Yeah, it's not a listen problem.  It's a storage issue.  The OP needs to consider all of the options instead of relying on the one that he doesn't have.  There are a zillion places to stash a value other than putting it on a notecard.

 

Link to comment
Share on other sites

Oh, thanks to me enduring a terrible yet populated Starfleet sim, I'm trying to create a realistic system for a Starfleet ship. Mainly using typical spoken computer commands, a HUD with buttons, and some remote controls. Since Deuterium and Dilithium are the two main fuel sources, I decided to make a system where you can add things to fuel tanks as long as adding won't go over. Dilithium is drained by the engines and Deuterium is drained by just about everything else. I need to keep the Deuterium and Dilithium values the same across all scripts, and present can't seem to get the Prim Description work around working. There's not even a single relavant exmple on the related LSL Portal page. Since its not a very long add_dilithium script so far I'll post it:

integer listen_handle;
integer dilithium_amount;
integer dilithium_max = 500000;
string dilithium_text;

default
{
    state_entry()
    {
        dilithium_amount = (integer)llGetPrimitiveParams( [ PRIM_DESC ] )//Compiler dies here!;
        llOwnerSay((string)dilithium_amount);
        if (dilithium_amount == NAN)//If its not a number, set it to 500000
        {
            dilithium_amount = 500000;
        }
        listen_handle = llListen(999, "", "", "add_dilithium");
    }
    listen( integer channel, string name, key id, string message )
    {
        integer added_dilithium = dilithium_amount + 5000;
        if (added_dilithium < dilithium_max)
        {
            dilithium_amount = added_dilithium;
            string dilithium_added_say = "Dilithium added" + (string)dilithium_amount;
            //dilithium_text = (string)dilithium_amount;
            llSetPrimitiveParams( [ PRIM_DESC, dilithium_amount ] );
            llOwnerSay(dilithium_added_say);
        }
        else
        {
            string dilithium_say = "Dilithium added" + (string)dilithium_amount;
            llOwnerSay(dilithium_say);
        }
    }
}

Link to comment
Share on other sites

Try

integer listen_handle;integer dilithium_amount;integer dilithium_max = 500000;default{	state_entry()	{		string temp = llGetObjectDesc();		if ( (string) ( (integer) temp) == temp )  //Here's your check for NAN		{			dilithium_amount = (integer)temp;			llOwnerSay((string)dilithium_amount);		}		else   //If its not a number, set it to 500000		{			dilithium_amount = 500000;		}		listen_handle = llListen(999, "", "", "add_dilithium");	}		listen( integer channel, string name, key id, string message )	{		integer added_dilithium = dilithium_amount + 5000;		if (added_dilithium < dilithium_max)		{			dilithium_amount = added_dilithium;			string dilithium_added_say = "Dilithium added" + (string)dilithium_amount;			llSetObjectDesc( (string) dilithium_amount );			llOwnerSay(dilithium_added_say);		}		else		{			string dilithium_say = "Dilithium added" + (string)dilithium_amount;			llOwnerSay(dilithium_say);		}	}}

 

 ETA: This will put the updated value of dilithium_amount into the object's description field, but it strikes me as an odd thing to be doing, if all you want to do is pass the value of dilithium_amount to another script, espescially if it's another script in the same object.  There are two much simpler options:

1. Use llMessageLinked to send the value to the other script or, even easier,

2. Combine the two scripts into one, so that you don't have to pass the value at all.

 

 

 

Link to comment
Share on other sites

  • 4 months later...

Can you figure out how the Aria chairs located at http://maps.secondlife.com/secondlife/Abiss/237/142/23 store the adjusted positions? I don't see that it updates any object name or description. At the root prim it seems to have one notecard for each animation. If you reset all the scripts you still get the adjusted position but if another avi tries the same animation he/she gets the default adjustment. So the adjusted position seems to be stored somewhere per user and even persists between sessions. I would like to know how it's done.

Link to comment
Share on other sites

I've taken a look at the chairs at the LM.  They use the Perfect Sitter system, which has been around longer than I have, just, and is very good indeed.   The one drawback is that it requires one script for each animation.

Obviously I don't know what's inside the scripts but I know enough about this area of scripting to make an informed guess, and I would think that he's storing the adjusted positions for individual avatars, and their uuids,  in strided lists in those scripts.

ETA -- It's a long time since I checked, but I'm pretty sure that doing reset all scripts with Perfect Sitter wipes all settings and everyone starts with the default again.   Of course, if you've set the defaults in the notecards to suit your size and shope, then that doesn't matter.   

  • Like 1
Link to comment
Share on other sites

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