Jump to content

Launching an object, i.e. a golf ball


poppy796
 Share

You are about to reply to a thread that has been inactive for 375 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Sometimes I have problems with the rather cryptic descriptions of certain LSL functions. Being native dutch I truly don't understand them so I experiment a lot to see what the outcome is. Doing so I'm getting a fairly nice understanding of what everything does. This has resulted in some very good scripts.

I'm a golf player, and like many players I use the Elite Golf system of Crowley Corp. Brilliant! But very (unnecessarily) 'heavy' on prims and scripts and it contains some flaws that makes really serious golf playing less possible. Crowley appears to be banned from SL so I took it upon me to make an entire new golf-hud myself. I'm pretty far, but now I stumble upon something that makes me tear my hair out....ouch!

I've created a ball launcher. Pretty straightforward, it rotates on arrow touch towards the pin, rezzes a ball and lauches it on mouse click. For trial purposes I used a square ball, which makes me see the orientations of my lauched ball and also makes funny bounces when it hits the ground. The square ball works perfectly, even when I stand close to the launcher, ie, hit the ball with my club. So, time to launch a real ball.... making the square into a sphere, same script. And now at lauch it deviates to the right. Not much, but a couple of degrees, which is devastating when you hit a ball over 60 yards. It appears the sphere collides with my avatars bounding box(??? why didn't the square ball???). Solution: Make the ball phantom at launch. That seems to work, however my ball sinks through the ground. Apparently I'm not able to make it solid again in time, which is awkward, because I make it solid (llSetStatus (STATUS_PHYSICS,TRUE) after about 0.5 seconds. My assumption is that Physics overrides Phantom.

Has anybody encountered this problem before and may come up with a possible solution? I've shot a gazilion balls sofar and I'm really desperate.

While we're at it. I've noticed the Elite Golf Ball has a very fancy trailing system. It's not particles, but (flexi?) prims that follow the ball. I've been breaking my head over how to achieve that but I don't have a clue. Does anybody have any ideas on that?

Link to comment
Share on other sites

Are you saying that your launcher rezzes the projectile and then waits for further input from the HUD before launching? If so, I would not do it that way. Rather, I'd just have the launcher work like a basic gun/cannon and rez the physical ball in the appropriate direction and at the target velocity like a bullet. This way, you can add a little extra offset to the initial rez position to ensure the ball is not touching you as you stand over the tee/launcher.

You can replicate the effect of hitting the ball off the launcher by having the launcher use second ball that is linked to it. Simply make that child prim be visible while aiming your shot, and then make it invisible as you fire.

As for the ball's trail effect, take a look at the PSYS_PART_RIBBON_MASK flag for particles. I'd wager that is probably what the original system was using.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 375 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...