Jump to content

mansoor50

Resident
  • Posts

    48
  • Joined

  • Last visited

Everything posted by mansoor50

  1. i am building a fish tank and i have a fish that makes a sound. while i made the fish prim i cd hear the sound - which was outside the tank but when i put it in the tank, the only way i can hear it is if i am sitting right next to the tank. otherwise, i cant hear it even when the fish jumps out of the water. not sure what i am doing wrong.
  2. i certainly will share my object with u in-world. KFM is being used in the root i log in about 7 pm slt ... at work now..:)
  3. Inulla..please ignore my previous reply.......i got it to work!!!!! since my KFM is a total of 15 seconds, i make the script sleep for 15 seconds and its working fine..... have no idea why tho.....
  4. thank u Innula ... again! so... i have not yet tried ur solution...will be doing so in a bit..... and my KFM and rotation stuff is all in the root prim.....the child prim only has a an animator script that animates gif images here is a psuedo-code for my code: state entry: targetomega: rotate fish around the root touch start: stop targetomega set child rotation to 0,0,0 set child rotation to 0,pi_by_two,0 kfm set child rotation to 0,0,0 targetomega ... start rotating the fish again and the program is getting executed like this: code before kfm works fine the rotation line that is just after the kfm seems to be executed simultaneously with the kfm! targetomega is executed once the kfm is complete. below is the code: if (mtouch==0) { llSay(0, "Ama learnt how to jump!"); llSetRot(llEuler2Rot(<0,0,0>*DEG_TO_RAD)); rot = llEuler2Rot( <0.0,0.0,0.0>); llSetLinkPrimitiveParams(2, [ PRIM_ROTATION, rot ]); //llSleep(5); rot = llEuler2Rot( <0.0,PI_BY_TWO,0.0>); llSetLinkPrimitiveParams(2, [ PRIM_ROTATION, rot ]); //llSleep(5); llSetKeyframedMotion([<0.0, 0.0, 5.0>, llEuler2Rot(<0, 0, 0> * DEG_TO_RAD), 5, <0.0, 0.0, 0.0>, llEuler2Rot(<-180, 0, 0> * DEG_TO_RAD), 5, <0.0, 0.0, -5.0>, llEuler2Rot(<0, 0, 0> * DEG_TO_RAD), 5], [KFM_MODE, KFM_FORWARD]); rot = llEuler2Rot( <0.0,0,0>); llSetLinkPrimitiveParams(2, [ PRIM_ROTATION, rot ]); llSetRot(llEuler2Rot(<0,0,0>*DEG_TO_RAD)); llTargetOmega(<0,0,1>,1.0,.2); mtouch=1;
  5. thank u Innula..... sorry for getting back to u so late.... i tried the KF and it works wonderfully on the prim. and as usual.. i have questions...:) i have a fish that i want to do the following: 1. rotate at the bottom of the tank (i did that by linking it to a root prim) 2. i want it to go up, out of the tank then dive back in. (working but not quite..see below) 3. start rotating again the code below is in the root prim for #2, a. I need to rotate the linked fish 90 so it points up (originally it is horizontal- that is working thru the llsetlinkparam) b. then the keyframe kicks in - as u can see...it goes up 5m, then the root rotates 180 and comes back down. my reasoning is that as the root spins, so shd the fish and it shd then show point it downwards. but the fish is not behaving. with each touch, the orientation of the fish changes. can u please tell me where am i going wrong? rot = llEuler2Rot( <0.0,PI_BY_TWO,0.0>); llSetLinkPrimitiveParams(2, [ PRIM_ROTATION, rot ]); llSetKeyframedMotion([<0.0, 0.0, 5.0>, llEuler2Rot(<0, 0, 0> * DEG_TO_RAD), 5, <0.0, 0.0, -5.0>, llEuler2Rot(<180, 0, 0> * DEG_TO_RAD), 5, <0,0,0>,llEuler2Rot(<0,0,0>),1], [KFM_MODE, KFM_FORWARD]); rot = llEuler2Rot( <0.0,0.0,0.0>); llSetLinkPrimitiveParams(2, [ PRIM_ROTATION, rot ]); llTargetOmega(<0,0,1>,1.0,.2);
  6. Good evening (or as the case may be) Targetomega allows a prim to spin. but if i wanted to spin a prim, lets say 90 deg and then spin back 90 deg how wd i do that? setrot brings it back but there is no movement..it just snaps the prim back.
  7. thank u!!!!! and i declare myself officially stupid.. this was so obvious...THANKS!!
  8. Hi. my script which is rezzing/linking is in the root prim. so doing the llsetobjectname simply changes the name of the root prim not the child prims. wd it be correct to assume that the object_rez (key id) gives the KEY of the prim being linked? if that is true....is there a function that i can refer to a prim using its id/key? its odd that to get the link number u have to put a script inside the rezzed prim..:(
  9. it worked very nicely. I have rezzed 70 prims, and all got linked too....thank you EVERYONE for their help. Rolig ... thanks..:) My next practice is to find the link numbers so i can play with the individual prims.
  10. so the first rez occurs in touch start and the remaining in the on_rez event?
  11. aha......i need to read up on the change event and see what it means/does....but thank u for pointing me in the right direction
  12. I was actually rezzing 70. but the number linked were only 64. so that means the max limit is 64? i read ur reply a few times to try and understand. In effect, you are saying that the llsetlinkcolor command is issued before the event queue is completed. Therefore, the question then would be how to delay the setlinkcolor till the queue is completed. And how can we find out if there is stuff in the queue?? And i really appreciate your detailed reply. THANKS!!
  13. vector relativePosOffset = <.5, 0.0, 0.0>; // "Forward" and a little "above" this prim vector relativeVel = <1.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s rotation relativeRot = <0.0,0.707107, 0.0, 0.707107>; //ZERO_ROTATION; // Rotated 90 degrees on the x-axis compared to this prim integer startParam = 10; string obj="chip"; vector myPos; rotation myRot; vector rezPos; vector rezVel; rotation rezRot; integer mCol; float vGap; float hGap; float mColtmp; integer i; integer works; integer prims; float size; //this is the size of the prim called 'chip' create_col(integer mCol, float vGap, float hGap) { myPos = llGetPos(); myRot = llGetRot(); size=.25; rezPos = myPos+relativePosOffset*myRot; rezVel = relativeVel*myRot; rezRot = relativeRot*myRot; i=0; while (i<=9) { if (mCol==1){ if (i==0) { relativePosOffset = <.5, 0.0, 0.0>; } else { relativePosOffset = <.5, 0.0, (float) i*(size+vGap)>; } rezPos = myPos+relativePosOffset*myRot; llRezAtRoot(obj, rezPos, rezVel, rezRot, startParam); } if (mCol>=2){ mColtmp=(float)(mCol-1); if (i==0) { relativePosOffset = <.5, mColtmp*(size+hGap), 0.0>; } else { relativePosOffset = <.5, mColtmp*(size+hGap), (float) i*(size+vGap)>; } rezPos = myPos+relativePosOffset*myRot; llRezAtRoot(obj, rezPos, rezVel, rezRot, startParam); } i++; } } default { state_entry() { llSay(0, "Hello, Avatar!"); llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS); } on_rez(integer start_param) { llResetScript(); } touch_start(integer total_number) { llSay(0,"touch start # of prims"+(string)llGetObjectPrimCount(llGetKey())); llSay(0,"works:"+(string) works); if (llGetObjectPrimCount(llGetKey())<=1) { if (works) { mCol=1; vGap=0.03; hGap=0.03; create_col(mCol, vGap, hGap); mCol=2; create_col(mCol, vGap, hGap); mCol=3; create_col(mCol, vGap, hGap); mCol=4; create_col(mCol, vGap, hGap); mCol=5; create_col(mCol, vGap, hGap); mCol=6; create_col(mCol, vGap, hGap); } llSetLinkColor(6, <0.0, 1.0, 0.0>, ALL_SIDES); } } run_time_permissions(integer perm) { // Only bother rezzing the object if will be able to link it. if (perm & PERMISSION_CHANGE_LINKS){ works = TRUE; } else { works = FALSE; } } object_rez(key id) { // NOTE: under some conditions, this could fail to work. // This is the parent object. Create a link to the newly-created child. llCreateLink(id, TRUE); // llSay(0,"id of rezzed child:"+(string) id); } }
  14. I am rezzing 60 square tiles of .25m. the code is a bit long so i will simply write steps what i am doing. the problem is that the color does not change till i 'Touch' the root prim the SECOND time. 1. the state entry takes the request to permit change_links 2. on_rez resets the script 3. touch_start calls a function named "create_col'. this fcn rezzes 10 tiles in a column. the function 'create_col is a loop that runs 10 times to llrezatroot. this is working fine in order to create 6 columns, i call 'create_col' 6 times with different parameters giving me a total of 6 cols of 10 tiles each. all is good till this point. the last line in the touch_start is the llSetLinkColor(6, <0.0, 1.0, 0.0>, ALL_SIDES); 4. run_time_permissions event sets a variable that is used in touch_start whether to rez or not 5. object_rez creates the links of all the tiles to the root prim. what i notice is that the color does not change when the obj is touched the first time. if i touch it the second time, only then the tile color changes. can anyone plz explain why this is happening? thanks!!
  15. hi. i was sailing a boat..when i accidentally went into private land. i got ejected and sent home to social island. i got stuck..and i closed my viewer. when i try to log back in.....it wont let me.....give me the msg i put in the subject line. can anyone tell me why? regards
  16. i will look at ur script.. and thank u..... and i have edited out the names
  17. Hi. there is this user.....he has a script that attaches to the av and pushes. he is also able to send objects without permission. reports have been filed by several ppl but no action has been taken. one of the lindens came as well..but he had run off. kindly let me know how to protect from this user and why is it taking so long for sl to ban him.
  18. thank u arton...will try and let u know if it worked or not..:)
  19. yes it is physical. and if i remove the moving_end code block...the prims rises up..falls and bounces till it settles down. it is at this point that i want the prim to come back to its original position.
  20. So am new and learning lsl. i created a cylinder, did the applyimpulse ... and till this point...it works fine. Now i want to bring the prim back to its original position. code attached below: vector init_pos; applyimpulse() { init_pos=llGetRootPosition(); //llSetStatus(STATUS_PHYSICS, TRUE); llSay(0,"Inside touch start"+(string) init_pos); llSetStatus( STATUS_DIE_AT_EDGE | STATUS_PHYSICS, TRUE); llSetStatus( STATUS_ROTATE_X,TRUE); llSetStatus( STATUS_ROTATE_Y,TRUE); llSetStatus( STATUS_ROTATE_Z,TRUE); llApplyImpulse(<0.,0.,1.>*10,0); } default { state_entry() { llSay(0, "ApplyImpulse!"); } touch_start(integer total_number) { applyimpulse(); llSleep(5.); } moving_end() { llSay(0,"Inside move end"+(string) init_pos); llMoveToTarget(init_pos,1.); //llResetScript(); } } when i insert the moving_end block.....the prim remains in one place ... the impulse does not work either. can anyone help?
  21. am glad am not the only one who cant log in. being a noob..i thought i had messed up my account..:) i hate tuesdays without sl
×
×
  • Create New...