Getting a character to work, what is needed?

Hi,

I would like to get a list of what needs to be done to get a character working.

So a cube must be parented to a character for it to function in the engine? With all the properties on the cube or does the character need them?

Thanks.

it all depends on what the character should do…

Well it is a walking character, arms and legs, so it animates. And it attacks a first person player by hitting it to push it away. That is what I’m trying to do. I have an idea of collision brick with player, then the animation is linked to that collision with it so it gives that illusion of pushing it away.

When I looked in the Game development book, Momo the monkey doesn’t have a box. May be it doesn’t require one.

I tried that, it does move to the player and animate using the bricks I used. How ever it does sink into the deck.

I switched the collision setting on the object, it isn’t quite on the deck, the legs are not covered by it.

Everyone’s characters are going to be different depending on the range of what happens. You need to think very specifically about what the limitations are of the character.

My recommendation about how to build a character:

A rig has a character model as its child.

The rig is the child of a cube, large enough to encompass the rig, and has dynamic physics turned on with the collision bounds of a cube.

The rig has no collision
The model of the character has no collision

If you want an attack that pushes an enemy back in some direction, you write:

If key_sensor.positive:
start = character.worldPosition
end = character.worldPosition + Vector([0,1,0]) * character.worldOrientation #this draws a line from the characters y, assuming you use the y+ axis as forward

ray = character.raycast(end,start,0,‘Enemy’,0,1,0)

if ray[0]: #if there is a hit object by the ray, i.e. it has hit something with the property ‘enemy’
ray[0].setLinearVelocity([0,-16,0],1) #push the enemy back along its -y axis

I have a function that does this in my game’s script as well

Can I not use the bricks to get the attack collision to work with the player?

I parented the cube to the Armature, so the cube moves the whole object, and armature together. The character remains for a short time, but then vanished using either of the Dynamic, rigid body, or even static. The collision setting freezes the character there.

I slowed the steering down. But it moves too quickly bouncing and then disappears, or the above as stated.

So on its own as default, it just goes into the deck or with a cube it is a few units off the deck and just skidadles along to infinity in the 3D space.:eek:

Since the deck is a circular arena, I don’t use a navigation mesh, I doubt it would be needed.

Hmm, by selecting the collision on the Armature that has solved it from disappearing. As well, by making sure the box collision in a correct position.

Well these are the bricks on the character. So I tried a collision with the player as player then a texture. Problem with the model is the FP can go right through it. So it isn’t solid.

And I would prefer to use the bricks for collision enemy attack both ways. Including knifing the enemy.

Attachments




What do you mean with “FP”?

The player, First person view player is what I mean by FP.

If I pan the camera around to face back, then the FP appears to not go through the enemy character.

I changed the collision to the armature that doesn’t make it attack the FP which I textured using a pink colour and named it player. So once the character collides with the player it should attack using its arm.

I would prefer to use the bricks for all of this. There may be some python code needed for once the player has attacked the character to change an event with it. I do have a block of code from a different project.

I parented the cube to the Armature, so the cube moves the whole object, and armature together. The character remains for a short time, but then vanished using either of the Dynamic, rigid body, or even static. The collision setting freezes the character there.

so armature parented to the cube, in this case you didnt read 1000h’s post? is clearly says:

The rig has no collision - this means armature
The model of the character has no collision - the character mesh

So the cube contains all data, and has dynamic or character setup with collision bounds to box.

This is not only for the player, but you should do this with every character/enemy/animal/ etc…
Then you see it will collide.

So once the character collides with the player it should attack using its arm.

collision sensor property player - and - action actuator.
this will play the attack animation.
And from here on you can either remove all and use python, or use the state system.

instead of action actuator you set state 2.
here you can follow player, or check with a ray if player is close.
if player is close either play attack animation or switch state and then play animation and handle the hp stuff.

One file I have there is no cube use, the cube use with the character doesn’t get it move forward.

Without using a cube the character moves towards the player but doesn’t attack, I mentioned that in the previous post.

The rig is the parent, as the character moves when moving the skeleton.

https://www.sendspace.com/file/xcm3at

