Raised This Month: $51 Target: $400
 12% 

creating your own entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mooman2
Member
Join Date: Apr 2007
Old 05-26-2007 , 01:41   creating your own entity
Reply With Quote #1

Anyone know how I would go about installing a new entityfactory in the entityfactorydictionary? I've gone as far as linking/hooking the ientityfactory interface, but I can't get it to do what I want.
mooman2 is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 05-26-2007 , 10:03   Re: creating your own entity
Reply With Quote #2

CreateEntityByName
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
mooman2
Member
Join Date: Apr 2007
Old 05-26-2007 , 14:38   Re: creating your own entity
Reply With Quote #3

I know how to do that but when I try something like CreateEntityByName("customentity") it gives

Code:
Attempting to create unknown entity customentity!
I've looked in the SDK and you have to create your own EntityFactory and install it into the dictionary.
mooman2 is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 05-26-2007 , 17:12   Re: creating your own entity
Reply With Quote #4

Oops didn't read your question fully the first time, my mistake.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
BAILOPAN
Join Date: Jan 2004
Old 05-26-2007 , 22:56   Re: creating your own entity
Reply With Quote #5

Remember that you can't truly have your own entity unless it piggy backs off another. You can't modify the send tables server-side and have the client-side tables mismatch.
__________________
egg
BAILOPAN is offline
mooman2
Member
Join Date: Apr 2007
Old 05-26-2007 , 23:43   Re: creating your own entity
Reply With Quote #6

I'm only trying to create an NPC based off CAI_BaseNPC. I'm sure it's all serverside, there's no sendtables but just datadescriptions.
mooman2 is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-27-2007 , 00:07   Re: creating your own entity
Reply With Quote #7

I was on a Japanese server that had head crabs working.

I tried getting it to work by spawning a "monster_generic" but I never could get the AI to work right.
L. Duke is offline
mooman2
Member
Join Date: Apr 2007
Old 05-27-2007 , 00:22   Re: creating your own entity
Reply With Quote #8

Is this Japanese server still online? I might be able to learn something from it.
mooman2 is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-27-2007 , 10:00   Re: creating your own entity
Reply With Quote #9

http://forums.alliedmods.net/showthread.php?t=42912
L. Duke is offline
Functor
Junior Member
Join Date: May 2006
Old 05-28-2007 , 11:27   Re: creating your own entity
Reply With Quote #10

Hi, I am the author of so-called "Japanese server".

I use CAI_BaseNPC for the headcrabs and Gregory the Crazy.
The key is not CreateEntityByName, but New reimplemented by malloc + the initializer function: CAI_BaseNPC::CAI_BaseNPC. It is not quite difficult.
More complex thing is to reimplement its behavior; CAI_BaseNPC is the dumbest NPC, therefore all their base are belong to you(TM).
__________________
Functor is offline
Reply



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 06:44.


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