Jump to content

Sowy Atlas

Resident
  • Posts

    8
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. this orange line seemed to have done the trick keeps the particles in the correct direction atleast but now its very hard to control, i think its because this code is in the touchevent, therefore its constantly setting the z axis back to the start but i dont see when else to do it, tried putting it in state entry and when the timer ends etc llSetRot(llEuler2Rot(<0,0,1>)); rotation lRotation = llRotBetween( llGetPos(), gGrabVec ); llRotLookAt(lRotation, 3.0, 1.0 ); i thought that is the angle between em, but if i calc and use llrotlookat, the particles still behind the ball instead of infront rotation lRotation = llRotBetween( <0,0,pos.z>, gGrabVec );
  2. i have just opened my eyes and realised i dont need to change the angle since im rotating the prim so i dont need to mess with the particle settings atall at the moment im just using llLookAt( llGetPos() + gGrabVec, 3.0, 1.0 ); so its almost perfect... but as you said i need it in the opposite direction, i guess thats what i need llRotBetween for but ive been trying for hours and i cant get it work or compile for that matter im probally not doing it right to begin with but heres what im trying rotation lRotation = llRotBetween( llGetPos(), gGrabVec ); llLookAt(lRotation, 3.0, 1.0 ); function call mismatches type or number of arguments with that last llLookAt line
  3. heres the full code so i applied a smaller force not sure what you meant by including a limit but i made sure it doesnt go over 10 otherwise it flies off sometimes the particles wont emit in different directions in my script because its not enabled when the balls physically moving, so if i could get the ANGLE part to work should look great you mention particles always flow out of the prims +Z end , so when the objects touched... the object Zs position can be rotated to face the opposite direction of the lldetectedgrab before the particles are turned on???? im guessing its probally impossible to accomplish what i want to achieve o well back to the drawing board the code could probally be better, for instance where i comment "// WHAT IF BALL ALREADY STOPPED ROLLING B4 THE TIMER ENDED ?" maybe if i had a loop like on this page to check if its stopped moving http://wiki.secondlife.com/wiki/LlGetVel but waiting a few seconds before a person can touch again wont kill anybody what did i realy wanna ask hmmm if (llDetectedName(0) == "Golf Hole" && llVecMag(llGetVel()) < .001) ^ whats a good number to represent a fastball? i tried to check llgetvel of a moving ball to findout myself but it was always blank 000000 also i dunno what to do abt this line because at the moment if a persons power level goes above 10 the floating text might be adjusted correctly but i havent sorted the impulse if ((integer)(10*gMag) > 10) { llApplyImpulse(-0.5*gGrabVec, FALSE); // HOW DO I SET THIS TO MATCH
  4. thanks, i got a bunch of questions now when the x,y,z size of the ball is all 0.500, the ball works perfect, but when i make it smaller it goes insane when used, why is that what can i do about it... i need it to be a tiny golf ball. i also added a particle effect to show the trajectory while your holding the mousedown, once again works fine, PSYS_PART_MAX_AGE seems to represent the size so i set it to (float) gMag that way if i increase/decrease the power level - the size of the particle LINE/BEAM should do the same only problem i got now is the beam aint facing the right ANGLE so i tried to do something like this PSYS_SRC_ANGLE_BEGIN, (float) -5*gGrabVec * PI, PSYS_SRC_ANGLE_END, (float) -5*gGrabVec * PI that didnt compile but ive tried all sorts like llVecMag(gGrabVec) i dont understand it im just trying to make it work the way i want by fiddling with it long story short i want the particle effect angle to change to the correct angle when i move my mouse position. also when you collide with a object is it possible to get the name of the prim if its apart of a linkset, i think i got no choice but to leave the golf hole unlinked from the course. last question at the moment everytime the ball collides with the hole we consider it potted, thats not realy how the game should work tho? thats not how flash web games work if you smash the ball super hard it usually rolls over the hole hits the back wall and rebounds elsewhere what im trying to say is how do i determine the velocity of the ball, if below a certain number then i guess its rolling slowly so yes we can consider it potted otherwise it was probally hit to hard and shouldnt be counted also is it impossible to change a persons camera view unless they sitting? cant it be done by touch.. ive tried but no success
  5. Sowy Atlas

    ball

    im trying to make a golfball or snookerball this is the only code i could find which comes close to what i wanna do. using lldetectedgrab i want to adjust the angle/power display the power level in floating text, either as bars ||||| or numbers 1-10 then shoot off based on the infomation above when you release the mouse button please help, i think it should be simple yet im incapable it would probally be easier if the power level was based on the amount of time you hold your mouse down the same way basketballs tend to work, but i dont wanna do it that way default { touch(integer total_number) { vector grabVec = llDetectedGrab(0); integer incVal = llRound(grabVec.x * 10); vector curEul = llRot2Euler(llGetLocalRot()) * RAD_TO_DEG; // Increment or dectrement the z axis value vector newEul = curEul + <0, 0, incVal>; // Convert it to an integer for display/use integer curVal = llRound(newEul.z); if (curVal < 0) { curVal = 0; newEul.z = 0; } if (curVal >= 360) { curVal = 360; newEul.z = 359.9; } llSetText((string)curVal,<0,1,0>,1); } }
×
×
  • Create New...