Yeah, scripting is the only way to make a decent AI.
How familiar are you with python?
- Really? You want it to fly thorough the ground. I’m not sure collision groups are implemented yet (don’t quote me on that)
- Sure, just change the trackTo’s object. (trackTo.object = player sort of thing)
- I have a script that can manage this, but am hesitant to give it to you, as it will be hard to understand having not written it. I’ll give you some pointers though:
- They are two separate weapons, with separate fire rates. Write a script where a property controls the fire rate, so you can use the same script for both
- Have the machine-gun’s rotation change slightly each frame, use a property ipo with a random property.
- Will AI always fire? Have a property called “fireProb” and compare a random number to it to see if it “choses” to fire
- What else determines if you can fire? Can you see him? In range? Weapon temperature?
If you take these into account you end up with a realistic firing pattern, where it is “predictably random”
- Yeah sure, simply stop it moving by de-activating the motion controller and setting a servo-motions velocities to 0
- It can’t fire both weapons at once. I reckon it can…
The first thing to do is to make a flow diagram. It makes things 10 times clearer, and when you get to writing code it is much easier.
I have an amazing AI script for enemies in zero-G. A helicopter is similar to this. If you want me to send you the script I can probably do so. BUT I would prefer to see you try first.
A final word:
Plan for more. It is easier to write a good script now, then to have to keep updating it later, so add in picking targets for when you have two players. Keep your scripts flexible, in an Object Oriented way (each object knows about itself).
Good Luck, don’t be afraid to ask for help.