[hlcoders] Getting a CBaseAnimatedEntity to animate

2009-09-11 Thread Michael Chang
Hi all, been a while since I asked a question here.

I have a simple animated entity with the model all set up and ready to go,
with animations.

Question 1:
Do I have to do StudioFrameAdvance() in order to animate it?

Question 2:
Do I need to set a sequence before calling StudioFrameAdvance()? Or does it
default to ACT_IDLE ?

Question 3:
Where do I call StudioFrameAdvance()? On Think? The example I looked at is
Player, which does it in PostThink but my entity has no PostThink.

Question 4:
For some reason calling StudioFrameAdvance() doesn't increment its Cycle. It
keeps flipping back to zero on the next call! Why is it doing that? How do I
increment my model's cycle properly?

Note: I do have an animation, with its frames setup properly and it has an
ACT ID so it's not invalid.

Bonus Question:
Can anyone provide me with a simple animated entity example that works? Is
there any simple examples that are clear in the SDK that I can refer to?

Thanks all

~M
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Getting a CBaseAnimatedEntity to animate

2009-09-11 Thread steven belmans

Put this block in your Spawn() fuction

int iSequence;//this is to store your Sequence number

iSequence = LookupSequence(your Sequence name);//store 

ResetSequence( iSequence );//this sets the animation

m_flAnimTime = gpGlobals-curtime;

SetCycle( 0 );

 

next make a think() fuction and put in:

StudioFrameAdvance();

DispatchAnimEvents( this );


 
 Date: Fri, 11 Sep 2009 01:36:41 -0700
 From: flux.black...@gmail.com
 To: hlcoders@list.valvesoftware.com
 Subject: [hlcoders] Getting a CBaseAnimatedEntity to animate
 
 Hi all, been a while since I asked a question here.
 
 I have a simple animated entity with the model all set up and ready to go,
 with animations.
 
 Question 1:
 Do I have to do StudioFrameAdvance() in order to animate it?
 
 Question 2:
 Do I need to set a sequence before calling StudioFrameAdvance()? Or does it
 default to ACT_IDLE ?
 
 Question 3:
 Where do I call StudioFrameAdvance()? On Think? The example I looked at is
 Player, which does it in PostThink but my entity has no PostThink.
 
 Question 4:
 For some reason calling StudioFrameAdvance() doesn't increment its Cycle. It
 keeps flipping back to zero on the next call! Why is it doing that? How do I
 increment my model's cycle properly?
 
 Note: I do have an animation, with its frames setup properly and it has an
 ACT ID so it's not invalid.
 
 Bonus Question:
 Can anyone provide me with a simple animated entity example that works? Is
 there any simple examples that are clear in the SDK that I can refer to?
 
 Thanks all
 
 ~M
 ___
 To unsubscribe, edit your list preferences, or view the list archives, please 
 visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders
 

_
Je hele online leven op één stek met Windows Live
http://www.microsoft.com/belux/nl/windows/windowslive/default.aspx
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Getting a CBaseAnimatedEntity to animate

2009-09-11 Thread Jorge Rodriguez
Why aren't you using CBaseAnimating? It does all that stuff for you.

-- 
Jorge Vino Rodriguez
___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders