Assuming the nasty aliens are script driven simply create a list in the aliens script and store something in it, e.g.
g_nasty_aliens[e] = 'shoot me'
In the turret_base_dual script to target other entities change this line in 'main':
local PX, PY, PZ = g_PlayerPosX, g_PlayerPosY, g_PlayerPosZ
something like this:
local function FindNastyAlien()
for k, v in pairs(g_nasty_aliens) do
if v = 'shoot me' then
local Ent = g_Entity[k]
return Ent.x, Ent.y, Ent.z
end
end
return 0,0,0
end
-- in .... main ....
local PX, PY, PZ = FindNastyAlien()
In addition you will probably need to change the detectRange variable at the top of the script.
In the gun_shot script you will need to replace the part that hurts the player with code to hurt the alien instead.
That's about the simplest way of doing it but to make it really good you should find the nearest nasty alien to shoot at and if they are moving at a reasonable speed you need to target ahead of them, I'll leave that bit to the reader to figure out, hopefully you'll do a better job than the engineers of the Bismark.
Been there, done that, got all the T-Shirts!