I am new to linden script / second life. I am working on an interactive learning module which may or may not be plausible in second life.
I am having difficulty with linking objects.
Here is what I would like to accomplish.
Have a cylinder with an X number of holes. Have an X number of smaller cylinders that will be fitted into the holes.
Have a user place the enter data into some of the smaller cylinders.
Have the user place the smaller objects into the larger object, in a correct order. (By I guess clicking on the objects in the order they want them to be placed, the user can also be prompted for the data at this point as well I guess). If the order is correct after all objects are placed in the cylinder will light up. If its incorrect, have the cylinder eject all of the objects and have the user try again.
Once the object is completed, have the user sit on the object or place the object on a vehicle and based on the data entered into some of the smaller cylinders earlier on, have the vehicle / cylinder drive to a destination Y or Z.
As of right now I am not worried about texturing as that can be worked out later on, just functionality. I am having difficulty getting objects to interact.
Here is some code I have: I am working with small squares.
Object 1:
default
{
touch_start(integer total_number)
{
vector position = llGetPos();
llRegionSay(-25321, (string)position);
}
}
Object 2:
integer listen_handle;
default
{
state_entry()
{
listen_handle = llListen(-25321, "", "", ""
;}
listen( integer channel, string name, key id, string message )
{
vector position = (vector)message;
position.z = position.z + .5;
llSetPos(position);
}
touch_start(integer total_number)
{
vector position = llGetPos();
llRegionSay(-25322, (string)position);
}
}
What this does is have object 2 move on top of the other one once object 1 is clicked. However, I would like the two objects to become linked when this happens.
Ive tried to use http://wiki.secondlife.com/wiki/LlCreateLink but have had no luck with that as the examples deal with rezing objects. I was thinking maybe have the starting cylinder rez the smaller cylinders around it to get started but have no clue how to go about that.
Any help / feedback would be appreaciated particullary regarding the plausibility of what I am trying to accomplish. (as well as how long it might take). I am also new to second life and my exposure to what is capable in second life limited. I am not too familiar with object keys, parent objects, and such.
hrug: