Spawning brush entity in LUA

Hi all,

Is it possible for a LUA script to spawn a brush entity (say, a func_wall) and define its shape and materials?

I’ve found a couple of posts asking the same thing ~4 years ago, and the responses were discouraging, but I wondered if anything had changed in this regard since then.

is the brush entity type importat or are you just looking for a way to create brushes?

Might wanna check this out:

It is possible I believe, using or , but good luck figuring out the arguments.

Should be the same principles as for the Mesh library.

Thanks for the great pointers guys.

The brush type isn’t especially important. The purpose is simply to create some physical map elements which collide with players & phys props (the idea being that I could script in, say, additional buildings/structures into maps which I don’t have the source for).

You’d better use models for this, do you realize how many shit ( vertices ) you have to write for a simple building?

Like Robotboy655 said, You’re probably better off using 3d models. You can create these shapes and models in Hammer and then use a tool like Propper or something to compile it to .mdl format for easy use.

Thanks again for the advice,

Knowing this is possible, I will likely first try creating some test shapes in lua, and if all works well, I’ll start investigating exporting vertices from Hammer. I don’t plan to place all my vertices by hand :slight_smile: