Quote: "1. Were in the new ai scripts can i find the exit part to activate a kill for my kill counter. ? i am ok with the head shot part i just need the normal death part were the exit would be.
"
add it yourself to ai_soldier.lua (or whichever AI script you are using)
i.e. (replace "kills" with your desired variable)
-- AI : Soldier Behavior
ai_soldier_combatshoot = require "scriptbank\\ai\\module_combatshoot"
killd = 0
function ai_soldier_init(e)
ai_soldier_combatshoot.init(e,ai_combattype_regular)
end
function ai_soldier_main(e)
ai_soldier_combatshoot.main(e,ai_combattype_regular,ai_movetype_usespeed,ai_attacktype_canfire)
end
function ai_soldier_exit(e)
kills = kills+1
end
Quote: "2. What do i have to set or adjust to have the Npc not to disappear after he is killed. i want him to lie on the ground for a while before he disappear, or can i have like an trigger to be activated when the body must disappear?"
don't think we have any control over this, the engine cleans up dead characters automatically to keep frame rates up
Quote: "3. in the past when we had the old ai scripts it was possible to change an ai 's script to another script.
it could be done by having this commands Include("ai_soldier.lua") and SwitchScript(e,"ai_soldier")
the two functions were used in like this
Ok so what i want to know is can it still be done with the new ai scripts and if so how would one do it ? were do you have to put it in the new ai script. if you want to change the script to another script. "
this is pretty much how the new scripts work by default now, the old scripts simply include and call the new ones, so to switch you would need to add a check in the correct place (depending on when you wanted it to swap) and do likewise.
i.e.
-- AI : Soldier Behavior
ai_soldier_combatshoot = require "scriptbank\\ai\\module_combatshoot"
kills = 0
require "scriptbank\\ai_neutral"
function ai_soldier_init(e)
ai_soldier_combatshoot.init(e,ai_combattype_regular)
end
function ai_soldier_main(e)
if GetPlayerDistance(e) < 500 then
UnlockCharacterPosition(e)
SwitchScript(e,"ai_neutral")
ai_soldier_state[e] = "combat"
PlayCombatMusic(8000,500)
ai_combat_mode[e] = 0
return
else
ai_soldier_combatshoot.main(e,ai_combattype_regular,ai_movetype_usespeed,ai_attacktype_canfire)
end
end
function ai_soldier_exit(e)
kills = kills+1
end