Arska134 Posted October 10, 2012 Share Posted October 10, 2012 Sometimes this code won't pick entity even though it's certainly picked. If GetEntityKey(mpick.entity, "player") then 'do stuff endif Quote Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax Link to comment Share on other sites More sharing options...
ParaToxic Posted October 10, 2012 Share Posted October 10, 2012 What exactly are you trying to pick ??? I can remember that you can't pick the terrian mesh direct or models ,where you have to get the mesh of the body first ( A model is a body, which has a mesh as child, so you have to get the child and read your key from that ) Quote Link to comment Share on other sites More sharing options...
Arska134 Posted October 10, 2012 Author Share Posted October 10, 2012 I am trying to pick other players. When player joins game i do this: SetEntityKey( pp.model, "player", pp.nickname) pp.model is: pp.model = loadmesh("abstract::swat.gmf") So pp.model is mesh and it should be picked? Quote Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax Link to comment Share on other sites More sharing options...
Arska134 Posted October 12, 2012 Author Share Posted October 12, 2012 Is it better to do some kind of "hitboxes" on players to register hits, or is this good way to go? Currently it's not really good because it's not working. Quote Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted October 12, 2012 Share Posted October 12, 2012 Have you set the entity type of the mesh and have you set the collisions so that the raycast type and mesh type result in a registered collision? Also if the character is animated the pick will only work on the original mesh of the character and not the resultant skinning deformation you see. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
Afke Posted October 12, 2012 Share Posted October 12, 2012 It is much better to check hit against some primitives not player mesh . Best practice use capsule . If you want to have check hits against all body parts then you have to make something like ragdoll and bounding box .First make check is there hit on bounding box.Only in the case if there is , then you can check which part of body. One capsule is OK , make it simple. 1 Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted October 13, 2012 Share Posted October 13, 2012 It is much better to check hit against some primitives not player mesh . Best practice use capsule . If you want to have check hits against all body parts then you have to make something like ragdoll and bounding box .First make check is there hit on bounding box.Only in the case if there is , then you can check which part of body. One capsule is OK , make it simple. Entity Picks only work on mesh / surfaces. How are you going to have a capsule mesh that isn't obscuring the model..... If you hide it the pick won't work. I think you've confused this with body collisions. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
flachdrache Posted October 13, 2012 Share Posted October 13, 2012 I guess you are alone with this cause its all about how you lay out the structure ... thats loosely implemented (like all releated to weapons) - however, i just load the mesh of a character and a controller which are not parent or child of the model but the loaded phy object is a child of the model and can be picked ... if that pick occurs i wander up and down the parent/child relations to send a hit message to the model (ENTITY_MODEL) which handles the animations etc. for the character mesh. You most likely want to bind collision spheres to "bone" joints and work with pick.filter (handling every pick like i do is pretty bad). At the end i will track every character entity because i dont need to know that a pick occurred but which and where a character got hit by raytracing. hth Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Afke Posted October 13, 2012 Share Posted October 13, 2012 Entity Picks only work on mesh / surfaces. How are you going to have a capsule mesh that isn't obscuring the model..... If you hide it the pick won't work. I think you've confused this with body collisions. Hmm, I have to think about that , but anyway , raycast with mesh that has 3000 or more polygons is not a good idea, especially when you have a lot of enemies in level. I don't know how LE handles that inside, but I am sure that has to be some work around , perhaps (show and hide capsule or something... ) I have to refresh my mind first . I have to go now , but I will look at this problem when I come back. Quote Link to comment Share on other sites More sharing options...
Rick Posted October 13, 2012 Share Posted October 13, 2012 What I did (in the past) with this is to show the mesh before picking, then hide it right after and it'll never be seen but do it's job. It doesn't take a whole iteration for the show to take hold or anything. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.