Quote: "Even if you did decompile, I doubt it would be in .x format, probably some home-brewed file format just for Valve.
Btw: I was doing this tutorial, and trying to perfect it. Anyone have any idea on how to loop the animation while the key/button is being pressed. I tried using while instead of if, but it didnt work. If you use dbLoopObject like it says, it runs forever, if you use dbPlayObject it runs once."
You can use dbObjectFrame to stop it when it reaches a certain frame.
if(dbKeyState(17) == 1) //if w key is pressed then
{
Walking = TRUE; //bool variable
//dbLoopObject(5,48,66) ; //Move Animation
}
if(Walking == TRUE)
{
dbSetObjectSpeed(5, 70); //set speed of walking
dbLoopObject(5, 48, 66); //set the frames
if(dbKeyState(17) != 1) //if w key depressed
{
dbLoopObject(5, 21, 47); //idle frames
Walking = FALSE; //will not go back into this if command unless the w key is pressed
}
}
Or you can use dbObjectFrame()
if(dbKeyState(19) == 1) //if R key is pressed then
{
//dbLoopObject(5,81,139) ; //Reload Animation
Reloading = TRUE; //bool variable
}
if(Reloading == TRUE) //if r key was pressed
{
dbSetObjectSpeed(5, 70); //set reload speed
dbLoopObject(5, 81, 200); //set object frames
if(dbObjectFrame(5) > 195) //if the object reaches the the 195th frame
{
dbLoopObject(5, 21, 47); //idle frames
Reloading = FALSE; //stay out of this if statement until the r key is pressed again
}
}
When you let go of the w key, the guy will stop.
If you press the r key (doesn't matter if it's held in) it will keep looping that object until it reaches frame 195 (done reloading)
This is the way I do it.