the cahracter module isn't done yet?

maroxe

01-09-2008 21:27:05

Hi
i just started to implement my player class, that inherit from Character class. After i've finished my class, i was really shoked: my player dosn't move 'cause the Character Class isn't implemented yet :shock:
so how can i simulate such a class?

betajaen

01-09-2008 21:55:27

How can you not know? There has been at least 10 different posts about it recently.

Either you can implement your own, migrate the 0.9 code over, or go and use 0.9

maroxe

01-09-2008 22:04:15

hmm, sounds reaaly bad.
by the way, i will try ti find an issue, thanks betajean.

betajaen

01-09-2008 22:14:19

There have been a few mosts recently describing how to create a character from using a rigid actor with NX_BF_FROZEN flags. You should start with that.


Also: Can you lower the font-size of your signature, it's really really distracting.

maroxe

01-09-2008 22:21:19

Also: Can you lower the font-size of your signature, it's really really distracting.is this convieninet for you?

betajaen

01-09-2008 22:33:26

It's good. :)

maroxe

01-09-2008 22:40:52

what about maiking it a kinematic actor?

betajaen

01-09-2008 22:43:40

Very very complicated to do. You have to implement auto-stepping, character hovering, custom collision and response code and so forth.

It's easier with a dynamic actor.

novaumas

02-09-2008 03:26:25

It's easier with a dynamic actor

I'd have to disagree on this one.

Maybe it's easier to implement the basic movement functionality and collision response; but beyond that, having the character move in the exact manner you want, may prove very frustrating.

I'd go the suggested route of migrating the 0.9 code, the source is available, so it shouldn't be that complicated.

mcaden

02-09-2008 09:22:06

I created my own character system. I'm having some problems with it, but it's coming along.

I am however having a few problems, quote: "having the character move in the exact manner you want," as novaumas mentioned...

One thing though, for some reason my brain decided that kinematic and dynamic were the same...what's the difference, both conceptually and in code? I only know the difference between dynamic and static.

Right now my movement code is very basic.


void Character::translate( Real rtrans )
{
Vector3 trans = mBody->getGlobalOrientationAsOgreQuaternion() * Vector3(0, 0, rtrans);
mBody->addForce(trans, NX_IMPULSE, true);
}

void Character::translateHorz( Real hTrans)
{
Vector3 trans = mBody->getGlobalOrientationAsOgreQuaternion() * Ogre::Vector3(hTrans, 0, 0);
mBody->addForce(trans, NX_IMPULSE, true);
}

void Character::turn(Vector3 direction)
{
mBody->setAngularVelocity( direction/2 );
}


Which works, I just run into big issues going down a slope. I think this is due to the fact that I'm locking ROT_Z and ROT_X, so that on a downward slope I'm not getting full contact, just the edge of the collision cube so it's always trying to fall down the hill and turn to the nearest edge. So I think I'm going to have to unfreeze ROT_X and put in some sort of angle constraint? I'm also having issues with falling...gravity messing up on dynamic actors isn't that big a deal to me...I won't have much falling of objects or jumping of enemies...but it does become a problem when I want my character to be able to jump.

maroxe

03-09-2008 15:28:41

i think i will return back to the previous version of nxogre, 'cause there arelotof functionnalities not implmented yet(characters, D6Joint ...)
is the 0.9 version complete?

betajaen

03-09-2008 15:55:14

Since 1.0 is based upon 0.9. What do you think?

mcaden

03-09-2008 16:07:48

Would've thought my question would've been answered pretty quick. It must've been missed.

What's the difference between dynamic and kinematic?

betajaen

03-09-2008 16:16:29

There are a bit like if static and dynamic actors fell in love, ran away together, and had a baby. It doesn't respond to forces, gravity, collisions, etc. but can be moved around.

It's in the SDK documentation CHM file.

mcaden

03-09-2008 16:32:59

Ah...

Well I want my character to respond to gravic, forces, and it needs collision callbacks for attacking enemies...so yeah, dynamic.

I do have a question though.

Right now I can tell if I collide with an actor...but is there a way to get the class that contains that actor? Right now I can tell if I hit an enemy, I get hurt...but what about checking to see if the enemy is attacking, or if it's just damage from touching? If my player is attacking, how do I know which enemy I hit so that I can call the function that affects the enemy's HP?

Do I simply have to get the enemy's name and iterate through a list of every enemy? Or can I set the collision to instead report the enemy class, rather than only the actor? Something along the lines of...


void Player::OnStartTouch( Enemy* theEnemyITouched, ContactStream* cStream )
{
if( playerState == PS_ATTACKING )
{
theEnemyITouched.damageHP( currentAttack.damage );
}
else if( theEnemyITouched.state == ES_ATTACKING )
{
damageHP( theEnemyITouched.currentAttack.damage );
}
}

maroxe

06-09-2008 13:37:09

ad what about joints? i cann't find D6Joint for example