Editing AI character in the blender game engine

Hi, I will need a few hints. I have been checking out the file I am trying to redo, should animation be on the armature or the actual box that covers the model. I’m baffled by what I’ve done so long ago.

I don’t remember, how would I get the animation to stop at the FP, player. What brick do I use for this? Always is always, so a property?

I solved the AI facing problem, once in contact with the player the Ai motion stops, and then attacks the fp.

I am sure I can somehow put this together myself with some pointers. :roll_eyes:


Animation is almost always on the armature in video games. Action actuator is used for playing mesh animations. For playing/stopping animations, you can use the Python functions below.



import bge

cont = bge.logic.getCurrentController()
own = cont.owner

# Plays animation

# Stops animation

For logic bricks, if you want to visually stop your animation, there’s 3 solutions, at least that I know of.

Method 1
Play a pre-created blank animation with 0 key-frames.

Method 2
Drive your animation vie a game-property integer/float. Do this with either the action actuator type Property or the option Frame Property.

Method 3
Freeze your animation logic somehow. Maybe use different object states. Maybe use a Property/Actuator sensor to check if animation is finished, etc.

I don’t know how to do much of any of this. Cotaks assisted me with a program script for my previous projects.

I currently have this for the AI, so it is setup to damage the player from the looks of it. The Ai would need to hit the FP/player. First person. So while near it or touching the FP, it causes damage, there is already a healthbar for the FP.

The flame message was for the FP’ weapon, in this instance, the FP uses a knife object to stab the AI a number of times, while the AI is attacking the FP. The AI’s animation is basic, it is the nature of the body, so the effect is pretty bare bones. May be a few more bones could give it a bit more of a swing to the FP.

So that doesn’t use a message, the knife effect would need to have a bullet to give the illusion of a stab to the AI, if I’m not mistaken from my recollection of how this could work. I remember trying here and youtube on this task, but I don’t know what exactly it was or it worked out in the end, the AI froze out of animation which represented the AI was stabbed, and that was it.

The attack and walking and arm moving animation works okay on the armature, but not on the box. I guess that is okayish that way?

With logic-bricks, the Action actuator should always be on the armature object. The sensor and controller bricks can be on either objects (interconnected).

Hmm, so where do I go with this, the healthbar works, so the AI collides with FP, and then the numbers or bar counts down to a another screen which is failure.

The AI doesn’t seem to do anything to the player when in contact, the player has player and hit as properties. So the AI hits the FP, in a message brick.

I tried to do a new animation for the legs of the AI, but instead of looking like a different dope sheet, it is now darker long strips. :thinking:

I got it working, not sure I pressed the red circle, seemed to of made the animation work.

Naming all of your logic bricks is a good way to help you remember what does what.

Also, have you tried UPBGE?

Hey there,

Everything was made in Blender game engine, that was the reason why I have used this or still using it. I haven’t touched the game engine in a year and a half.

I tried to do an animation sequence, but it won’t play back. Red button pressed or not. I don’t remember this type of error happening. I am not sure what is going on here.

The yellow lines are the positions of which you have key-framed transforms. They were not positioned at the beginning of the the animation time-line. You are perhaps attempting to play blank animation frames.

Meaning what is the darker strip there, I don’t remember that before when trying to insert a key frame. Select bone, I for location, and then animate which ever way, and then insert another key frame. And the bones aren’t moving in pose mode or object mode.

I have tried texturing. I removed old textures from the file, yet the new textures don’t appear in the game engine, texture mode on or off. :face_with_raised_eyebrow:

There isn’t anybody left here. :neutral_face:

I have also tried to add my spider to this file, but it closes up. Not sure why.

The alternative is to try and use the file’s spider example. It closes with anything new. I copied the same example as the original objects. I don’t know why it closes, with the smith AI or not.

I loaded the file I have been trying to edit, and it does load in upbge and the game engine functions, it also appears textured, not sure what is going on there.

Not sure yet on animation, I only went as far as just loading it in. There aren’t the bricks in that version of the game engine, or are there? I didn’t check that.

I don’t know what is happening with this, I think the problem with the object moving around erratically, has something to do with the origin? The box is the parent of the armature, so the armature is the parent of the model object.

I guess it must be the model than anything else, it isn’t shaped well with the blocky body, and the new rounder legs for it. :slightly_frowning_face:

Because just simply transferring the bricks over to a cube, the program works to lower the AI health. Not that I doubted it wouldn’t work at all, but the model is the real problem here. Flying off.

I have got the AI colliding with the player, and the healthbar works, but doesn’t load a new screen using the overlay brick.

But yes, the cube16 with the model and armature isn’t working to at least follow the FP. Not sure what more I can do with this. :roll_eyes:

So here the situation with this. Not working out.

Can you give some more information on what is not working, player/enemy damage?

As you’ve seen in the first video, the AI has already some bricks, it was the Arctic file, it was textured red, using a texture image, so I can’t seem to texture in a new texture image, it displayed in upbge better, than in 2.76 on windows 7, and on windows xp 32bit, only a little was textured of the front, a little like above

So i’ve tried to understand what is what, the player’s health drops once the AI touches the FP. The arm touches the AI and there is no health drop or even removing using the test AI.

I haven’t clue what is going on.