Help with animated model.

So, i’m learning modeling, and now i’m adventuring on how to do animated models (model was done in blender btw). i managed to rig/animate and compile an door model, but i have a problem… the model anim keeps looping indefinitely, even with the “hold animation” set in yes on the proprieties, and since it is a door model it kinda need 2 hold the last frame on the open/close animation, i tried VDC that helped me get this far… but i didn’t found the info on this subject specifically, could someone give a hand plz?

Here’s some stuff for help:

Current QC file



$modelname	"props_abyss/abyss_tram/tram_doors.mdl"
$body mybody 	"tram_doors.smd"
$cdmaterials 	"models/props_abyss/abyss_tram"
$scale			1

$Sequence idle "tram_doors.smd" loop fps 1

$Sequence open "open.smd" loop fps 30
$Sequence oepn_idlend "open_idlend.smd" loop fps 2

$Sequence close "close.smd" loop fps 30
$Sequence close_idlend "close_idlend.smd" loop fps 2

$collisionjoints "tram_doors_coli.smd"
{
    $mass 11.0
}


Pic of the proprietes tab in hammer (model in the left)

Thanks since now to everyone who be able to help =)

Remove the word loop from the animation in your .QC.

yup… was that simple… feeling stupid now, lol… thx for the help =), would you happen to know how do i place sounds to play along with the model anim btw?

EDIT
Not ambient generics, like in the actual model data.

–up–

Anyone know how do i place sounds to play along with the model anim, not ambient generics, like in the actual model data?

Sorry for the late reply, I only got home now and you posted the last thing while I was asleep.

Paste this code into the animation of your entity (modifying what’s necissary):



{ event 5004 FRAMENUMBER "WEAPONNAME.ACTIONNAME" }


example:



$sequence "draw" "c_ak47_anims\draw.smd" {
	fps 30
	"ACT_VM_DRAW" 1
	snap
	{ event 5004 0 "Weapon_ak47.Draw" }
	{ event 5004 11 "Weapon_ak47.BoltPull" }
}


I’m going to guess you know how soundscripts work, so you know how to define these?

Thx for answer =), i’m gonna test, but to see if i understood well… it would be like this?



$modelname	"props_abyss/abyss_tram/tram_doors.mdl"
$body mybody 	"tram_doors.smd"
$cdmaterials 	"models/props_abyss/abyss_tram"
$scale			1

$Sequence idle "tram_doors.smd" loop fps 1

$Sequence open "open.smd" {
	fps 30
      	"door_opens" 1
snap
	{ event 5004 0 ".wav file name" }
	{ event 5004 60 ".wav file name" }

}

$Sequence oepn_idlend "open_idlend.smd" loop fps 2

$Sequence open "close.smd" {
	fps 30
      	"door_close" 1
snap
	{ event 5004 0 ".wav file name" }
	{ event 5004 60 ".wav file name" }

}

$Sequence close_idlend "close_idlend.smd" loop fps 2

$collisionjoints "tram_doors_coli.smd"
{
    $mass 11.0
}


Also, i know how to create soundscapes… but are you saying that i need 2 use the same syntax… or that i need to create/edit an external .txt file to work properly?

Yes, the syntax must be like the rest of the soundscapes. It’s always best to make an external .txt



".wav file name"


Not quite sure what you’re doing here, correct me if I’m wrong but you cannot do this? I believe you have to make it into a unique name with a dot and then a unique action. Sorry if I’m being misleading, I usually handeled the playing of the sound itself through Lua and that was how it’s done.

I’m kinda asking if it’s there that i place the sound file name XD, like “door_opens.wav” or just “door_opens” also the model is for portal 2, i’m not using lua =)

No, you’re not supposed to put the sound name there. What you do is you put a unique file name there, which you will then redirect to the wav file using the sound script.

i see, thx someone else clarified that for me heh XD, just 2 final doubts tho.

1: My model compiler (GUIStudioMDL) acuses error in this line “ACT_VM_DRAW”, it says that it can’t locate the file… idk why.

2: also is “ACT_VM_DRAW” the place for the name of my custom sound script file?

Problem solved, for sake of leaving here for future people seeking for this info, i deleted the “ACT_VM_DRAW” and switched to StudioCompiler, and now it is working fine, thx again for the help dude =)

No problem.

You weren’t supposed to use ACT_VM_DRAW. It’s only for viewmodels.