ai logic bricks

how would i make an ai using only logic bricks?

thanks in advance! :slight_smile:

How you would go about creating ai for your game depends on what you want it to do. I think that if you want answers about ai then you should be more specific in your request. Then others can try and help you.

sorry. :expressionless:

well its going to be a guard that walks around in slow circles with gun-in-his-hand. Then, if the player in in front of him, i want him to take out his gun and shoot at him.

thanks!

an ipo actuator in loop stop mode to walk in circles [or along whatever path you like]

action actuator to play the walking/shooting animation

a near or radar sensor to decide when to switch [a property] between playing the ipo and walking actuator, and playing the action actuator of taking out gun and shooting

i cant get the radar OR the near sensor to work…never could.

how do i make them work?

eh maybe use Ray

You have a Left wall and a Right wall.
You have an actor which is an AI and always walks forwards.
Now make 3 empties, one on the top_left side and one in the top_right side and one in the middle but this one a little forwards.
It should look like


  .
.   .
 [ ]

Now when the top_left empty hits the left wall it turns the actor a little to the right.
When the top_right empty hits the right wall, it turns the actor to the left.
And the middle empty turns the actor left or right.
Now you use ray sensors to detect those walls which have left or right properties.
That was a really simple setup on how to make a really simple ai. It takes a little to tweak it, but it works perfect for racing ai. :slight_smile:
Ineedanewbike has used this on his 3Dracer.

I beleive blender rox also explained this tecnique more, I’ll edit this post and get a link of the topic when i find it.

EDIT: ok heres the link from blender_rox’s tutorial, very useful, espically in racing games :stuck_out_tongue: https://blenderartists.org/forum/viewtopic.php?t=39332&highlight=