Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
|
08-05-2005 09:48
A little new to scripting so these might be obvious if I had a bit more experience. In any case, let's say I'm making a vehicle and I want it to save certain variables from use to use, so that each time I take it out of my pack, it already knows these settings.
1. Can I set a variable that will be remembered even after the item is taken back into my inventory and placed on the ground again? Can't be a constant, must be a variable.
2. I've seen scripts which read data from a notecard (although not the details). Can a script write to a notecard which resides on the object?
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
08-05-2005 09:56
1. Yes. When an object is taken into inventory, its scripts are frozen at their current state, with vairables included. Once it's placed into the world again, the script if unfrozen. For instance, if you have a counter that ticks every second and stores in a variable... the counter will resume where it left off on re-rez - barring any on_rez() event that resets the script.
2. No, but it can write to the object's description line, or even the prim names. Some people use this trick to store data (writing to child prim descriptions.)
|
Jon Marlin
Builder, Coder, RL & SL
Join date: 10 Mar 2005
Posts: 297
|
08-05-2005 09:56
1) No problem - just define the variable in the area above the beginning of the default state. 2) Not possible - LL has decided that they will not allow scripted creation of assets, and notecards are assets. - Jon
_____________________
Come visit Marlin Engineering at Horseshoe (222, 26) to see my line of flying vehicles.
|
Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
|
08-05-2005 09:59
thanks for the quick replies!
|