As smallg and DVader said, melee scripts are slightly different to soldier ai, instead of using the CSI animation range and issuing a single command for attacks, the script usually stores the animation range in 4 variables, which you can clearly see in the ai_zombiewalk.lua scripts:
attackstart[e]=683 -- this is the first frame of the attack animation
attackend[e]=722 -- this is the last frame of the attack animation
damageframestart[e]=695 -- used to sync he damage with the attack, first frame.
damageframeend[e]=715 -- used to sync the damage with the attack, last frame
These numbers are usually written into the script itself, most of the time as a variable in the init of the script, although sometimes it's in the first part of the main section, then called using the play animation commands etc in the attack portion of the script.
if ai_soldier_state[e]~="attack" then
SetAnimationSpeed(e,1.75)
if GetAnimationFrame(e)<attackstart[e] or GetAnimationFrame(e)>attackend[e] then
AIEntityStop(EntObjNo)
ai_soldier_state[e] = "attack"
CharacterControlLimbo(e)
SetAnimationFrames(attackstart[e],attackend[e])
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
else
if ai_soldier_state[e]=="attack" then
if GetAnimationFrame(e)>damageframestart[e] and GetAnimationFrame(e)<damageframeend[e] then
if GetPlayerDistance(e)<60 then
if GetTimer(e) > lastswipe[e] then
lastswipe[e]= GetTimer(e)+1000
PlaySound(e,1)
randomdamage=math.random(20,50)
HurtPlayer(e,randomdamage)
end
end
end
So if you want to use a different character with a different animation set you need to create a copy of the script and edit the variables in the first code snippet to match your animations (you may have to search for those variables because they may not be named the same in some scripts).
i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.