Custom NPC not moving

Alright, I got a radroach finally working, but when my friend tests it in game, it won’t move. It’s not the lua, because with other models it works.

The animations are ported from Fallout 3, only on the reference and phymodel there are less bones, due to the source engines limit. However the main bones are still there. Any idea whats wrong?

QC:


$cd "E:\Users\Jasper\Modeling\Characters\radroach"
$modelname "noxfallout\Radroach.mdl"
$model "RadC" "RadC.smd"

$cdmaterials "models
oxfallout\"

$hboxset "default"

$hbox 0 "Bip01 Pelvis" -1.802  -5.388  -5.162  6.240  5.391  2.893
$hbox 0 "Bip01 L Thigh01" -0.399  -1.549  -1.789  9.125  1.796  1.081
$hbox 0 "Bip01 L Calf01" -0.693  -1.109  -0.312  8.984  0.384  1.352
$hbox 0 "Bip01 L Foot01" 0.000  -0.608  -0.278  8.771  0.686  0.874
$hbox 0 "Bip01 L Thigh11" -0.470  -1.226  -2.630  9.286  1.854  0.464
$hbox 0 "Bip01 L Calf11" 0.000  -1.530  -1.109  12.414  0.472  1.198
$hbox 0 "Bip01 L Foot11" 0.000  -0.624  -0.666  12.050  0.669  0.598
$hbox 0 "Bip01 R Thigh01" -0.449  -1.815  -1.848  9.136  1.480  0.768
$hbox 0 "Bip01 R Calf01" -0.424  -0.388  -0.526  9.264  1.096  1.371
$hbox 0 "Bip01 R Foot01" 0.000  -0.691  -0.278  8.772  0.603  0.874
$hbox 0 "Bip01 R Thigh11" -0.479  -1.885  -2.631  9.289  1.085  0.433
$hbox 0 "Bip01 R Calf11" 0.000  -0.492  -0.983  12.578  1.497  1.247
$hbox 0 "Bip01 R Foot11" 0.000  -0.764  -0.649  12.201  0.530  0.626
$hbox 0 "Bip01 Spine" 0.000  -6.119  -6.416  7.824  6.215  2.963
$hbox 0 "Bip01 Spine1" -1.053  -5.735  -5.656  11.210  5.734  3.168
$hbox 0 "Bip01 Neck" 0.000  -1.822  -0.697  3.768  1.821  1.812
$hbox 0 "Bip01 Head" -0.625  -2.202  -2.115  5.836  2.003  2.114

// Model uses material "radroach.vmt"

$surfaceprop "alienflesh"

$illumposition -0.489 -0.001 8.862

$sequence ragdoll "ragdoll" ACT_DIERAGDOLL 1 fps 30.00
$sequence idle "idle" loop ACT_IDLE 1 fps 30.00
$sequence Attack_right "Attack_right" ACT_RANGE_ATTACK1 1 loop fps 30.00
$sequence Attack_JumpRight "Attack_JumpRight" loop ACT_HEADCRAB_HOP_RIGHT 1 fps 30.00
$sequence Attack_JumpLeft "Attack_JumpLeft" loop ACT_HEADCRAB_HOP_LEFT 2 fps 30.00
$sequence Move_CrawlFast "Move_CrawlFast" loop ACT_RUN 1 fps 30.00
$sequence turnleft "turnleft" loop fps 30.00
$sequence turnright "turnright" loop fps 30.00
$sequence idle_rapidattene "idle_rapidattene" loop ACT_IDLE 2 fps 30.00
$sequence idle_rapidwings "idle_rapidwings" loop ACT_IDLE 3 fps 30.00

