Do you have the script ai_melee_animmove and the character entitybank\user\experiments\FuseZombieAnimMoveMelee\smartzombie?
With this script you can let him ragdoll and then he stand up and attack again.
-- AI : Melee Guard Behavior
module_combatmelee = require "scriptbank\\ai\\module_combatmelee"
function ai_melee_animmove_init(e)
module_combatmelee.init(e,ai_combattype_freezermelee,ai_movetype_useanim)
SetPreExitValue(e,0)
end
function ai_melee_animmove_main(e)
module_combatmelee.main(e,ai_combattype_freezermelee,ai_movetype_useanim)
end
function ai_melee_animmove_preexit(e)
SetPreExitValue(e,1)
if module_combatmelee.preexit(e,ai_movetype_useanim) == 1 then
SetEntityHealth(e,200)
module_combatmelee.init(e,ai_combattype_freezermelee,ai_movetype_useanim)
SetPreExitValue(e,0)
--SetPreExitValue(e,2)
end
end
function ai_melee_animmove_exit(e)
module_combatmelee.exit(e)
end
Thats how these preexit function work. Very "uncool" programming but it works.
The prexiti function is very usefull, but of course you need to let the engine know that you want to "restart" you AI. So only setting the health and the startpoint does not work, you actually need to recall the init function and set the preexit value to 0 and then he should "respwan".
Ai works now like this:
Init SetPreExitValue(e,0) -> Main
Main SetPreExitValue(e,1) -> Preexit
Preexit SetPreExitValue(e,2) -> Exit
If you never set it to 2, you character never dies
Ebe Editor Free - Build your own EBE structures with easy and without editing any text files
Thread and Download