Squad AI System using logic bricks and mouselook script

Mouselook script by riyuzakisan.
File is at the bottom.
WASD keys to move.
Mouse movement to turn the player.
Player is the white cube.
“1” key to select all squadmates.
“2” key to select blue squadmate only.
“3” key to select yellow squadmate only.
“4” key to deselect all squadmates.
Shift to toggle squad movement placer. (The green sphere)
Left click to deploy squadmate(s) to indicated location when the squad movement placer is on.
Scroll up and down while squad movement placer is on to move it forwards and backwards.

This is a set up in which you the player can command a single squadmate or all of them to move to a particular location (in my example, I have two squadmates one yellow and the other blue). I used a third person camera set up here but this can work for anything from an RTS to a first person shooter depending on how you tweak it. This is a basic version of a system that could be used to command an entire army, or to interact with AI partners in a puzzle platformer. The possibilities are endless. At initialisation of the game, all the squadmates are selected. Selected squadmates will follow you wherever you go. If you select one specifically using a number key it will deselect the other, forcing them to hold their current position. Only selected squadmates can move to the squad movement placer.
Also I placed a smaller cube within the main player cube, parented to the main player cube. I attached the mouselook script to this smaller cube. This allows player to only turn on the z axis and not go upside down.
squadai.zip (126 KB)

You could have used the state actuaror to do that.It would have been much simpler.Would you like a demonstration of how to do that?It would not have a mouselook script though.

Sure, link me up.

I am not done with it yet.I am working on it.

tracking friendsblend.blend (868 KB)Here is the blend.It is not finished yet but it works somewhat.Press buttons 1,2,3,4,5,6,1 and then see what happens.I will finished and improve on it when i have the time to.I thought
it would be simple but it is harder.Oh well.

Cool haha. awesome that the state actuator works with this too. I’m just very used to using property sensors and actuators. The mouse squadmate placer was a really important part of it for me though.

tracking friendsblend.blend (989 KB)You could do it with passwords as well.Have you ever did tutorials before?I am just asking.I present to you an easier way.Press 1,2,3,4,1 and see what happens.This idea uses message sensor, message actuator,addobject actuator and end object actuator.Here is the blend.

Yes, 3d solar system builder, I’ve done tutorials. I never saw opportunities that would require me to use the state actuator in my projects though, hence my unfamiliarity with it. Your solution is great, but I did experience a glitch when I pressed any of the calling keys when the cubes were still on their way down, where two other cubes are added to the scene. The glitch goes away when you press any of the above number keys when the cubes hit the ground.

The cubes are not a glitch.The cubes are transmitting messages via the message actuator when they are added.They are very necessary to the design i made.I forgot to make them invisible.