Make running npc walk or SetMovementActivity analogue
1 replies, posted
Congrats! I trying to make normal working npc and discovered wierd function bug. I want to make npc walk instead of run when he not raged and use this part of code:
[CODE]if(self.HeadHealth>=1&&(self.BurnTime<self.BurnTimeToPanic||self.BurnTime>self.BurnTimeToPanic+3)&&
self:Health()>self:GetMaxHealth()*0.7) then
if(self:GetMovementActivity()==ACT_RUN) then
self:SetMovementActivity(ACT_WALK)
end
end[/CODE]
I think you understand that main function here self:SetMovementActivity(ACT_WALK), but it have problem. Frame count in running animation much smaller than in walking animation and running animation play faster (40 fps). In result ACT_WALK plays with ACT_RUN duration and it's look like this: [IMG]http://imgur.com/download/nFRKzOZ[/IMG]
Dat animation always restarts and all this looks bad. Question: can i change movement animation without SetMovementActivity?
Problem solved! Just need to write in ENT:SelectSchedule() selecting with conditions if(self:IsCurrentSchedule(SCHED_CHASE_ENEMY)) then self:SetSchedule(SCHED_CHASE_ENEMY) end... very strange
Sorry, you need to Log In to post a reply to this thread.