# Marlon Wulluf

Resident

20

0 Neutral
1. ## Prim Auto Align Script wanted.

@Innula Zenovka OK, now that seems to work, and all I need to do now, is to modify it a bit so that it can be placed into a root prim of a linkset that has touchable faces, IE, a 4 way tunnel, that has 4 touchable faces, then try to (according to which face of the linked child is touched), get the entire linkset torotate and move into place using the linked child as if it was a single prim. As I said, I'm useless at Einstein math, and working with vectors and rotations that don't actually match the expected numbers so that a conversion is required, hence a vast knowledge of trig is needed. Trig is something I hated, even in school, but give me boolean algebra? and I can tell you the truth tables of AND, NAND, OR, NOR, XOR, gates of digital circuits
2. ## Prim Auto Align Script wanted.

That's not the point, what if I created a modular system that just like the video here:- https://www.dropbox.com/s/gt52u67yjpf1v3n/Auto-Align.avi?dl=0 I would need to then, (according to you), rez a module, align it to where I think someone would want it positioned, then record that position, then add it a script, then rez another module and repeat,,,, the idea is NOT to have to record ANY positions or rotations, but for the scripts to do that automatically, just like the short video I posted,,, if that's too hard to understand then there's no point in continuing this futile attempt. I'll explain this once more. The idea is to rez a prim or a linkset (watch above video), then TOUCH any face on that prim or linkset, it will either glow or change color to show that side of the prim/object has been selected, THEN, rez another prim/object and touch one of it's faces, and the 2nd object/prim will auto align with the face of the 1st object shown glowing or changed color, regardless of random positioning. Like the video, the main object has not just that 1 point of contact but could have other points too, and the other object(s) may have multiple points of contact too, meaning not just that one point shown in the video would be touched,,, there could be another point further along that object, and by clicking that would rotate the object and align to that contact point instead. I can't get much simpler than that. If you need further example, I suggest going to the marketplace and buying the BBI Forseti modular space station and look for yourself.
3. ## Prim Auto Align Script wanted.

@Innula Zenovka Have a look at this video screenshot I took, excuse the quality, as my viewer was using up most of the GFX memory and camstudio didn't like it when trying to record at a higher resolution, anyway,,,, this is the procedure, I took in following your suggestion to the letter, and as you can see at the end when I move the pointer around on the slave prim, I'm trying to click it, and it's not doing anything. Procedure I used to attempt prim auto align. The previous video:- https://www.dropbox.com/s/gt52u67yjpf1v3n/Auto-Align.avi?dl=0 should have been self explanatory.
4. ## Prim Auto Align Script wanted.

I realize that, but that's based on the slave prim being in the exact rotation and position every time, so that the offset and rotation is the same,,,, have a look at the video again,,,, I touched the left object and it lit up, then I touched the right object and it then aligned with the face of the right object, it doesn't matter how close or far the 2nd object is or how it's rotated, it will still line up with the 1st object, without editing anything. I'm not trying to sound sarcastic, but did you try the scripts inworld? I did, and I even did it as you suggested, and the slave prim didn't move an inch.
5. ## Prim Auto Align Script wanted.

