Okay, I posted this idea up in a topic in Game Improvements in one of my posts (the topic is
TF2 mode!)
Before you say its just the same as /stat which summons a stationary gun, this is slightly different. I would like to know if this is possible and maybe provide the code so it can help OTHER scripters or players in any way possible.
The idea is this: when you type /turret , a stationary gun is spawned. A bot who is on your team is added. (for team games, I'm not sure how it might be done in non-team games like DM) This bot will spawn on the exact same location as the stationary gun. Now, the bot will man the turret and keep using it, firing the stationary gun at any incoming enemies he can see.
How do we destroy this turret? If the Bot ever walks out or unmans the stationary gun or if the bot is killed, the bot is instantly removed from the game, and the stationary gun itself will explode and disappear from the game. The turret may be removed by another command like /remove2 .
The above is to prevent cases in which the stat gun is placed at awkward positions, the bot actually being boosted out of the turret or the stat gun happens to be bugged and can't fire.
Some flaws:1. If the bot sees a Flagger or Barrett or Ruger or Fists or maybe even Chainsaw, he will behave awkwardly.
2. For awkward positions, there is another problem: The stat gun, if placed at some funny angles, will fly out of place. I think one way to solve this: The bot is the one who explodes instead of the stat gun. Or, if you want it to be more fail-safe, if the Bot is at where the turret is supposed to be spawned, he explodes. If the stationary gun is at where its supposed to be but the Bot is not there, the stationary gun explodes instead. If both are together, either one explodes would do, or both trigger the explosion.
3. Also, sometimes, in some positions, the stat gun doesn't fire its bullets appropriately ; the bullets will hit the wall. So I think that the turret should be spawned at exactly where the player stands, but there is a time-limit before it spawns so that the player can move away and not man the stat gun instead of the bot, and this can cause a problem.
What do you guys think? Can it be done and what would the code be if it were done?
EDIT:
Flamingo also pointed out that waypoints can be a problem in the TF2 mode thread.