$collisionjoints "physmodel.smd"{

	$mass 20.0
	$inertia 10.00
	$damping 0.01
	$rotdamping 1.50
	$rootbone "Bip01"
	$jointmerge "Bip01" "Bip01 Pelvis"
	
	$jointconstrain "Bip01 Spine" x limit -48.00 48.00 0.00
	$jointconstrain "Bip01 Spine" y limit -25.00 25.00 0.00
	$jointconstrain "Bip01 Spine" z limit -25.00 50.00 0.00

	$jointconstrain "Bip01 R Arm" x limit -39.00 39.00 0.00
	$jointconstrain "Bip01 R Arm" y limit -79.00 95.00 0.00
	$jointconstrain "Bip01 R Arm" z limit -93.00 23.00 0.00
	
	$jointconstrain "Bip01 R Arm1" x limit -39.00 39.00 0.00
	$jointconstrain "Bip01 R Arm1" y limit -79.00 95.00 0.00
	$jointconstrain "Bip01 R Arm1" z limit -93.00 23.00 0.00
	
	$jointconstrain "Bip01 R Arm2" x limit -39.00 39.00 0.00
	$jointconstrain "Bip01 R Arm2" y limit -79.00 95.00 0.00
	$jointconstrain "Bip01 R Arm2" z limit -93.00 23.00 0.00

	$jointconstrain "Bip01 L Arm" x limit -39.00 39.00 0.00
	$jointconstrain "Bip01 L Arm" y limit -79.00 95.00 0.00
	$jointconstrain "Bip01 L Arm" z limit -93.00 23.00 0.00
	
	$jointconstrain "Bip01 L Arm1" x limit -39.00 39.00 0.00
	$jointconstrain "Bip01 L Arm1" y limit -79.00 95.00 0.00
	$jointconstrain "Bip01 L Arm1" z limit -93.00 23.00 0.00
	
	$jointconstrain "Bip01 L Arm2" x limit -39.00 39.00 0.00
	$jointconstrain "Bip01 L Arm2" y limit -79.00 95.00 0.00
	$jointconstrain "Bip01 L Arm2" z limit -93.00 23.00 0.00

	$jointconstrain "Bip01 R Thigh01" x limit -12.00 12.00 0.00
	$jointconstrain "Bip01 R Thigh01" y limit -8.00 75.00 0.00
	$jointconstrain "Bip01 R Thigh01" z limit -97.00 32.00 0.00

	$jointconstrain "Bip01 R Calf01" x limit 0.00 0.00 0.00
	$jointconstrain "Bip01 R Calf01" y limit 0.00 0.00 0.00
	$jointconstrain "Bip01 R Calf01" z limit -12.00 126.00 0.00

	$jointconstrain "Bip01 Head" x limit -20.00 20.00 0.00
	$jointconstrain "Bip01 Head" y limit -25.00 25.00 0.00
	$jointconstrain "Bip01 Head" z limit -13.00 30.00 0.00

	$jointconstrain "Bip01 L Thigh01" x limit -12.00 12.00 0.00
	$jointconstrain "Bip01 L Thigh01" y limit -73.00 6.00 0.00
	$jointconstrain "Bip01 L Thigh01" z limit -93.00 30.00 0.00

	$jointconstrain "Bip01 L Calf01" x limit 0.00 0.00 0.00
	$jointconstrain "Bip01 L Calf01" y limit 0.00 0.00 0.00
	$jointconstrain "Bip01 L Calf01" z limit -8.00 126.00 0.00

	$jointconstrain "Bip01 L Foot11" x limit 0.00 0.00 0.00
	$jointconstrain "Bip01 L Foot11" y limit -19.00 19.00 0.00
	$jointconstrain "Bip01 L Foot11" z limit -15.00 35.00 0.00

	$jointconstrain "Bip01 R Foot11" x limit 0.00 0.00 0.00
	$jointconstrain "Bip01 R Foot11" y limit -25.00 6.00 0.00
	$jointconstrain "Bip01 R Foot11" z limit -15.00 35.00 0.00
	$animatedfriction 1.000 400.000 0.500 0.300 0.000

}

You have to add motion axes on any sequence that should actually make the NPC move ingame in the world. For normal movements on the x axis “LX” should do fine:



$sequence Move_CrawlFast "Move_CrawlFast" loop ACT_RUN 1 

LX


 fps 30.00


By the way, is that your own ragdoll you’re using for the radroach?
Because I made a radroach SNPC some time ago, but I don’t have a ragdoll for it yet.

Didn’t work for some reason, I did this:


$sequence ragdoll "ragdoll" ACT_DIERAGDOLL 1 fps 30.00
$sequence idle "idle" loop ACT_IDLE 1 fps 30.00
$sequence Attack_right "Attack_right" ACT_RANGE_ATTACK1 1 LY loop fps 30.00
$sequence Attack_JumpRight "Attack_JumpRight" ACT_HEADCRAB_HOP_RIGHT 1 LY fps 30.00
$sequence Attack_JumpLeft "Attack_JumpLeft" ACT_HEADCRAB_HOP_LEFT 2 LY fps 30.00
$sequence Move_CrawlFast "Move_CrawlFast" loop ACT_RUN 1 LX fps 30.00
$sequence turnleft "turnleft" fps 30.00
$sequence turnright "turnright" fps 30.00
$sequence idle_rapidattene "idle_rapidattene" loop ACT_IDLE 2 fps 30.00
$sequence idle_rapidwings "idle_rapidwings" loop ACT_IDLE 3 fps 30.00

Could it be my collision model?

Any suggestions/corrections?

When you look at the “Move_CrawlFast” sequence in the model viewer, does the ground below the model move, or does the model itself move?

No, most likely not.

Maybe NPC’s are lazy? :stuck_out_tongue:

What about Nodes in map? maybe they just don’t know where to go?

The model moves, not the ground.

Yeah, there are nodes on the map.

Sorry for the bump, but made a video to show it:

[hd]http://www.youtube.com/watch?v=ZUtFrV_lsmA[/hd]

And yeah, I know the turning thing is probably due to I have to do rotate in the qc.

The wrong rotation is exactly what’s causing the problem.
Try to rotate the sequence in the code of the quake c file:



$sequence Move_CrawlFast "Move_CrawlFast" loop ACT_RUN 1 LX fps 30.00 rotate 90


If it still doesn’t work, try to rotate it by -90 degrees.

Wow really? Didn’t think so due to the idle and stuff are all the same angle, only the ragdoll isn’t. Thanks man, I’ll edit this to tell you if it worked or not.

Nope didn’t work, it seems as if when the idle animation ends, he want’s to move but he can’t, he just kind of freezes. Also HLMV won’t load the model for some reason, so I tried both of the rotates, without any luck though.

Here is how it looks ingame:

Spawn a zombie ingame, and then type this into the console:


lua_run ents.FindByClass("npc_zombie")[1]:SetModel("models/noxfallout/Radroach.mdl")

If the zombie doesn’t move neither, you can at least be sure it’s not a problem with the script for the radroach NPC.