SNPC not walking?

Hello,

I tried to make a snpc (custom bones)… I added custom animations in the .qc:



$sequence idle "idle.smd" ACT_IDLE 1 fps 30.00
$sequence walk "walk.smd" loop ACT_WALK 1 fps 30.00
$sequence run "run.smd" loop ACT_RUN 1 fps 30.00
..
etc


And in init.lua:



function ENT:SelectSchedule()
self:SetSchedule( SCHED_RUN_RANDOM )
end


But it doesn’t work. The snpc stands still (and playing the idle animation) but he do not walking/running.
I think the problem is not the lua script, because I tested it with another .mdl (snpc) and he runs random. But not with my .mdl.

I think it’s a problem with compile file (.qc).

Any advice?

(I hope you understand what I mean :))

None :/?

Maybe it’s the .qc file or the compiler itself:
I decompile the other snpc (who runs/walks) and compiled it again --> he doesn’t walk/run anymore ingame.
I use Crowbar and I tested it with all games (under options: Gmod, HL2, Ep1 etc).

You need to add walk frames

Thank you for your answer.

Ok, I made some animations for each direction.
.qc:



$animation a_Walks "a_Walks" loop walkframe 34 fps 30.000000 LX LY
$animation a_WalksE "a_WalksE" loop walkframe 34 fps 30.000000 LX LY
$animation a_WalkE "a_WalkE" loop walkframe 34 fps 30.000000 LX LY
$animation a_WalkNE "a_WalkNE" loop walkframe 34 fps 30.000000 LX LY
$animation a_WalkN "a_WalkN" loop walkframe 34 fps 30.000000 LX LY
$animation a_WalkNW "a_WalkNW" loop walkframe 34 fps 30.000000 LX LY
$animation a_WalkW "a_WalkW" loop walkframe 34 fps 30.000000 LX LY
$animation a_WalkSW "a_WalkSW" loop walkframe 34 fps 30.000000 LX LY

$sequence walk {
	a_WalkN a_WalkNW a_WalkW a_WalkSW a_Walks a_WalksE a_WalkE a_WalkNE a_WalkN
	blendwidth 9 blend move_yaw -180 180 ACT_WALK 1 LX LY node "walking"
}

$sequence walk_all {
a_WalkN a_WalkNW a_WalkW a_WalkSW a_Walks a_WalksE a_WalkE a_WalkNE
blendwidth 9 blend move_yaw -180 180 "a_WalkNE" loop ACT_WALK 1 LX LY node "walking" fps 30.00
}



I can rotate (move_yaw) the model in hlmv, but he doesn’t walk in gmod :confused:
Maybe the problem is the speed (in hlmv: speed = 0)…

And I’m not sure I have to create animations for each direction, because I found a snpc with only one walk-file (walk.smd) and he walks around.
but I don’t know how it works…because if I recompile it, he doesn’t walk anymore.

I don’t know how to actually make walk frames, all I know is that it needs it to move around

From my understanding, you need to put “activity” before defining the ACT
[lua]$sequence walk “walk.smd” loop activity ACT_WALK 1[/lua]
Walkframe is for animations that don’t move on the spot so that you can extract movement data from it, which is needed if you want to blend and scale animations based on in-game directions and speed. Refer to these:

I’m not sure how the schedule works, but this is why your animation isn’t assigning to its ACT.

Thank you for your respond.
I tried it with “activity”, but nothing changed… my SNPC stands still and plays his idle animation.

I don’t understand what I have to do now… so I think I make now a nextbot (instead a snpc), it’s easier and he walks without problems…

That’s because the nextbot base is applying velocity on it, you can make a system like that for SNPCs as well. But your problem is that you don’t have proper walk frames. As far as I know, you need to do something in the actual model not just QC.