I found a solution.
Not very elegant, but it works.
I create several AI_SOLDIER.LUA scripts. One script for each ennemy.
Ai_Soldier1.lua attached to Ennemy1
Ai_Solder2.lua attached to Ennemy2
etc...
The init function of each script has such a modification:
function ai_soldier2_init(e)
ENI2=e
ai_soldier_combatshoot.init(e,ai_combattype_regular)
end
Your modified script killing_By_name.lua is attached to an active object:
function killing_by_name_main(e )
if g_KeyPressE == 1 then
SetEntityHealth(ENI1,0)
end
if g_KeyPressF == 1 then
SetEntityHealth(ENI2,0)
end
end
Then:
- The 2 ennemies are attacking the player
- I can record the scene in video and kill the ennemies when I want, by pressing E or F.
If someone has a more elegant idea, I will take it.
3com, thank you again so much for the help !!
Cry \"Havoc!\" and let slip the dogs of war