@Innula Zenovka Thanks for the scripts, but using 4 scripts and to write down data wouldn't be feasible for other people to do, hence the requirement of just clicking one face on the main prim/object then clicking a face on the child prim/object and they would auto align without entering anything into the scripts. I had to modify them a little and even though you supplied 4 scripts, I narrowed it down to just 2, the main and the child, and instead of the main saying the offset and the rotation of the child, they are first converted into a list, then to a string for sending to the child using llRegionSay,,,, then in the child script, the conversion is reversed, and the variable vTargetPos is calculated with the offset received from the main and the variable rTargetRot is calculated also to include rRot from the main, then the usual movement control is used, but it don't want to work, there is no movement. These are the 2 scripts I modified:- //PLACE IN MASTER OBJECT TO READ SLAVE OBJECT'S OFFSET AND ROTATION IN RELATION TO MASTER OBJECT integer iChannel = -67341870; integer cChannel = -27465144; list objDetails; default { state_entry() { llListen(iChannel, "","",""); } listen(integer channel, string name, key id, string message) { list temp = llGetObjectDetails(id, [OBJECT_POS,OBJECT_ROT]);//Read region position and rotation of child object vector vMyPos = llGetPos();//Main object's position rotation rMyRot = llGetRot();//Main object's rotation vector vChildPos = llList2Vector(temp, 0);//Child object's position rotation rChildRot = llList2Rot(temp, 1);//Child object's rotation vector vOffset = (vChildPos - vMyPos)/rMyRot; //calculate how far the child object is from the main object, discounting the main object's rotation //that is, the offset when the main object is rotated at <0.0,0.0,0.0> rChildRot = rChildRot / rMyRot;//calculate the child object's rotation when the main object is rotated at <0.0,0.0,0.0> objDetails = [vOffset, rChildRot]; string objSend = llDumpList2String(objDetails,"|"); // Convert to a string ready for sending to the slave prim. llRegionSay(cChannel, objSend); // Send the Slave offset and rotation to the Slave. } } And this one for the child prim:- //PLACE THIS IN THE CHILD OBJECT TO MAKE IT MOVE INTO THE DESIRED POSITION AND ROTATION IN RELATION TO THE MAIN OBJECT integer iChannel = -67341870; integer cChannel = -27465144; list objDetails; rotation rRot; // = <0.0, 0.0, -1.0, 0.0>; //fill in desired rotation here, rotation provided by the Master prim vector vOffset; // = <1.0,0.0,0.0>; //fill in desired offset here, offset provided by the Master prim. default { state_entry() { llListen(iChannel, "","",""); llListen(cChannel, "","",""); } touch_start(integer num_detected) { llRegionSay(iChannel,"boo"); } listen(integer channel, string name, key id, string message) { list temp = llGetObjectDetails(id,[OBJECT_POS,OBJECT_ROT]); vector vObjectPos = llList2Vector(temp, 0);//read target object's position rotation rObjectRot = llList2Rot(temp,1);//and rotation // vector vTargetPos = vObjectPos + vOffset * rObjectRot;//calculate the target position, using the target object's frame of rotational reference, not the region's (i.e. relative to the target object) // rotation rTargetRot = rRot * rObjectRot;//calculate the child object's desired rotation, using the target object's frame of rotational reference if (channel == cChannel) { objDetails = llParseString2List(message,["|"],[]); // Convert the incoming text back into a list. vOffset = llList2Vector(objDetails, 0); // Separate the offset from the list. rRot = llList2Rot(objDetails, 1); // Separate the rotation from the list. // Prepare this slave prim for movement and rotation. vector vTargetPos = vObjectPos + vOffset * rObjectRot; rotation rTargetRot = rRot * rObjectRot; llSay(0, (string)vOffset); // Used for debugging llSay(0, (string)rRot); // Used for debugging // llSay(0, llList2String(objDetails, 0)); // llSay(0, llList2String(objDetails, 1)); llSetRegionPos(vTargetPos);//move to the target position llSetRot(rTargetRot);//and rotate to face in appropriate direction } } }
6. ## Prim Auto Align Script wanted.

Yep you're definitely missing that I'm no Einstein and trig is not my forte.
7. ## Prim Auto Align Script wanted.

They say video say more, than trying to explain in text ,,,,,,the below link is to a short video I created, demonstrating what I want the script to do,,,, bare in mind, the 2 objects are completely separate and are not linked to each other, and each module has only 1 script in it's root prim, and is part of the afore mentioned space station where the scripts are no mod. https://www.dropbox.com/s/gt52u67yjpf1v3n/Auto-Align.avi?dl=0
8. ## Prim Auto Align Script wanted.

I already know about this tool in Firestorm, but it's only use to when building, but what if I'm building a modular system, that instead of someone rezzing each piece and manually aligning them up, a script would do that, not just for prims but also for linksets too EG. I'm using completely separate linksets,,, 1 set is a tunnel with 2 hollowed prims, 1 at each end of the tunnel, the tunnel itself is root and the end prims are children, the other objects (T section and curved tunnel), not linked to the tunnel, but as separate objects, have the same hollowed prim at the ends of the objects,,, EG, the T section would have 3 hollowed prims 1 at each end, as children to the root prim which would be one of the center prims of the T section, the idea would be to touch the outer face of one of those child prims and it would glow to show selected,,,, then on another completely separate object linkset, I would touch the outside face of another child prim and the 2nd object would move into alignment with the first object that has the face glowing, but there's a difference, if I touched the outer face of any point of the T section then it becomes stationary and when I touch the outer face of the tunnel, then the tunnel not the T section would move into alignment, but if I touched the outer face of the tunnel first, then touched the outer face of one of the T section entrances, then the tunnel would be stationary and the T section would move into alignment, this way I can create modular builds that would auto align when one face is clicked then another face etc etc. Much like this short video,,,, the parts are from a space station I purchased, but the scripts are no mod, and each part has only 1 script. https://www.dropbox.com/s/gt52u67yjpf1v3n/Auto-Align.avi?dl=0
9. ## Prim Auto Align Script wanted.

