> Add this to your derived classes server side public:
>
>     virtual int UpdateTransmitState()
>     {
>         return SetTransmitState( FL_EDICT_ALWAYS );
>     }
>
> It wont send updates unless you have some rules, this will always send  
> when
> a change is made.
>

Unfortunately, that didn't work, either. But even if it had, doesn't that  
override the PVS culling? These are just localized entities that exist in  
the game world -- they shouldn't be always transmitted...


>> >
>> >        In my mod, I've got a base class, something like:
>> >
>> > // --- server ---
>> >
>> > class CBaseClass : public CBaseEntity
>> > {
>> > public:
>> >        DECLARE_CLASS( CBaseClass, CBaseEntity );
>> >        DECLARE_SERVERCLASS();
>> >
>> > private:
>> >        CNetworkVar( int, m_index );
>> > };
>> >
>> > IMPLEMENT_SERVERCLASS_ST( CBaseClass, DT_BaseClass )
>> >        SendPropInt( SENDINFO( m_index ), 10, SPROP_UNSIGNED ),
>> > END_SEND_TABLE()
>> >
>> > // --- client ---
>> >
>> > class C_BaseClass : public C_BaseEntity
>> > {
>> > public:
>> >        DECLARE_CLASS( C_BaseClass, C_BaseEntity );
>> >        DECLARE_CLIENTCLASS();
>> >
>> >        int m_index;  // couldn't get this to work under private:
>> > };
>> >
>> > IMPLEMENT_CLIENTCLASS_DT( C_BaseClass, DT_BaseClass, CBaseClass )
>> >        RecvPropInt( RECVINFO( m_index ) ),
>> > END_RECV_TABLE()
>> >
>> >        So far, so good, right? Follows the wiki, Valve's code, etc.
>> Compiles
>> > with no errors. Load up the mod, and it works as expected.
>> >
>> >        Now, here's the fun part. If I derive a class from my base  
>> class,
>> like so:
>> >
>> > // --- server ---
>> >
>> > class CDerivedClass : public CBaseClass
>> > {
>> > public:
>> >        DECLARE_CLASS( CDerivedClass, CBaseClass );
>> >        DECLARE_SERVERCLASS();
>> >
>> > private:
>> >        CNetworkVar( int, m_something );
>> > };
>> >
>> > IMPLEMENT_SERVERCLASS_ST( CDerivedClass, DT_DerivedClass )
>> >        SendPropInt( SENDINFO( m_something ), 10, SPROP_UNSIGNED ),
>> > END_SEND_TABLE()
>> >
>> > // --- client ---
>> >
>> > class C_DerivedClass : public C_BaseClass
>> > {
>> > public:
>> >        DECLARE_CLASS( C_DerivedClass, C_BaseClass );
>> >        DECLARE_CLIENTCLASS();
>> >
>> >        int m_something;
>> > };
>> >
>> > IMPLEMENT_CLIENTCLASS_DT( C_DerivedClass, DT_DerivedClass,  
>> CDerivedClass
>> )
>> >        RecvPropInt( RECVINFO( m_something ) ),
>> > END_RECV_TABLE()
>> >
>> >        ...the code compiles and runs just fine, but the client side of
>> the
>> > derived class *never* gets any updates when m_something is set. What
>> blows
>> > my mind is that I can cut and paste the code into the base class, and  
>> it
>> > will behave exactly as it should. What the heck is going on here?  
>> There's
>> > no indication that I can find in Valve's code or the wiki that I'm  
>> doing
>> > anything wrong, or that more/different code is needed. Someone  
>> mentioned
>> > CNetworkVarForDerived, but that doesn't seem to be the ideal solution,
>> > since you're still declaring a variable in the base class, and I want
>> > completely unique variables in some of the derived classes.


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

Reply via email to