Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

gun shell drop and player speed?

CaptnPower Codesmith
Second Life Resident
Join date: 9 Nov 2004
Posts: 58
01-28-2005 18:36
ok im amking a big gun and there is 2 thing i am missing

1-i need to make it drop an empty shell but the gun is big so i cant make it rez same plase as the bullet
now i cheked llwiki and it sais llGetpos() put in a child object will return that bojects pos
but i put it in a linked obj not the main object and it returns my avatar position
so id like any help i could get on that

2-my bullet needs to fly kinda slow like a grenade but i cant seam to find a way to get he avatar general speed so i can add it to the bullet speed
and this makes it so i have to be still to shoot my gun

can any one help me?
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
01-28-2005 19:21
hi , LLGetPos () returns the center of an object. To find the position of a primitive in a link set, you use llGetLocalPos (). Witch ovusly returns the pos of an object in a link set, but that's relative to the object's center. To figure out where that position is in sim space your going to need to use Vector Math.

I am guessing you wanted to get the position of the object in the link set, so you wouldn't have to use Vector Math to calculate the rez position. If so, then I am sorry it doesn't work that way. Back to vector math.

You could just skip getting the local pos, and just chose a angle and distance, but the you will still have to use vector math.
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
01-29-2005 01:12
Actually, llGetPos() doesn't work very well for guns or any other attachments. Because when you call llGetPos() from attachments, the position returned is the avatar's... typically the head.

So the best option I've found is to calculate the offset by using a combination of llGetPos() and llRot2Fwd().
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-29-2005 07:02
llGetVel() will give you a global vector for velocity.

rezzing shell casings can lag the sim and use up all the prims in a plot (can't rez anymore bullets).
_____________________
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
Timeless Prototype
Humble
Join date: 14 Aug 2004
Posts: 216
01-29-2005 09:35
From: Strife Onizuka
rezzing shell casings can lag the sim and use up all the prims in a plot (can't rez anymore bullets).


... unless your bullets and shells are Temp on Rez. Temp on Rez prims take up zero prim space and are deleted anywhere from 60 to 120 seconds after rezzing. But yes, if not tidied up by bullet/casing scripts within seconds the sim will become laggy very fast.
_____________________
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
01-29-2005 10:05
From: DoteDote Edison
Actually, llGetPos() doesn't work very well for guns or any other attachments. Because when you call llGetPos() from attachments, the position returned is the avatar's... typically the head.

So the best option I've found is to calculate the offset by using a combination of llGetPos() and llRot2Fwd().


Attachments calling llGetPos() will get the center of the avatar. Which is roughly around umm.. your groin.

I think attachments don't actually "exist" in SL space. They're just sort of attached to your avatar, somewhere. It's only on your client that it gets rendered into the world.
_____________________
--
~If you lived here, you would be home by now~
CaptnPower Codesmith
Second Life Resident
Join date: 9 Nov 2004
Posts: 58
01-30-2005 09:14
well 1 its a big missile launcher type gun so it has a clip of 5 bullets and then a wait time so it wont rez 1000 bullets and casing at once

2 thx for your help il try a few of those things