basic shooter questions

Romep

11-02-2008 11:28:19

hello,

i got some basic questions:

1. i got a player character which should move when i hit a key. but i think i cant simply add a force to that player cause he might fall down or something. so i think i have to add this movement to the scenenode or so (like i would do it only using ogre). how is the best way to do that?

2. shooting. i a player hits the shoot key, i create a new actor for the bullet. but how do i know when the bullet hits something so i can lower the health of the player who was hit by the bullet?

3. hitbox. i created a new body and if a bullet hits this body, i want to know wether it was the head or feet or so. so i think i have to ->addShape all the body parts of the player and the collision detection from the second question tells me which shape was hit?
someone told me the keyword ragdoll for this, but i cant get ebol's ragdoll code to work.

betajaen

11-02-2008 12:04:03

1. No moving the node would have no real effect, once you've moved the node, NxOgre will go and put it back in the next frame. You need to move the Actor not the node.

2. You attach a collision callback to it.

3. Again you can use a rag doll, or if your really cheap you could just guess if it's foot or head via the comparing the Y position of the bullet and the Y position of the Actor.

Romep

11-02-2008 15:24:24

I still dont know how to get ebol's ragdoll code to work -.-


NxOgre::PhysXDriver::PhysXDriver#142T0 F0

NxOgre (NxOgre 0.9-38) Started, working with:

- PhysX => 2.7.3
- Ogre => 1.4.5 'Eihort'
- Platform => Windows



NxOgre::Error::reportError#78T0 F0

PhysX Error (NXE_INVALID_PARAMETER) 'Supplied NxActorDesc is not valid. createActor returns NULL.' in line 743 of

g:\scm\release\PhysX_2.7.3\novodex\SDKs\Physics\src\NpScene.cpp



NxOgre::Actor::_createActor#321T0 F0

Creation of Actor with the identifier 'm1BAPelvis' failed.





1. I now use Body::setGlobalPosition for moving my character. but he always tumbles if he jumps from a house or so. this might be the right physics but as long he is alive i want him to stand all the time. so i only want him to fall the ground but not tumble. how can i do that?

2. ok i just read the forums for this. create collision callback, in that i can check which actorgroup the actors are in and do whatever is want to do. but with a ragdoll the characters will have more than one shape. and so i dont know wether the character was hit in the head or feet or so. so is there a function that tells me which shape was hit? or did i miss anything?

3. i really don't like the cheap way :) so ragdoll will be the right way.

Dusk

11-02-2008 17:10:16



1. I now use Body::setGlobalPosition for moving my character. but he always tumbles if he jumps from a house or so. this might be the right physics but as long he is alive i want him to stand all the time. so i only want him to fall the ground but not tumble. how can i do that?



Have you tried the character control system? AFAIK its main purpose is handling this kind of problems...

Romep

11-02-2008 18:36:57

is there any help or tutorial about character control system out there?!