Raised This Month: $32 Target: $400
 8% 

Creating instance of a Class in server.dll


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joel93
New Member
Join Date: Dec 2010
Old 12-16-2010 , 11:55   Creating instance of a Class in server.dll
Reply With Quote #1

hi,

i want to make an instance of CEntityFactory< T > in my sourcemod extension, well i have no idea how to handle this specific case .
can you show me a way to manage this?
joel93 is offline
API
Veteran Member
Join Date: May 2006
Old 12-16-2010 , 13:49   Re: Creating instance of a Class in server.dll
Reply With Quote #2

Do you mean creating an additional factory? Or just getting the instance of the existing factory?
__________________
API is offline
Send a message via AIM to API
joel93
New Member
Join Date: Dec 2010
Old 12-16-2010 , 13:57   Re: Creating instance of a Class in server.dll
Reply With Quote #3

i "just" want to create an additional factory.

i know that the factory will then automatically add itself to the dictionary, as its supposed to do so cause of its constructor.
joel93 is offline
pRED*
Join Date: Dec 2006
Old 12-17-2010 , 13:50   Re: Creating instance of a Class in server.dll
Reply With Quote #4

What is T in this example? Every existing entity type should already have a factory instance that will be in the dictionary.
pRED* is offline
joel93
New Member
Join Date: Dec 2010
Old 12-17-2010 , 14:16   Re: Creating instance of a Class in server.dll
Reply With Quote #5

well, then the whole story.
i want to create a new(not just instance) server-side entity in my plug-in.
So T is basically a type/class in my binary.
joel93 is offline
API
Veteran Member
Join Date: May 2006
Old 12-18-2010 , 02:35   Re: Creating instance of a Class in server.dll
Reply With Quote #6

Look at CEntity. You can thank pRED ;]
__________________
API is offline
Send a message via AIM to API
voogru
Inspector Javert
Join Date: Oct 2004
Old 12-19-2010 , 04:37   Re: Creating instance of a Class in server.dll
Reply With Quote #7

Quote:
Originally Posted by pimpinjuice View Post
Look at CEntity. You can thank pRED ;]
cough cough.
voogru is offline
API
Veteran Member
Join Date: May 2006
Old 12-19-2010 , 18:40   Re: Creating instance of a Class in server.dll
Reply With Quote #8

And voogru!
__________________
API is offline
Send a message via AIM to API
joel93
New Member
Join Date: Dec 2010
Old 12-20-2010 , 07:13   Re: Creating instance of a Class in server.dll
Reply With Quote #9

mh i tried the framework, but tf crashes when i start my extension on autoload. and even if i load it after i joined it crashes after about 30 seconds.
if i load it using the server console and no one is playing on the server it doesnt crash.

Has anyone investigated this before?
joel93 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 12-20-2010 , 07:36   Re: Creating instance of a Class in server.dll
Reply With Quote #10

You need updated gamedata.
You can copy the centity.games.txt from TFDodgeball.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode