collisions rigging
Blitz3D Forums/Blitz3D Beginners Area/collisions rigging
| ||
my problem is when i set up the collision sphere for a character, it starts at his center so i have expand the radius to take care of the collision at his feet, this then stops him miles away from walls i am sooooo lost on this !!! can anybody tell me how to rigg a character for collisions, i mean should i be setting up 3 pivots,..feet,torso and head or is there a way of using the bones in an object to add collision spheres to..i have been looking at findchild() i have tried this and tried to parent a small sphere to it so i can see where the collision needs to take place,but when i try to parent anything to it, it dont work...what am i doing wrong....or anybody know of any tutorials on setting up collision points on a character..... any advice has to be in total noobi..please |
| ||
2 smaller collision spheres |
| ||
rob do you mean 2 createspheres() with there own entity radious() parented to the character one at his feet one at his mid then hide the sphere with alpha. use these for the collisions |
| ||
Personally, I'd use pivots not spheres. That said you might only need to have the collision sphere at the feet anyway. Also you do realise that it doesn't need to be a collision sphere, it can be an elipse. |
| ||
thanks i still need to figure out how to attch collisions points to bones if this is possible at all....as i need the character to hang of legdes ? |
| ||
Check out the findchild command |
| ||
i tried that boot=FindChild(kid,"BaseBone") pivball=LoadMesh("Pivball.b3d") ; attch a visible sphere EntityParent pivball,boot but it comes back as entity does not exist on the boot i have checked the names of the bones over and over again |
| ||
Are you doing a loadanimmesh to get the mesh into blitz? Have you typed the child name in cAsE SenSEtiVe because you should do? |
| ||
yeh to both.... checked the cAsE kid=loadanimmesh("kid.b3d") boot=FindChild(kid,"BaseBone") pivball=LoadMesh("Pivball.b3d") EntityParent pivball,boot kid ok,boot ok, pivball ok as soon as i parent comes back entity boot does not exist. if i dont parent it they i dont get an error pple must have used this to attch weapons n stuff...? |
| ||
exactly, the bone names also get mangled sometimes depending on what modelling program your using, when you export. I have noticed that milkshape3d will cut off at so many characters, and yea, check the case to make sure its correct as well. |
| ||
im using lightwave and terrabits converter which give you a list of all bones in file..but if the bone name was the problem wouldnt that cause an error on findchild() say....error cant find child() if i do a bones=countchildren(kid) text 10,10,bones then this returns 1 but i know there bones in there coz it walks and runs is there anyway i can print out the bone list in blitz to see if the names have changed ? kid=loadanimmesh("kid.b3d") boot=FindChild(kid,"BaseBone") pivball=LoadMesh("Pivball.b3d") EntityParent pivball,boot edit{} im now not getting the error message but the sphere is not parented to the bone, and i didnt change a thing....help |
| ||
If I was you, I would skip using Blitz collisions for ledge hanging, instead store all the valid ledges in an array or some types, I'm shure it will be much easier to find the correct animation and position for your charachter that way. For the collisions I would recommend having all of the spheres attached to pivots, and simply move your character(s) to the correct pivots when needed. I'm very courious about your project, still looking forward to see some gameplay :) |
| ||
hi eBusiness...hoped you would have the answer..i just thought putting collision points on the bones was the best way to do it...but i cant get anything parented to any bone,i would still like to see it done in code coz i cant figure it out...this is guna take some time and i aint getting any younger..and i got loads og gfx to do..perhaps i should just come to the conclusion i aint got it as far as coding goes...or im just havin a bad day |
| ||
FindChild doesn't report an error if the child isn't found. It just returns zero, which is a non-existent entity, as you've found. |
| ||
but the bone is there..its in lightwave and in the list printed by the converter, both with same name...even count children returns 1 when there are loads of bones, has anyone done this with a model converted from lightwave..im totaly lost.....i need a beer ive been at this all day i have put together a test lightwave model with aniamtion and a list of the bones, can anyone find the time, and try and grab a bone from this mesh http://www.btinternet.com/~coloured.pixels/Mek.zip |
| ||
I didn't thought I could do this, but try using GetChild rather than FindChild, they all have an index number, much easier. I have tried but I'm not shure that I can get position stuff right, anyway "bone=GetChild(mek,2) ; an active bone" will make the magic ;) |
| ||
cheers eBusiness thats at least a result...i had faith in u all the time honest..guna be difficult finding the correct bone, wonder why its not finding child (), if i could print out a list of the bones as blitz sees them that would be easier...but the same thing doesnt work on the kid mesh, but this mesh has a has inactive bone kid ---basebone (inactive) ------rest of bone chain (active) when i use countchildren it returns 1 i think an inactive bone cuts the chain..or im totaly loosin it |
| ||
no its not the inactive bone coz the meks bones are all active and countchildren returns 3 when there are way more than 3 in there.. getchild(mek,4)..returns error also countchildren on the kid returns 1 so getchild (kid,2) ..returns entity does not exist...arggghhhh |
| ||
CountChildren is NOT recursive. It finds the parent node. JFK's code shows you how to see how Blitz sees the mesh. http://www.blitzbasic.com/codearcs/codearcs.php?code=615 When you find out what the name is, you'll be able to go back to using FindChild. |
| ||
thanks Sybixsus ..it prints the same names as i have in lightwave and the converter...seems they are not altered in any way. but i still get the error on both the mek and my kid model entity does not exist..for some weird reason. i also ran the mek(zipfile above) mesh thru it and got a bone name but still couldnt parent anything to it |
| ||
sussed it for some reason theres a blank space in front of name, might be a lightwave thing ? " bonename$" Sybixsus its shows the space in that code you supplied..cheers.... something to remember if any one uses lightwave anyone with same prob may find this usefull http://www.btinternet.com/~coloured.pixels/Mek.zip oh and it doesnt have to be an active bone |
| ||
You can set the Y setting of the EntityRadius command independently of the X setting. |
| ||
but all it says in the command description is entityradious entity,radious# so you mean i can do something like entityradious entity, x,y,z ..i know you can do this with entitybox |
| ||
Copied from the online Docs :- EntityRadius entity,x_radius#[,y_radius#] Parameters: entity - entity handle x_radius# - x radius of entity's collision ellipsoid y_radius# (optional) - y radius of entity's collision ellipsoid. If omitted the x_radius# will be used for the y_radius#. Description: Sets the radius of an entity's collision ellipsoid. An entity radius should be set for all entities involved in ellipsoidal collisions, which is all source entities (as collisions are always ellipsoid-to-something), and whatever destination entities are involved in ellipsoid-to-ellipsoid collisions (collision method No.1). |
| ||
cheers ive been looking at the book that came with blitz, time to put it away i think |