Jump to content

Lash Carver

Resident
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Lash Carver

  1. ok after looking into all of this, I suddonly realized Rolig's example is perfect except for one thing. If you rotate the child prim, it does not keep the rotation given after being rezzed. How can I incorperate the child's rotation into the mix so it can be rotated in any direction relitive to the parent prim?
  2. Thank you all so much for the information! I will work with it all a bit more and see if I can get it working. You've really helped me alot!
  3. Yes your example works perfectly and that's exactly what I am needing (although your rezzer was no mod so I couldn't see that part). For some reason mine does not work like that... Here's what I have... //when position & rotation are recorded list x=llGetPrimitiveParams([PRIM_POSITION,PRIM_ROTATION]);Pos=llList2Vector(x,0);MyRot=llList2Rot(x,1);MyOffset=<Pos.x-ParentPos.x,Pos.y-ParentPos.y,Pos.z-ParentPos.z>;//when rezzedlist x=llGetObjectDetails(ParentKey,[OBJECT_ROT]);ParentRot=llList2Rot(x,0);llSetRegionPos(llGetPos()+MyOffset*ParentRot);llSetRot(ParentRot); As-is, it rezzes the child prim sideways everytime instead of the rotation I had it when I recorded.
  4. ugh sorry hard to explain, thats why I tried to use the symbols for you. It's like this... the rezzed prim stays in the same position based on whatever the rezzer's rotation is.
  5. But there has to be a calculation using the old rotation for it to come out right. If I match rotations... the child starts at 90 degrees. I rez it matching the rotation of the parent and now the child rezzes at 0 or whatever the parent is, without even rotating anything. see what I mean? Thank you for the continued help though!
  6. yep quick & tiny sensor scan to get parent/rezzer. But as I said the rezzed objects are rezzed at the wrong rotations right now. I need them to be rotated according to how they once were mixed with their new rotation. What am I doing wrong?
  7. In my build, the rezzed objects can go beyond the 10m by memorizing their own locations and rotations and when rezzed they jump into position. So how do I do this without using a rezzed pre-determined location? Right now I'm trying something like this... (but failing) llSetRegionPos(llGetPos()+MyOffset*ParentRot); Obviously all pieces are rezzed exactly ontop of the rezzer then moved into position.
  8. Can somebody please help? I'm basically making a rezzer but I want to be able to rotate it and have it rez stuff "forward" according to the rotation of the rezzer itself. I have the position part worked out, but the rotation is always wrong! I don't know how to do this mathmatically! I'm rezzing the objects using the rezzer's current rotation but I'm guessing I then need to add / subtract / multiply the prim's origional rotation? so if I record positions and rotations like this... v = then rotate and rez, it should look like this... < || or this... = ^ or this... || > does that make since?
  9. I already scripted the part where it gets the person's size (width and height being most important). That part I can figure out on a trial basis. I just don't understand how to calculate an offset based on the person's rotation. can you give me a vague idea of the calculation I would need?
  10. Yes I know that part. Like I mentioned though, I don't want it inside of me. I was hoping to calculate (about) where my right shoulder would be. That is the part I need help with.
  11. yes that is what I want. I just need the calculation for jumping it into position with the correct rotation using SLPPF. Is that something you can help with?
  12. Thanks for the reply but I'm talking about moving to the shoulder WITHOUT being attached. Sorry I didn't specifically say that. I need to get the avatar's position and rotation, then some sort of calculation would tell me where his right side would be...etc
  13. I'm trying to make a script that will move a prim to an avatar's shoulder (or somewhat in the area of...) but I'm not sure how to do this when you throw in rotations. I need to jump the prim to a location based on the AV's rotation, to always land near the right shoulder. help? Thanks in advance!
  14. So right now I just have a vector set for the current local position of the child prim. Then I was hoping to calculate it from there using the scale (and yes I mean size). Take a look at this terrible example I threw together. So when the box is enlarged, the line is too so the actual resizing is correct (from the other script) but when I tell the "line" to go from one position to the other using local position, where the line NEEDS to be is now moved. The 3rd colomn here is larger so the line needs to move along the X AND Z axis. But the 4th Column the box is only wider so it only needs to move along the X axis... So what I'm needing is a way to set a static local position, then multiply (according to the new size) so the "line" goes into the correct positon. And no, the child prim is not moving on any one axis from the root, it is off center on all 3 axis.
  15. I have another script that handles the changing of scale. It automatically resizes all the prims in the linkset and relocates them. I just need to be able to toggle a linked prim to two locations, regardless of size. Right now if I set local position, it's wrong once it changes scale, it's jumping to the wrong place. Hope I'm explaining myself correctly!
  16. list p=llGetLinkPrimitiveParams(1,[PRIM_SIZE]); float Scale=(llVecMag(llList2Vector(p,0))); I tried doing that for the scale, then multiplying the position by the scale but again it doesn't work. Then I got to thinking, this also wouldn't work if you adjust the scale only on one axis anyways. Then I tried this... list p=llGetLinkPrimitiveParams(1,[PRIM_SIZE]);vector Scale=llList2Vector(p,0);llSetLinkPrimitiveParamsFast(7,[PRIM_POS_LOCAL,<obj.x*Scale.x,obj.y*Scale.y,obj.z*Scale.z>]); But again no luck. Ugh I just can't get it!
  17. Thank you Dora for trying to help! I think you gave me good info but it's everything except what I needed. You gave me calculations for rotation and position but the position is only going to change according to scale and the scale isn't in these calculations. So to be clear, the root prim will never change positions, only size. ...and I have the resizing part, I just need to calculate the link position based on the always changing prim sizes.
  18. Can anybody tell me how to calculate a change in position and have it be the same based on the scale/size of the root prim? So if you resize the object, and the link moves, it still moves to the same position if the linkset is tiny or if it's huge. I am guessing it's something like... ? <position.x*scale.x , position.y*scale.y , position.z*scale.z> Any help would be great!
  19. Thanks to everybody who has tried to help, especially Aspire Rang. I am not wanting the dart to curve or follow the object, I need to be able to have it go straight and meet the object when it gets there. Aspire brought up a very good point. I seem to have calulated where it will be when I throw the dart, hence why it's always late. I can see that now. I will take a look at your script and try it out as well. Thank you again! (oh and I'm not looking to hit it 100% of the time. I understand lag and such. I just want best-case scenario) EDIT: I tried your script, but for my dart and overall setup, it shoots upward for some reason. I made some small changes and now it shoots right. It's very close, even hitting on the moving target once in a while which is great. But I noticed when the target sits still, it misses! Any ideas?
  20. Contact Yamil Dagger in-world, he does this kind of stuff and may be able to help you.
  21. I have another annoying issue I can't solve so I thought I'd ask here again... I have two potential ways but both seem to arrive to the target location late. So basically I have a stationary object, when I tell it GoForIt() I want it to make an object "dart" and send it at a steady speed towards the detected (and moving) object in the hopes that they arrive at the same position and collide. The 1st solution has <0,0,30> which is the speed of the object once it starts moving. Right now the stationary object always arrives late and I cannot figure out why. I want the other object to have verying speeds for each pass, but once the stationary object always goes the same speed once moving. vector Interception( vector cPos, vector tPos, vector cVel, vector tVel) { vector rPos = tPos - cPos; float tVxtV = tVel * tVel; float b = rPos * tVel; float a = cVel * cVel - tVxtV; return tPos + ( b + llSqrt( b*b + a * (rPos*rPos) ) ) / a * tVel; } rotation grtpa(vector axis, vector pos, vector target) { target.z = pos.z; return llRotBetween(axis, target - pos); }GoForIt() { //under another part of the script, estimate=llDetectedVel(0); llDetectedVel(i) vector MyPos=llGetPos(); m = llGetObjectDetails(TARGET,[OBJECT_POS]); LastPos=llList2Vector(d,1); //1st way I tried rotation m=grtpa(<0,0,1>, MyPos, Interception(MyPos, LastPos, <0,0,30>, estimate)); llRezObject("dart",llGetPos()+<-0.1,0,0.6>*llGetRot(),<0,0,velocity>*m,m,0); //---------------------------------- //2nd way I tried rotation m=grtpa(<0,0,1>, llGetPos(), LastPos+estimate); llRezObject("Bullet",llGetPos()+<-0.1,0,0.6>*llGetRot(),<0,0,velocity>*m,m,0); } Any ideas of what to fix or options to replace the whole thing would be great. ----------so in sort...---------- 3 objects, objA and objB, and dart objA is sitting still and gets the location and velocity of objB objA rezzes "dart" and sends it at the correct rotation to hit objB where it WILL be. predicting it's location.
  22. I am doing some SL combat using the firestorm viewer and I noticed randomly when I die, I will come back with a fish-eye view! I always have to press ctrl + 9 to get rid of it. How can I make it stop doing that? I'm guessing maybe it has something to do with the fact that I die while in mouselook?
  23. vector spreadVector = <(0-(rez_spread/2)) + llFrand(rez_spread),(0-(rez_spread/2)) + llFrand(rez_spread),(0-(rez_spread/2)) + llFrand(rez_spread)>; rotation rotBetween=llRotBetween(<0.01,0.01,0.01>,<0.01,0.01,0.01>+(DEG_TO_RAD*accuracy*(spreadVector*llGetCameraRot()))); rotation modRot = llGetCameraRot() / <rotBetween.x*llPow(-1,llRound(llFrand(1))),rotBetween.y*llPow(-1,llRound(llFrand(1))),rotBetween.z*llPow(-1,llRound(llFrand(1))),rotBetween.s*llPow(-1,llRound(llFrand(1)))>; llRezObject(bullet,llGetCameraPos() + (rez_offset + spreadVector)*llGetCameraRot(), llRot2Fwd(modRot)*velocity, modRot,100); My Gun script does ALOT of calculations and I was just wondering if anybody can slim it down at all, possibly making it more efficiant for secondlife to read. Any help would be great as always!
  24. llRezObject(Object,llGetPos()+<0.7,0,0>*llGetRot(),<0,0,0>,(llEuler2Rot(<0,1,0>*DEG_TO_RAD)*llGetRot()),0); I'm trying to rez an object infront of me from a HUD but when I spin in a circle and keep rezzing, they aren't evenly around me. Like my offset of <0.7,0,0> is less on one side but more on the other. What is wrong with my calulation? I want it to always rez 7m infront of me nomatter what way I face.
×
×
  • Create New...