Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Advice on Arrows Approach.

Da5id Zsigmond
Registered User
Join date: 26 Jan 2007
Posts: 34
02-08-2010 17:45
Hi there,

Someone asked me if I could do an archery set for them and of course I said I would love to, so now I'm dealing with my first attempt to create an attachment which rezzes and fires an arrow. This set is for a competition shooting at targets so I'm not after a lot of combat features but focusing on the realism of the animation and the script. For example the arrow trajectory should be affected by the drawback force, the distance, and the wind. and I want to get the arrows to stay in the target until cleared so probably can't use a temp rez. I can see that de-rezzing the arrow with a timer might be a good idea, or on collision with the ground, to avoid cluttering up an areas prim count with lost arrows that might not hear a clear command. :)

Right now just wondering whether the best approach is to use an impulse or a force to move the arrow? My guess is impulse if I want a curved trajectory. Also pondering how to get the avatar animation to provide a bend at the waist so if the archer aims at say 45 degrees up, the avatar bends backwards. Is it possible to play only part of an animation or would I have to break the motion up into successive animations each one for example, another 10 degrees up?

So any general hints about the basic approach and/or pitfalls to watch out for, specifically in regard to moving the arrow but any other comments as well.would be very helpful and much appreciated. I'm a fairly experienced builder and scripter but as I say have not tried a lot of things with physics before. Also wondering if the approach of sitting on a target (shooting platform) and having that attach the bow is workable?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-09-2010 06:45
I'd make it only work in mouselook, maybe with a slow meter tied to right click for force, you can get the initial direction from the camera, and set the force on in the rez velocity, making sure the arrow is set to physical before loading in the rezzor (bow), set it with a long timer to die, STATUS_DIE_AT_EDGE, and a listen only to owner to clear, as well as a collision sensor to turn of physics (stops on contact).

you can add physics weight to the arrow by using multiple prims that are located inside of each other, an affect it's sensitivity to wind by playing with the material type (must be set per prim) and using invisible flat surfaces (probably a hollow item that surrounds it).

that way you don't need any of the apply/set force settings.

you may need to rez it a little further out with an invisible front and tail to get accurate impact sticking.

llTakeControls
llRezAtRoot
llGetPermissions (PERMISSION_TRACK_CAMERA I think)

llSetStatus
collision_start
llListen
llSetTimerEvent

and various vector offsets and multiplication by rotations, and prim build settings

I think that covers most of it.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -