AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Creating instance of a Class in server.dll (https://forums.alliedmods.net/showthread.php?t=145467)

joel93 12-16-2010 11:55

Creating instance of a Class in server.dll
 
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?

API 12-16-2010 13:49

Re: Creating instance of a Class in server.dll
 
Do you mean creating an additional factory? Or just getting the instance of the existing factory?

joel93 12-16-2010 13:57

Re: Creating instance of a Class in server.dll
 
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.

pRED* 12-17-2010 13:50

Re: Creating instance of a Class in server.dll
 
What is T in this example? Every existing entity type should already have a factory instance that will be in the dictionary.

joel93 12-17-2010 14:16

Re: Creating instance of a Class in server.dll
 
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.

API 12-18-2010 02:35

Re: Creating instance of a Class in server.dll
 
Look at CEntity. You can thank pRED ;]

voogru 12-19-2010 04:37

Re: Creating instance of a Class in server.dll
 
Quote:

Originally Posted by pimpinjuice (Post 1373312)
Look at CEntity. You can thank pRED ;]

cough cough.

API 12-19-2010 18:40

Re: Creating instance of a Class in server.dll
 
And voogru!

joel93 12-20-2010 07:13

Re: Creating instance of a Class in server.dll
 
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?

asherkin 12-20-2010 07:36

Re: Creating instance of a Class in server.dll
 
You need updated gamedata.
You can copy the centity.games.txt from TFDodgeball.


All times are GMT -4. The time now is 11:02.

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