I've always wondered how to do this, is it possible to whip up your own Hammer FDG that contains stuff for your scripted entity (attributes and all), make a brush and go "ToEntity", set it up how you'd like and then have it appear in the game with the brush geometry and settings from Hammer?
I tried searching but it seems I don't have access to the forum Search button.
It is possible. I might be wrong but I think Onslaught:evolved did this so take a look at that.
I don't know much about it myself but it is possible.
I'm pretty sure you can pack your code with the finished bsp as well.
Editing the FDG is also possible but it's not really necessary either.
Take some other brush based entity and just remove the keyvalues and add your own.
look at how TTT did it
Where does TTT do this?
It is possible, I'm doing this in my soccer map.
TTT does it in all of its maps containing a traitor tester.
if you look in the gamemodes folder on a downloaded server or the gcf under TTT you will find a FDG file containing the entities it uses in its maps.
learn from it
That's how I'm doing it:
[lua]--set the entity base to "base_entity" and the type to "brush"
ENT.Base = "base_entity"
ENT.Type = "brush"[/lua]
Afterwards:
1. Go to Hammer.
2. Create a random brush entity.
3. Replace the random brush entity's name by your entity's name.
4. Set Key/Values and all the other stuff.
5. Have fun with your own brush entity.
The only thing making your own FDG does, AFAIK, is give you human-readable names and type-specific input boxes, both of which you'd have to define anyway.
Unless you're listing a bunch of shit on the entity or you really don't like filling in the key values every time, it's not really worth the hassle of adding them.
[QUOTE=RP-01;38263233]That's how I'm doing it:
[lua]--set the entity base to "base_entity" and the type to "brush"
ENT.Base = "base_entity"
ENT.Type = "brush"[/lua]
Afterwards:
1. Go to Hammer.
2. Create a random brush entity.
3. Replace the random brush entity's name by your entity's name.
4. Set Key/Values and all the other stuff.
5. Have fun with your own brush entity.[/QUOTE]
Worked an absolute treat, thanks man. Let the fun with brushes begin!
What I am interested in: Is it possible to create a brush entity in lua? One that did not exist in the map before?
Well, yeah. Kinda..
You can create or take an already existing model of a certain shape, and use it on your entity. Then you're going to use the ENT.(Start/End)Touch-Hooks -just like you'd do it on a regular brush entity-, and determine how the entity is supposed to interact with the certain types of contact.
Make sure you're using the correct collision group.
Hmmm... I may have hit a snag. The brush entity stays on the server side and doesn't go to the client side. Is that normal or am I missing some code?
It's normal. Point and brush entities are server-side only. Well not exactly, since point entities can be networked using UpdateTransmitState.
[QUOTE=KatNotDinner;38271338]It's normal. Point and brush entities are server-side only. Well not exactly, since point entities can be networked using UpdateTransmitState.[/QUOTE]
I was afraid you'd say that...
Well, when you think about it, Brush entities should be networkable too but only and strictly when you use UpdateTransmitState. Else it can turn into a lag fest, we have enough of these already.
Good to know, thanks man. Looks like I can toggle that if I need to.
You can create your own brush meshes using mesh functions with GMod 13, e.g PhysicsInitConvex to give it physics that you can use for a trigger or something (SetTrigger makes the brush a trigger I think)
SetTrigger allows callling touch functions after setting up collision bounds and then making the entity not solid to players and other entities.
[QUOTE=Tobba;38273129]You can create your own brush meshes using mesh functions with GMod 13, e.g PhysicsInitConvex to give it physics that you can use for a trigger or something (SetTrigger makes the brush a trigger I think)[/QUOTE]
True but I'm aiming to have some zones specified by map makers. Using LUA Meshes would need some external code and I'd rather keep things tidy in one file.
Sorry, you need to Log In to post a reply to this thread.