Jump to content

Sabrina Tamerlane

Resident
  • Content Count

    54
  • Joined

  • Last visited

Everything posted by Sabrina Tamerlane

  1. As an AO maker, I suggest you disable or detach your AO. If you need it to not interfer the best would be to remove it so that it won't add to the sim lag. On the other hand, if you really want to keep it then you need specially made animations that don't interfer with the head. Anything is possible to do, it just takes a lot of time and efforts...
  2. I have visited Sansar and Sinespace and they are far from having SL's capabilities. For example, as far as I could see they have no Animation Overrides so people stay idle or with a basic animation, the scripting is also very limited. If Sansar and Sinespace wanted to provide SL-like features then they would have to go through a lot of pain and testing because when you add features then things may gone wrong, and with SL we have been through that, for example LL has put throttles in place to prevent the servers from being hammered too much. Perhaps will they add these features in the future? Maybe, but they have not crossed the river yet... It is also a philosophy, whether the devs want or not to give power to the users. It's more comfortable to limit the users to the strict necessary, but that does not make SL.
  3. They may be after profit, technology, or influence, or some kind of mix of the three. If they are after technology they might just want to take Tilia and let the rest crumble. If they are after influence they will want to make SL grow. Microsoft has bought Nokia phones to get rid of a competitor and get some patents but that did not help them that much. Facebook has bought Instagram because it had a lot of users. There are many possible goals.
  4. The risk here is to see SL turned into a cash cow, with higher upload prices for example. Maybe they have different plans, I hope so.
  5. Sometimes when you take a pose your feet don't touch the ground. With RLV you can adjust your height. I am using it in my AO, it only takes a few lines of code, and yes I have found this idea in Open Collar.
  6. Oh you are right. I have taken a long break and didn't realize that OC had inflated so much! RLV does not take that much code when limited to a few functions.
  7. RLV does not take that much, but it costs a listen to make sure that it is active on the viewer. There is a lot to learn from OC code, yes there are some flaws but there are also some very good ideas.
  8. There was another typo in the script! Here is the fixed version: integer link_axis; integer link_box1; integer link_box2; float rotClickAngle = 15; rotation rotRoot2Axis; vector posRoot2Axis; vector axisAxis; vector offsetBody_inRootFrame; vector offsetBeam_inRootFrame; rotation rotRoot2Body; vector posRoot2Body; rotation rotRoot2Beam; vector posRoot2Beam; integer listener; integer chan = -55555; do_rotate(float angle){ rotation rotClick_inRootFrame = llAxisAngle2Rot(axisAxis, angle *DEG_TO_RAD); // for body. rotation newrotRoot2Body = rotRoot2Body * rotClick_inRootFrame; vector newoffsetBody_inRootFrame = offsetBody_inRootFrame* rotClick_inRootFrame; //Beam. rotation newrotRoot2Beam = rotRoot2Beam * rotClick_inRootFrame; vector newoffsetBeam_inRootFrame = offsetBeam_inRootFrame * rotClick_inRootFrame; llSetLinkPrimitiveParamsFast(1,[ PRIM_LINK_TARGET,link_box1,PRIM_ROT_LOCAL,newrotRoot2Body, PRIM_LINK_TARGET, link_box2,PRIM_ROT_LOCAL, newrotRoot2Beam,PRIM_POS_LOCAL, posRoot2Axis + newoffsetBeam_inRootFrame]); } integer rotating = FALSE; integer link_by_name(string linkName) { integer N=llGetNumberOfPrims(); integer i; for(i=1;i<=N;i++) { if (llGetLinkName(i)==linkName) { llOwnerSay(linkName + " : " + (string)i); return i; } } llOwnerSay(linkName + " not found"); return -99; } reset() { llSetLinkPrimitiveParamsFast(1,[ PRIM_LINK_TARGET,link_box1,PRIM_ROT_LOCAL,rotRoot2Body,PRIM_POS_LOCAL, posRoot2Body, PRIM_LINK_TARGET, link_box2,PRIM_ROT_LOCAL, rotRoot2Beam,PRIM_POS_LOCAL, posRoot2Beam]); } default { state_entry() { link_axis = link_by_name("axis"); link_box1 = link_by_name("box1"); link_box2 = link_by_name("box2"); list L = llGetLinkPrimitiveParams(link_axis,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotRoot2Axis = llList2Rot(L,0); posRoot2Axis = llList2Vector(L,1); axisAxis=<0,0,1>*rotRoot2Axis; L = llGetLinkPrimitiveParams(link_box1,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotRoot2Body = llList2Rot(L,0); posRoot2Body = llList2Vector(L,1); L = llGetLinkPrimitiveParams(link_box2,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotRoot2Beam = llList2Rot(L,0); posRoot2Beam = llList2Vector(L,1); offsetBody_inRootFrame = posRoot2Body - posRoot2Axis; offsetBeam_inRootFrame = posRoot2Beam - posRoot2Axis; listener = llListen(chan, "", NULL_KEY, "") ; llTextBox(llGetOwner(), "What angle would you like?", chan) ; } listen(integer chan, string name, key id, string text) { llListenRemove(listener) ; float angle = (float)text ; llOwnerSay("angle = " + (string)angle) ; do_rotate(angle) ; llOwnerSay("Done. Touch me for movement."); } touch_start(integer total_number) { llOwnerSay("this is link "+ (string)llDetectedLinkNumber(total_number)) ; if (!rotating) { rotating = TRUE ; reset() ; llSetTimerEvent(1.0) ; } else { rotating = FALSE ; llSetTimerEvent(0.0) ; reset() ; } } timer() { rotClickAngle += 5 ; if (rotClickAngle > 359.0) { rotClickAngle = 0; } do_rotate(rotClickAngle) ; } }
  9. The first script was working but there was a typo: rotation newrotRoot2Beam = rotRoot2Body * rotClick_inRootFrame; It should be: rotation newrotRoot2Beam = rotRoot2Beam * rotClick_inRootFrame;
  10. I have modified the script so that it would collect the right link numbers, and it also restores the starting position on touch. There is an issue because the position is changed. I am not available to look at it right now but it should not be too hard to fix
  11. https://gyazo.com/aedaf265a113c9bdc61b79e1ab9c7f83 As I said earlier, if it does not work for you, double check the prim numbers at the start of the script
  12. The increment is in the timer, you can set any angle that you wish. If it does not work with your prims, make sure to set the right numbers. For example, if you would like to rotate 45° then you would call: do_rotate(45.0);
  13. integer link_axis = 3; // set this to real prim number integer link_box1 = 2; // set this to real prim number integer link_box2 = 4; // set this to real prim number float rotClickAngle = 5; rotation rotRoot2Axis; vector posRoot2Axis; vector axisAxis; rotation rotRoot2Body; vector posRoot2Body; rotation rotRoot2Beam; vector posRoot2Beam; do_rotate(float angle){ rotation rotClick_inRootFrame = llAxisAngle2Rot(axisAxis, rotClickAngle *DEG_TO_RAD); // rotation rotClick_inRootFrame = llEuler2Rot(<0, 0, angle> *DEG_TO_RAD); // for body. rotation newrotRoot2Body = rotRoot2Body * rotClick_inRootFrame; vector offsetBody_inRootFrame = posRoot2Body - posRoot2Axis; vector newoffsetBody_inRootFrame = offsetBody_inRootFrame* rotClick_inRootFrame; //Beam. rotation newrotRoot2Beam = rotRoot2Body * rotClick_inRootFrame; vector offsetBeam_inRootFrame = posRoot2Beam - posRoot2Axis; vector newoffsetBeam_inRootFrame = offsetBeam_inRootFrame * rotClick_inRootFrame; llSetLinkPrimitiveParamsFast(1,[ PRIM_LINK_TARGET,link_box1,PRIM_ROT_LOCAL,newrotRoot2Body,PRIM_POS_LOCAL, posRoot2Axis + newoffsetBody_inRootFrame, PRIM_LINK_TARGET, link_box2,PRIM_ROT_LOCAL,llEuler2Rot(<-90,0,0>*DEG_TO_RAD)*newrotRoot2Beam,PRIM_POS_LOCAL, posRoot2Axis + newoffsetBeam_inRootFrame]); } integer rotating = FALSE; default { state_entry() { list L = llGetLinkPrimitiveParams(link_axis,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotRoot2Axis = llList2Rot(L,0); posRoot2Axis = llList2Vector(L,1); axisAxis=<0,0,1>*rotRoot2Axis; L = llGetLinkPrimitiveParams(link_box1,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotRoot2Body = llList2Rot(L,0); posRoot2Body = llList2Vector(L,1); L = llGetLinkPrimitiveParams(link_box2,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotRoot2Beam = llList2Rot(L,0); posRoot2Beam = llList2Vector(L,1); } touch_start(integer total_number) { if (!rotating) { rotating = TRUE ; llSetTimerEvent(1.0) ; } else { rotating = FALSE ; llSetTimerEvent(0.0) ; } } timer() { rotClickAngle += 5 ; if (rotClickAngle > 359.0) { rotClickAngle = 0; } do_rotate(rotClickAngle) ; } } They need to be in state_entry so that you would rotate from the original position, and not increment it.
  14. Lines like these need to go away from the function and put in state_entry for example, and you need to make the rotation and vector globals as I explained before. list L = llGetLinkPrimitiveParams(link_axis,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotation rotRoot2Axis = llList2Rot(L,0); vector posRoot2Axis = llList2Vector(L,1);
  15. I have made a mistake with llAxisAnglle2Rot and edited my answer... Yes, you can subtract a rotation with divide just like you add with multiply. You need to change your function do_rotate like this: do_rotate(float angle){ rotation rotClick_inRootFrame = llAxisAngle2Rot(axisAxis, angle *DEG_TO_RAD); // for body. vector offsetBody_inRootFrame = posRoot2Body - posRoot2Axis; vector newoffsetBody_inRootFrame = offsetBody_inRootFrame* rotClick_inRootFrame; //Beam. vector offsetBeam_inRootFrame = posRoot2Beam - posRoot2Axis; vector newoffsetBeam_inRootFrame = offsetBeam_inRootFrame * rotClick_inRootFrame; llSetLinkPrimitiveParamsFast(1,[ PRIM_LINK_TARGET,link_box1,PRIM_ROT_LOCAL,newrotRoot2Body,PRIM_POS_LOCAL, posRoot2Axis + newoffsetBody_inRootFrame, PRIM_LINK_TARGET, link_box2,PRIM_ROT_LOCAL,llEuler2Rot(<-90,0,0>*DEG_TO_RAD)*newrotRoot2Beam,PRIM_POS_LOCAL, posRoot2Axis + newoffsetBeam_inRootFrame]); } The missing variables should be made global as I explained before. I didn't test it so there may be errors, however this is the idea
  16. I was wrong about llAxisAngle2Rot, you need that one to get the correct rotation. Okay, rotations are very easy to understand when they are expressed in Euler angles (X, Y, Z) but they are very hard to compute that way. So we use quaternions instead that are very hard to understand but very easy to compute because you simply need to multiply quaternions to add rotations. So, for example, if you want to rotate 30° along z axis, you will first calculate the vector, so it is <0, 0, 1> * 30.0 * DEG_TO_RAD, because the angles are expressed in radians. And then you use llAxisAngle2Rot to convert this vector into a quaternion. You can also write <0, 0, 30.0> * DEG_TO_RAD. Now that you have this, lets call this q30z = llAxisAngle2Rot(<0, 0, 30> * DEG_TO_RAD), any rotation that you have you can make it rotate 30° along Z axis by multiplying it with q30z. You see that in your code you have: vector newoffsetBody_inRootFrame = offsetBody_inRootFrame* rotClick_inRootFrame; so if you want to rotate it 30° along z axis, you will use offsetBody_inRootFrame* q30t If you don't want to add a rotation, but instead rotate by a given amount, you will need to save the rotations at the start of the program then apply the rotations from that point: list L = llGetLinkPrimitiveParams(link_axis,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotation rotRoot2Axis = llList2Rot(L,0); vector posRoot2Axis = llList2Vector(L,1); This has to be removed and put in state_entry. Make rotRoot2Axis and posRoot2Axis global. L = llGetLinkPrimitiveParams(link_box1,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotation rotRoot2Body = llList2Rot(L,0); vector posRoot2Body = llList2Vector(L,1); L = llGetLinkPrimitiveParams(link_box2,[PRIM_ROT_LOCAL, PRIM_POS_LOCAL]); rotation rotRoot2Beam = llList2Rot(L,0); vector posRoot2Beam = llList2Vector(L,1); This too has to be made global.
  17. If you want to add a rotation you need to multiply the quaternions. You need to change this line: // rotation rotClick_inRootFrame = llAxisAngle2Rot(axisAxis, rotClickAngle *DEG_TO_RAD); rotation rotClick_inRootFrame = llEuler2Rot(<0, 0, rotClickAngle> *DEG_TO_RAD);
  18. I have noticed that if you pass KFM_CMD_STOP without a KFM_CMD_LOOP before then the moving end event will not be triggered.
  19. Does this fix your problem? float PERIOD = 4.0; float AMP = 0.1; integer KFM_STEPS = 25; list kfmCommands; vector savePos; default { state_entry() { // set up KFM command list to bounce up and back float interval = (integer)((PERIOD / KFM_STEPS) * 45.0) / 45.0; float lastZ = llSin(0.0); integer step = 1; for (step = 1; step < KFM_STEPS; ++step) { float x = (TWO_PI * step) / KFM_STEPS; float newZ = AMP * llSin(x); kfmCommands += [ <0, 0, newZ - lastZ>, interval]; lastZ = newZ; } savePos = llGetPos(); llSetKeyframedMotion(kfmCommands, [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_LOOP]); } touch_start(integer num_detected) { llSetKeyframedMotion([], [KFM_COMMAND, KFM_CMD_STOP]); // Doesn't help } moving_end() { vector atPos = llGetPos(); llSetLinkPrimitiveParams(LINK_THIS, [PRIM_POSITION, savePos]); // Restore position vector setPos = llGetPos(); llOwnerSay((string)atPos.z+" --> "+(string)setPos.z); llSetKeyframedMotion(kfmCommands, [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_LOOP]); } }
  20. On the wiki they say this: So, I think that if you reach moving_end you are at a known position. Alternatively, you can do llGetPos() to figure out what is the frame number and then make a new motion starting from that frame.
  21. Is it acceptable to wait until the animation is completed before stopping it? If not then you need to know at which frame it stopped.
  22. I have changed pictures on my items and the listed order changed as well, so it's difficult to order them properly.
  23. If the names are stored in the script it is a memory hog. So, it can be very easy to do, but it can crash also very easily. Now if you are looking for a specific person like a dancer or host then it's different.
  24. The early years are the most cheerful. When they leave the academy it becomes darker.
  25. There are scripting classes in second life. I know for sure that you can join the HAPPY HIPPSTERS group and get lessons, but there is surely more than that.
×
×
  • Create New...