Is it possible to make scripts that tell the main script what to do? (In linden script, I know you can do it in C++ XP) And if it is, HOW?
LET ME EXPLAIN
The main script has these variables:
Y - (This controls the time that it will Spin)
Y's Default is 30 seconds, so it'll spin for 30 seconds
---------------------
+Main Item+
|
Contents
|
+2 Secondary items+
|
Both have a script in the contents
Now, lets say I'm plopping in an item that has a script that says to add 30 more seconds to the spin time. So, because the timer is a variable, I can easily say "Y += 30" or pretty much, "Y = Y + 30"
Now I can take out that script and add that script at any time, and doing so will say whether I want this object to spin for 30 seconds or 60 seconds.
BUT
I want it to be an item (Not just a script that can sit in the main contents), so that I can also have the secondary script spit out new prims (temporarily) So now lets say the other script in this example does such (spits out new prims to mess up everyone)
So now, the main script says "Hey I'm in "spin-mode"!" which tells the secondary script (in the inventory on the object) That it can spit out prims randomly... This way it doesn't spit out prims when it's not spinning.
---------------------
Again, I want these scripts interchangeable, so it means I can easily take off and put in scripts when I need to. I know you can get items linked to the main prim to talk to each other, but can you get scripts on items within the main prim to talk to each other... That is the question.
--------------------
I can easily say "check the first five inventory items ... excluding this one, and that's the 5 scripts that exist" in the main script (so if someone wanted to add 10, it wouldn't matter because the first 5 are the only ones to work)
And I can also cap off numbers, so if someone added 5 +30 seconds to the spinning, it would cap off at 120 seconds (only 3 would work)
I know how to do that, but it's the whole Main item -> secondary item + script thing where I need some help on. Because I'm not sure if I can get an item's script to contact the main script when its in an item within the main prim. (That's... a mouthful...)
I'm gonna try and show what I'm getting at again... hard to do this with text.
Main item
(Main script) --- I am item --- I am item
.............................|................|
......................... Script ......... Script