Thanks for your help.

We're using the orange box version (source 2007).

This whole networking stuff is pretty new to me so I try to understand it by
looking at how the other weapons are programmed. Here's why this confuses me as
I can't find a difference between how the animation is called compared to other
animations or other weapon scripts.

I tried to follow the whole thing and apparently
CHL2MPPlayerAnimState::DoAnimationEvent never gets told to do the animation.
Additionally the function: bool CWeaponBook::Reload( void ) gets only called on
the server in: CWeaponBook::ItemPostFrame
This makes fits as DoAnimationEvent never gets told to do an animation on the
client.

Now here is whats confusing me. In the same function CWeaponBook::ItemPostFrame
we have another call thats written the same way but this time its inside a
switch statement: switch( m_AttackPaused )
m_AttackPaused is a CNetworkVar so I figured ok, lets try and code a new
CNetworkVar and write an if statement for it so the reload animation only gets
called when needed. And voila it worked!

So while I think I understand this I still have one last question:

Is this update/linking on all clients whenever we use a CNetworkVar something
Valve has written or is this something C++ does on its own?

I mean its pretty convenient but it confused the hell out of my because it
wasn't coded explicitly (or instantly visible for that matter). :)

Cheers,
Tobias


Psy_Commando <psycomma...@gmail.com> hat am 5. Juni 2013 um 06:50 geschrieben:

>  I might be wrong, but my guess is that by not sending a message and instead
> calling directly the message associated method, you're leaving the client
> unaware that it should play that anim.
> 
>  Though its been a while since I played with that. Are you using Alien swarm
> or the orange box ?
> 
> 
>  On Tue, Jun 4, 2013 at 9:57 AM, m...@tobiasbaumann.net
> <mailto:m...@tobiasbaumann.net> <m...@tobiasbaumann.net 
> <mailto:m...@tobiasbaumann.net>
> > wrote:
>    > >    Hi everyone,
> > 
> >    I've been trying to solve a very simple problem in the past days and I'm
> > hoping someone of you can help me.
> > 
> >    So I've created a new weapon based upon the Frag grenade code. Its
> > basically the same thus far with a few changes. So far it works as intended
> > except there is no reload animation on the player model even tough I'm
> > telling the game to play one. My character model has the reload animation
> > and it works when I try it in the modelviewer. However when I use this line
> > in the code:
> > 
> >    ToHL2MPPlayer(GetOwner())->DoAnimationEvent( PLAYERANIMEVENT_RELOAD );
> > 
> >    Which is getting called in the reload function nothing happens. My first
> > guess was that maybe another animation cancels out this animation so I tried
> > to see whats going on by using anim_showstate in the console and I noticed
> > that only the server is doing a layered animation of the reload animation.
> > Which is correct I'm assuming because we also want walking/crouching
> > happening while reloading. Now here's my question:
> > 
> >    Why is the animation only executed in the server?
> >    Am I missing some reference or did I forgot a sequence inside the the qc
> > file? (I've got my acttable_t setup correctly.)
> > 
> >    I've looked at other weapons code to see how they trigger the reload
> > animation and its the same line of code. What am I missing? Is there some
> > other place in the code that handles reloading depending on what weapon the
> > player has equipped? I'm asking because I noticed the default frag grenade
> > doesn't have a reload animation as well.
> > 
> >    Viewmodel animations are working correctly tough.
> > 
> >    Thank you for any help on this.
> > 
> >    Best regards,
> >    Tobias
> > 
> > 
> >    _______________________________________________
> >    To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> >    https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
> > <https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders>
> > 
> >  > 
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

Reply via email to