TammyTgurl Umaga Posted April 17, 2011 Share Posted April 17, 2011 What I am making a is a hit box ,when a sword is worn it gets the objects name and uuid and sets the other prims llCollisionFilter("sword",(key) uuid,TRUE); If I wear the hit box and place the sword on the ground and walk into it all works fine,but if a AV wears the sword and strikes my hit box it dose not do the collisionfilter.. Any ideas? Is the only way it will log the collision and filter it is with ground objects and not something you wear? Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted April 17, 2011 Share Posted April 17, 2011 You will almost certainly find the problem is with the definition of "strikes my hit box". How do you know when someone hits you? You see it on screen, right. Which means that the other avatar is running an animation which makes them look like they're swinging the sword. Unfortunately for everything else that's just SL playing an animation. The avatar, and the sword, never move as far as the sim, scripts, etc. are concerned. So attachments don't collide, the avatar wearing them might, but not too reliably. Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 17, 2011 Share Posted April 17, 2011 Pete's got it. Animations are client-side. You and other people may see the sword swing, but as far as SL's servers are concerned, it's not moving, so there's nothing to collide with. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted April 17, 2011 Share Posted April 17, 2011 As Peter and Rollig have said, using collision events with a melee weapon like a sword isn't going to work. The usual way to do it, as I understand it, is to fire off llSensor in the same control event you use to swing your sword. If it detects your opponent is standing just in front of you, then you register a hit. Link to comment Share on other sites More sharing options...
Void Singer Posted April 17, 2011 Share Posted April 17, 2011 there's one other problem that hasn't been memtioned... attachments are phantom, that means they don't collide with anything themselves... the avatar can collide, and those collisions will be passed to attachments, but the attachments themselves will never generate collisions. option one was already mentioned, use a sensor to detect other avs in range of a strike. (not hit boxes, but actual avs). option two rez an invisible 'bullet'... for melee that would be right in font of the av and fairly big... doesn't have to actually move and should die of quickly... if thatcollides with someone it sends a message and dies (optionally you can have the sensor read information from the collision as you meant to in the begining) Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted April 18, 2011 Share Posted April 18, 2011 Void Singer wrote: ... attachments are phantom, that means they don't collide with anything themselves... Yeah, I was trying to be gentle when I said "attachments don't collide, the avatar wearing them might, but not too reliably". People - this is annoying! It sounds like the OP has done a lot of good work unfortunately based on the wrong idea of how SL worls. I can't think of an easy salvage solution - it does come down to inter-avatar/attachment chat to decide who hit whom - but I feel I must be wrong in that. Sympathies, if nothing else :-( Link to comment Share on other sites More sharing options...
Void Singer Posted April 18, 2011 Share Posted April 18, 2011 option two salvages the work.... invisible bullets will still generate the necessary collisions Link to comment Share on other sites More sharing options...
Innula Zenovka Posted April 18, 2011 Share Posted April 18, 2011 We used to have high hopes for llCastRay way back when. Since the only place it works at present is, apparently, mesh-enabled sims on Aditi, is it reasonable (and/or correct) to infer that it might hit the main grid if and when mesh does? And if we do get it, might that not provide another option? Link to comment Share on other sites More sharing options...
Void Singer Posted April 18, 2011 Share Posted April 18, 2011 Innula Zenovka wrote: is it reasonable (and/or correct) to infer that it might hit the main grid if and when mesh does? And if we do get it, might that not provide another option? you'd have to ask Kelly about the firs part I think... but it's a hope. the second part is yes... but I've learned it's best not to wait on possible abilities in SL unless those abilities have a release date. PS @Pete: I should've said in my previous reply... I missed your initial statment because I was skimming =X Link to comment Share on other sites More sharing options...
Recommended Posts
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