After looking on the SDK do you have

DECLARE_CLASS(CMyPlayer, CSDKPlayer);

In the header declaration.

On Sunday, August 30, 2009, Jonathan Murphy <[email protected]> wrote:
> I don't have an SDK with me but there should be a set of macros used
> to declare a factory for new entities.
>
> On Sunday, August 30, 2009, Bob Somers <[email protected]> wrote:
>> So just do a global find/replace on CSDKPlayer to CMyPlayer?
>>
>> --Bob
>>
>>
>>
>> On Sat, Aug 29, 2009 at 5:35 PM, Stephen Swires<[email protected]> 
>> wrote:
>>> The official way to do this with the template is to copy all the SDK stuff
>>> and rename it to what you want
>>>
>>> On Sun, Aug 30, 2009 at 1:31 AM, Bob Somers <[email protected]> wrote:
>>>
>>>> Hello all.
>>>>
>>>> So I'm trying to create a custom player by deriving it from CSDKPlayer,
>>>> like so:
>>>>
>>>> class CMyPlayer : public CSDKPlayer
>>>> {
>>>>   // player things
>>>> };
>>>>
>>>> I've got both the server and client players skeleton class build, I've
>>>> linked the class to the player entity with LINK_ENTITY_TO_CLASS, and
>>>> setup a simple send/recv table that just networks one boolean
>>>> temporarily.
>>>>
>>>> Lastly, I edited the _client.cpp file to instantiate a an instance of
>>>> my CMyPlayer class instead of CSDKPlayer when creating new players.
>>>>
>>>> However, now when I run the mod I break at an assertion:
>>>>
>>>> File: game\server\util.cpp
>>>> Line: 144
>>>> Assertion Failed: FindFactory(pClassName) == NULL
>>>>
>>>> I looked into it a bit and it looks the server keeps a dictionary of
>>>> entity factories for producing entities of certain types. My guess is
>>>> that it can't find a factory to build my custom player class. I tried
>>>> looking for an example of building a CEntityFactory for it, but
>>>> couldn't find anything. Is this something I need to build myself and
>>>> call InstallFactory(), or should one of the macros be creating that?
>>>>
>>>> Lastly, am I doing something horribly wrong? i.e. should not be
>>>> subclassing CSDKPlayer? Thanks.
>>>>
>>>> --Bob
>>>>
>>>> _______________________________________________
>>>> To unsubscribe, edit your list preferences, or view the list archives,
>>>> please visit:
>>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>>
>>>>
>>>
>>>
>>> --
>>> - Stephen Swires
>>> _______________________________________________
>>> 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
>>
>>
>
> --
> Programmer for Resistance and Liberation
> http://www.resistanceandliberation.com
> Programmer for Red Tribe
> http://www.redtribe.com
>

-- 
Programmer for Resistance and Liberation
www.resistanceandliberation.com
Programmer for Red Tribe
www.redtribe.com

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

Reply via email to