OK, I'm using completely separate linksets,,, 1 set is a tunnel with 2 hollowed prims, 1 at each end of the tunnel, the tunnel itself is root and the end prims are children, the other objects (T section and curved tunnel), not linked to the tunnel, but as separate objects, have the same hollowed prim at the ends of the objects,,, EG, the T section would have 3 hollowed prims 1 at each end, as children to the root prim which would be one of the center prims of the T section, the idea would be to touch the outer face of one of those child prims and it would glow to show selected,,,, then on another completely separate object linkset, I would touch the outside face of another child prim and the 2nd object would move into alignment with the first object that has the face glowing, but there's a difference, if I touched the outer face of any point of the T section then it becomes stationary and when I touch the outer face of the tunnel, then the tunnel not the T section would move into alignment, but if I touched the outer face of the tunnel first, then touched the outer face of one of the T section entrances, then the tunnel would be stationary and the T section would move into alignment. I bought a space station kit that does just that, rez the main hub, then click on one of the door outer rim faces, and rez another section, then click on the outer face of the 2nd section's door, and the 2nd section will move and align itself with the hub, you do this all the sections you want to add to the space station, which gave me an idea on perfectly aligning prims or creating modular builds that would align perfectly without using the object editing tools, but the station scripts are no mod.
10. ## Prim Auto Align Script wanted.

I'm looking for is a full perm script or several scripts than can take an object and align another to it on the X, Y and Z axis, an example would be tunnels with straight, curved, and intersections. EG. Rez straight tunnel, click on one of the entrance faces, this will glow to show selected, then rez the T section, and click on any of the edge faces of the T section, and the entire T section will move and rotate to align itself with the selected face facing the selected tunnel face. If I was an Einstein, then I would attempt to create the script(s) myself, but I'm not and hence the request.
11. ## Prim Auto Align Script wanted.

Objects are pure prim, and the linksets have a single child prim for the alignment. One of the objects is a 3 way T intersection, and if I wanted to align the section on the leg of the T to the existing rezzed tunnels, then I would first click the face of the exposed end of the tunnel entrance,,, then click the face of the bottom of the leg of the T, then no matter what rotation the T section is,,, it will auto align so that the leg of the T would face the existing tunnel entrance, and them move to align on the same X, Y and Z axis as the child prim on the end of the tunnel linkset. EG I have 1 straight tunnel with clickable faces at both ends, I also have a T section with clickable faces on each of the ends, I also have a curved tunnel with clickable faces at both ends, etc etc, now I rez the straight tunnel, click a face at one of the ends,,,, this will then glow to show it's selected,,,, then I would rez a T section, then click on one of the faces at one of the ends, and the T section would move and align its self to the end of the already rezzed tunnel, and the faces that were selected would stop glowing, till the next time a section is to be added. So, in affect which ever object face is clicked first, is the object that the other object would align to, so in other worlds, clicking the face on object 1 then clicking the face on object 2 would align object 2 to object 1, but if I clicked object 2 first, then any other object that is clicked would align to object 2. This is what I'm looking for in the script or scripts.
12. ## Prim Auto Align Script wanted.

OK, this is what I'm looking for,,,, I would like to be able to auto align objects just by clicking one of the faces of one object and a face of another object and they would 'snap' into place and auto align,,,, one example would be building lengthy tunnels, I would rez 2 tunnels, click the face of one of the tunnel entrances which would glow, and clicking again to cancel, then click the face of the other tunnel entrance, and the 2nd object would rotate and move to align itself with the 1st object, then I would rez a 3rd tunnel, click the face of the existing tunnel to where the 3rd tunnel would need to be placed, then click the face of the 3rd tunnel entrance, and it would rotate if needed and move to align with the rest of the tunnels. I know it involves an Einstein load of math, including trig, which I'm literally useless at, hence the request of a script that can do that.