Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

configuration notecards

Earnest Clymer
Registered User
Join date: 20 Feb 2005
Posts: 17
03-30-2005 22:23
I'm working on a script that gets the user configurable values from a notecard. The idea being that it wouldn't be necessary for a user to even look at or edit the script itself to change the behavior.
This is working just fine, but unless Im missing something, no event is fired if the notecard is edited (its in a prim, alongside the script). True? Even state_entry doesn't seem to be called when I duck out of edit move having just edited my notecard.

This leaves me re-reading the config notecard with every click.. less than ideal. Did I miss something?

I'm also having a time with states and editing. If I edit my script while the object as in a non-default state (this is a simple sliding door), it calls state_entry when I'm done .. but on the defaul state. This means the position and properties are off...

thanks for any help, ideas, pointers,

Earnest.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
03-30-2005 22:29
At its simplest, I think what you are looking for is...
CODE

changed(integer change) {
if (change & CHANGED_INVENTORY) {
state reload;
}
}
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-31-2005 01:49
The changed() event as described above works a treat, I use it all the time.

Messing up positions for defaults, it sounds like you're using llGetPos() or similar to give you one position. There are various ways around that:

You could use your datacard to give you the start position so it will always move back to the correct position on recompiling.

You could move the door to the right place before editing - your users won't have to compile the script after all.

You could move it after compiling, stay in edit mode and go to Tools>recompile scripts in selection (which is right at the bottom)

You could, whilst testing, hard code in a hack. Maybe just after the llGetPos() line write an llSetPos() and new llGetPos() for the right starting co-ordinates, and remember to take it out before you sell it!
Earnest Clymer
Registered User
Join date: 20 Feb 2005
Posts: 17
Re: configuration notecards
03-31-2005 21:21
Thank you both. the changed event is a forehead slapper! Well I'm always happier when its me at fault rather lsl.

The state / position mix up is a little more thorny, but something easily remedied with a little documentation to urge users (me at present) to only edit in the down or default state... which makes sense anyway.

oh, and give my love to yorkshire. I'm a displaced native of Leeds myself, far far away in austin tx.

Sam