The rig has no collision - this means armature
The model of the character has no collision - the character mesh

As i said you didnt read. or tried or whatever you done at that point.

i dont know what you mean by attack but i got your blend to go to player and while hitting it will die, but if you remove that or change to heal property etc, it should play the animation aswell before dieing. it uses the cube.

first of all you need to set the Center of the origin from the box (the orange dot)
box dynamic, check collision set it to box. disable/remove delay sensor, enemy does not teleport anymore. Set tracking axis to y increase velocity. armature, remove always. shift select cube connect it to the collision sensor, put it on true pulse.

another thing, hit armature clear parent. move it back to location and parent it again.
you should also clear the scale, rotation and position for your objects and rearrange them.
else the tracking is kinda off.

everything should work, just follow the steps.

Unfortunately, I’m not following with this.

I have done what I did to try and get the events to work. It would help if there had been video examples, or the Game development book had the know how, sadly nothing on this.

I want the character to hit the enemy pushing the player backwards a little, not kill certainly not right away.

I want the player to be able to knife the character while trying to avoid being hit. Once the character has been hit, an event using python code will load and then the player must push the character into the core.

https://www.sendspace.com/file/4aycyc

I still haven’t got anything working.

Try to think…, then find a solution to your problem, then try to make/fix it.

so what would i do in your case:

I want the character to hit the enemy pushing the player backwards

so you google/search for applying forces.

I want the player to be able to knife the character while trying to avoid being hit

so you give the player a movement option and a knive action.

kniving, adding an animation, while animation is running cast a ray when ray hit substract health or whatever.

#edit
you can also make a cube around the knive, make it sensor type, on collission substract/do whatever you like.

Once the character has been hit, an event using python code will load and then the player must push the character into the core.

so you need directional forces, look at applyForce()

you know the worst part? 1000h already made a script/example for you!

now its a matter of how would you add it. you got the setup ready if you followed my steps (object chasing the character player die on hit) so instead of dieing apply force etc.

I don’t get any of it. I’ll just have to forget it.

Thanks.

I don’t get any of it. I’ll just have to forget it.

That easy? ok ill forget you aswell.

Why the hell you give an answer like that twice?

you want something we try to send you in the right direction, if you dont wanna learn or even try something.

like how can i push a character back, i would say check 1000h his post. (tough i would use applyForce instead of linearVelocity)
how can i knive with a character, i would say check my post.
how can i push character into the middle, i would say get the mid position cast ray to player, applyForces in opposite direction.

so what do you not get/understand? Google realy got neat examples.
like: https://www.google.nl/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=blender+game+push+object+

why dont you make a demo with 2 cubes, try something then show us and ask what you have done wrong or how to do it better.
And dont forget you dont learn blender in a year if everyone made the stuff for you.

Anyway good luck with your projects.

I don’t have any projects, phase 4 was this. Phase 3, 1 were cancelled due to no examples anywhere, I did have somebody help me but that user decided not to continue, fair enough, I don’t blame him. I had some other ideas, they are scrapped due to these recurring problems no books, video clips, I can see why the engine is good, but it is poor due to this reason alone. I know it isn’t really the fault of anyone here. The game engine with blender just isn’t important or focused on.

There is only so much you can wait for, then you get fed up. I already explained no python use, if I can’t pick up a language anytime soon, then it would appear I’m not very good with the logic and all the steps that go with it.

I had already tried that nonsence of using cubes and more bloody cubes, that obviously wasn’t going to make a character attack, if only it was just a cube. That is all the engine amounts to, more cubes that is how games are made for it, anything more is just another highway with no signs.

To learn a new tool, you must first start with the basics. Here a 2 tutorials using first only logic bricks:


A game is no more than a collection of game mechanics. :slight_smile:

The one realisation I have got from viewing that old tutorial, is that I didn’t use game properties in the example file I have uploaded with my scene.

Is that a necessary for two characters to work?

The current file the enemy doesn’t even move, it just freezes there.

I used part 3 to try the game property for the enemy character, that doesn’t work. I don’t know. The character just sinks into the deck, and it doesn’t remove the player, using the collision and game property.

Thanks anyway.