I guess you've declared m_iMental like this: int m_iMental. For
networked variables you must use this instead: CNetworkVar( int,
m_iMental );

On Sun, May 3, 2009 at 4:04 PM, Brent Lewis <[email protected]> wrote:
>
> Ah yes, I just noticed that. Macro Hell - is that a real thing? Now I just 
> gotta figure out why this:
>
>        SendPropInt        (SENDINFO(m_iMental), 12, SPROP_UNSIGNED),
>
> Causes this:
>
>        Error    1    error C2039: 'MakeANetworkVar_m_iMental' : is not a 
> member of 'CBasePlayer'    c:\canvas_src\src\game\server\player.cpp    7769   
>  Server (Episodic)
>
> I see that SENDINFO references it... I've searched and searched. WTF, over?
>
> Is there some document, or tut, or anything for this stuff, so I don't have 
> to keep pestering you guys?
>
>> From: [email protected]
>> To: [email protected]
>> Date: Sun, 3 May 2009 02:45:37 -0500
>> Subject: Re: [hlcoders] What's the offset for on SendPropInt in making send  
>>  tables?
>>
>> The SENDINFO macro fills in the first three parameters based on the
>> variable.
>>
>>
>>
>> On May 3, 2009, at 2:30 AM, Brent Lewis <[email protected]> wrote:
>>
>> >
>> > Wait a minute... the SendPropInt function has a nBits parameter...
>> > and no default values for parameters...
>> >
>> > SendProp SendPropInt(
>> >    char *pVarName,
>> >    int offset,
>> >    int sizeofVar,
>> >    int nBits,
>> >    int flags,
>> >    SendVarProxyFn varProxy
>> >    )
>> >
>> > There's a #define or overload I'm missing somewhere, isn't there?
>> >
>> >> Date: Tue, 2 Jun 2009 14:51:45 +0900
>> >> From: [email protected]
>> >> To: [email protected]
>> >> Subject: Re: [hlcoders] What's the offset for on SendPropInt in
>> >> making send tables?
>> >>
>> >> Are you referring to the number that goes after the initial comma?
>> >> That value refers to the number of bits it will use to transfer the
>> >> data. Always try to use the fewest bits possible as it optimizes
>> >> network
>> >> communication.
>> >> So for example.. if your variable "m_iMental"  rangers between 0
>> >> and 100.
>> >> You should use a bit size of 7 (as that will allow you to use values
>> >> from 0 - 127 )
>> >> Also, you need to use the flag  SPROP_UNSIGNED.
>> >> So your declaration will look like this
>> >>
>> >>        SendPropInt        (SENDINFO(m_iMental), 7, SPROP_UNSIGNED ),
>> >>
>> >>
>> >>
>> >> Brent Lewis wrote:
>> >>> I want to add an int network variable and figured this was
>> >>> probably the place to do it. The problem is, I'm not quite sure
>> >>> what the "offset" parameter of SendPropInt is, and what value I
>> >>> should use. I know what offset means traditionally, but by this
>> >>> example it seems that may not be the meaning.
>> >>>
>> >>>    IMPLEMENT_SERVERCLASS_ST( CBasePlayer, DT_BasePlayer )
>> >>>
>> >>>        SendPropDataTable(SENDINFO_DT(pl),
>> >>> &REFERENCE_SEND_TABLE(DT_PlayerState),
>> >>> SendProxy_DataTableToDataTable),
>> >>>
>> >>>        SendPropEHandle(SENDINFO(m_hVehicle)),
>> >>>        SendPropEHandle(SENDINFO(m_hUseEntity)),
>> >>>        SendPropInt        (SENDINFO(m_iHealth), 10 ),
>> >>>        SendPropInt        (SENDINFO(m_iMental), ???????)
>> >>>        SendPropInt        (SENDINFO(m_lifeState), 3,
>> >>> SPROP_UNSIGNED ),
>> >>>        SendPropInt        (SENDINFO(m_iBonusProgress), 15 ),
>> >>>        SendPropInt        (SENDINFO(m_iBonusChallenge), 4 ),
>> >>>        SendPropFloat    (SENDINFO(m_flMaxspeed), 12,
>> >>> SPROP_ROUNDDOWN, 0.0f, 2048.0f ),  // CL
>> >>>        SendPropInt        (SENDINFO(m_fFlags), PLAYER_FLAG_BITS,
>> >>> SPROP_UNSIGNED|SPROP_CHANGES_OFTEN,
>> >>> SendProxy_CropFlagsToPlayerFlagBitsLength ),
>> >>>        SendPropInt        (SENDINFO(m_iObserverMode), 3,
>> >>> SPROP_UNSIGNED ),
>> >>>        SendPropEHandle    (SENDINFO(m_hObserverTarget) ),
>> >>>        SendPropInt        (SENDINFO(m_iFOV), 8, SPROP_UNSIGNED ),
>> >>>        SendPropInt        (SENDINFO(m_iFOVStart), 8,
>> >>> SPROP_UNSIGNED ),
>> >>>        SendPropFloat    (SENDINFO(m_flFOVTime) ),
>> >>>        SendPropInt        (SENDINFO(m_iDefaultFOV), 8,
>> >>> SPROP_UNSIGNED ),
>> >>>        SendPropEHandle    (SENDINFO(m_hZoomOwner) ),
>> >>>        SendPropArray
>> >>> ( SendPropEHandle( SENDINFO_ARRAY( m_hViewModel ) ), m_hViewModel ),
>> >>>        SendPropString    (SENDINFO(m_szLastPlaceName) ),
>> >>>        SendPropInt        ( SENDINFO( m_ubEFNoInterpParity ),
>> >>> NOINTERP_PARITY_MAX_BITS, SPROP_UNSIGNED ),
>> >>>
>> >>>        // Data that only gets sent to the local player.
>> >>>        SendPropDataTable( "localdata", 0,
>> >>> &REFERENCE_SEND_TABLE(DT_LocalPlayerExclusive),
>> >>> SendProxy_SendLocalDataTable ),
>> >>>
>> >>>    END_SEND_TABLE()
>> >>> _______________________________________________
>> >>> To unsubscribe, edit your list preferences, or view the list
>> >>> archives, please visit:
>> >>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>> >>>
>> >>>
>> >>>
>> >>
>> >> _______________________________________________
>> >> To unsubscribe, edit your list preferences, or view the list
>> >> archives, please visit:
>> >> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>> >>
>> > _______________________________________________
>> > To unsubscribe, edit your list preferences, or view the list
>> > archives, please visit:
>> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
>> >
>>
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list archives, 
>> please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>

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

Reply via email to