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

Custom entities?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Matheus28
Senior Member
Join Date: Aug 2009
Old 11-13-2009 , 16:58   Custom entities?
Reply With Quote #1

Can I give the mappers, the ability to create a custom entity like func_nobuildfw (brush entity)?

How Can I detect these entities in my plugin?
Matheus28 is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-13-2009 , 17:31   Re: Custom entities?
Reply With Quote #2

Custom entities can't be made without some serious extension work.
bl4nk is offline
Matheus28
Senior Member
Join Date: Aug 2009
Old 11-13-2009 , 17:51   Re: Custom entities?
Reply With Quote #3

But if I just want to make a brush entity (no keyvalues, nothing, just a brush entity), I'll need to make a extension?
Matheus28 is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 11-13-2009 , 20:15   Re: Custom entities?
Reply With Quote #4

It's possible to modify entities in a map before it loads (modifying BSP loaded in memory). Stripper: Soruce do this, so maybe it's possible to add stuff too.

But this is not for beginners.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 11-13-2009 , 21:05   Re: Custom entities?
Reply With Quote #5

Quote:
Originally Posted by Matheus28 View Post
Can I give the mappers, the ability to create a custom entity like func_nobuildfw (brush entity)?
Supply the mappers with a custom .fgd file containing the properties and whatnot of your entity.

Quote:
Originally Posted by Matheus28 View Post
How Can I detect these entities in my plugin?
Quote:
Originally Posted by rhelgeby View Post
It's possible to modify entities in a map before it loads (modifying BSP loaded in memory). Stripper: Soruce do this, so maybe it's possible to add stuff too.
You got 2 chances on reading (and modifying) bsp data.
1) hook CBaseEntity::KeyValue() and parse the input given to detect your custom classname. You then need to rename the classname to something valid or else your entity will be dropped upon reaching the engine (since its of invalid entity class)
2) the SDK Hooks extension exposes raw bsp data in its OnLevelInit forward. Have fun manipulating it.

Personally I think #1 is easier to manage but since theres no extension available for public that hooks the function, you're pretty much left with #2.

Quote:
Originally Posted by rhelgeby View Post
But this is not for beginners.
__________________
plop

Last edited by p3tsin; 11-13-2009 at 21:11.
p3tsin is offline
MockingBird
Member
Join Date: Mar 2005
Old 11-13-2009 , 22:45   Re: Custom entities?
Reply With Quote #6

What do you need it for? There is probably an easier way to do what ever your thinking of doing
MockingBird is offline
pRED*
Join Date: Dec 2006
Old 11-14-2009 , 03:07   Re: Custom entities?
Reply With Quote #7

CEntity can hook entities being created and will switch the classname out for one that actually exists.

Adding hooks for keyvalues wouldn't be hard, it's on my todo list but I haven't had a need yet.
pRED* is offline
Matheus28
Senior Member
Join Date: Aug 2009
Old 11-14-2009 , 07:26   Re: Custom entities?
Reply With Quote #8

I need to make a area that the players cannot create props (In my plugin, you can create props)
Matheus28 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 13:33.


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