|
Ferret Bjornson
Escape! Designer
Join date: 29 Oct 2005
Posts: 97
|
04-22-2006 12:56
I scripted a weapon (*waits for the nasty anti-griefer comments to stop*).
It fires a round every 2 seconds.
It does no damage.
It counts points.
I have the push command fine. I have tried it in 50 variations. I have two dilemmas.
1) It always pushes in the same direction. I can't seem to figure out how to get it to always push AWAY from the object hitting it...
llPushObject(llDetectedKey(0), impulse_vec, impulse_angle_vec, FALSE); - Tried zero vectors - tried calculating the directional velocity of the object
Just doesn't work.
2) I got it to get its own mass and the mass of what it hits. I have a flat rate impulse vector and i multiple by the difference. Pushes, for the most part, the same. Then i shoot a .5m physics applied default sphere... 'your object went offworld...' It just doesn't make sense.
I'm not griefing or making weapons for Jesse. I'm trying to make a game with some realism. You get hit you get knocked back a meter. But I can't get it to work.
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
04-22-2006 15:03
Why not set the local Flag? That will push the target in the direction the bullet is pointed.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Ferret Bjornson
Escape! Designer
Join date: 29 Oct 2005
Posts: 97
|
04-22-2006 17:41
Did that too. Keeps going off in a different direction.
i think i am messing up the vectors no matter how i apply them.
|
|
Ferret Bjornson
Escape! Designer
Join date: 29 Oct 2005
Posts: 97
|
04-22-2006 17:49
and the local flag pushes the target in the direction relating to the target, not the bullet.
|
|
SteveR Whiplash
teh Monkeh
Join date: 24 Sep 2004
Posts: 173
|
04-22-2006 20:04
Try this:
llPushObject(avkey, llVecNorm(llGetVel()) * force, ZERO_VECTOR, FALSE);
I did a quick and dirty test by throwing a cube at myself. Seems to work.
|