Hey thanks! A step in the right direction for the script.
Question though: how is the Object C position being passed through an avatar key? That's the part that's confusing me.
I shouldve added this little tidbit of info last night though: Is it possible to code something like this to where the names of A and C could be different? Background on the product: Im trying to create a meal system where object A is, let's say a pot of soup, and when clicked, the pot would rez a plate with the bowl of soup (object B) on top of the selected placemat (object C) Now, the idea is that the Object C's would be constant (though they could have different names based on the design on them), but if the user purchases a different meal, say cheeseburgers, that the cheeseburger meal would rez a plate of cheeseburger on the placemat. I've added what Code I have below if someone could help
Meal -
list mainmenu = ["Clear Plates", "Serve Meal"];key user;integer channel;integer listen_handle;string platename;vector matposition;vector rezPos;vector rezVel;rotation rezRot;vector posoffset = <0.000503,0.000870,0.013415>;vector veloffset = <0,0,0>;rotation rotoffset;default{ state_entry() { channel = 3635; platename = llGetInventoryName(INVENTORY_OBJECT, 0); } touch_start(integer total_number) { user = llDetectedKey(0); llDialog(user, "What would you like to do?", mainmenu, channel); listen_handle = llListen(channel, "", user, ""); llSetTimerEvent(30.0); } listen(integer channel, string name, key id, string message) { if (message == "Clear Plates") { llWhisper(channel, "reset"); return; } else if (message == "matposition") { return; } else if (message == "Serve Meal") { vector xyz_angles = <90.0,90.0,0>; // This is to define a degree change vector angles_in_radians = xyz_angles*DEG_TO_RAD; // Change to Radians rotoffset = llEuler2Rot(angles_in_radians); // Change to a Rotation vector rezVel = veloffset*llGetRot(); rotation rezRot = rotoffset*llGetRot(); vector rezPos = matposition; llWhisper(channel, "reset"); llRezAtRoot(platename, rezPos, ZERO_VECTOR, rezRot, channel); //rez plate at placemat's position return; } else { return; } } timer() { llListenRemove(listen_handle); }}
Placemat -
integer chan;vector matpostion;default{ on_rez(integer chan) { chan = 3635; llListen(chan, "","",""); } listen(integer chan, string name, key id, string str) { if(str == "reset") { llDie(); } else if(str == "Serve Meal") { vector mat = llGetPos(); llWhisper(chan, (string)mat); } }}