Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

need example llGetObjectDesc()

Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
06-07-2008 22:00
I can't find a simple example on how to use this. I would like it to get a word from the description and turn it into a string. For instance, right now in a script I have something like

string name = "house";

If I want the word "house" changed I have to open the script each time but I can't have that so I want the script to pickup a word from the description and change that string.

Thanks!
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
06-07-2008 22:12
string name = llGetObjectDesc();

I don't think changing the description fires any events, though. You'll either need to put this on a timer or reset the script to pick up a changed object description.
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
06-07-2008 22:17
Well that seems easy...

Thanks!


edit...

Just found this:
Aside from the above, the changed() event is also not triggered:
* when changing the object's name or description.

So it wont pick up the change...bummer.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
06-07-2008 23:02
The way to do it so that an event is triggered is to use a notecard. Create a notecard 'desc' or whatever, put the info in the notecard. A changed event will trigger when the NC is edited, and you can go from there. (If (change & CHANGED_INVENTORY)



http://www.secondscripter.com/
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
06-08-2008 01:38
I've always found it easier to just call the function directly whenever I need the value instead of bothering with a variable at all.