[Tutorial] Creating brush entities
1st i'd like to thank foxmulder for reminding me about entity outputs otherwise i never would have bothered trying to get brushes to work.
i've only tested this in css but it should work for any game, most brush entities can be found here http://developer.valvesoftware.com/w...Brush_Entities. not all brush entities will work for different games. please note any brush entities that are created will be invisible as only bsp brush models can be used with brush entities. only box shaped brushes work. heres part of a snippet i used PHP Code:
m_vecMins and m_vecMaxs set the dimensions of the bounding box, they are local coordinates of the entity e.g 0,0,0 will be the entities origin i.e world coordinates of the entity. in my above snippet the box is 200 by 200 by 200. you must set the m_fEffects prop to have the ef_nodraw flag or clients will be spammed with errors in the conole every gameframe for each entity you create that doesn't have the flag. in css i've tested func_buyzone, trigger_hurt, trigger_push and func_conveyor, certain entities might not work you'll have to try for yourself. you can addoutputs to the entities and hook the output so you can call a function whenever the output is fired. e.g you could have a trigger_once/trigger_multiple thats fires a blank output that is hooked, this will allow you to run code on whoever triggered the output. some brush entities would require some kind of visual so you know its there like func_conveyor, since you can't apply models to the brushes you could spawn a prop_dynamic, make it non solid(depending on what brush entity you're using) and parent it to the brush and set the brush bounds to the same as the model. this way you can spawn working doors, switches, moving platforms and rotating props. that should be useful for sandbox mods and fun stuff, in css you could create a bomb zone anywhere allowing players to plant c4 where ever they want. |
Re: [Tutorial] Creating brush entities
I've been wondering how to do this for a while.
Thanks! :crab::crab::crab: |
Re: [Tutorial] Creating brush entities
Good job dude
How did you figure it out? |
Re: [Tutorial] Creating brush entities
thanks, over the years i've spent a lot of time in the source sdk and on valves wiki checking out different entities. i know from experience that if someone says something isn't possible not to take their word for it. it takes time and patience to get certain things working. also i prefer to mess with things people wouldn't bother with.
|
Re: [Tutorial] Creating brush entities
How did you find out about the m_vecMins and m_vecMaxs?
|
Re: [Tutorial] Creating brush entities
i tested most netprops/dataprops over the years as i wanted to know what they did in case i ever needed them. the name gave some clue to what it did, you can use it to change the bounding box on any entity, be warned some entities will reset it r.g player bounding boxes are reset in one of the thinks, its resized depending on player movement e.g standing or crouching.
|
Re: [Tutorial] Creating brush entities
Always good to know that xD Also you can use SDKHooks' ThinkPost to change the bounding box on entitys like that.
|
Re: [Tutorial] Creating brush entities
Nice job, B!
|
Re: [Tutorial] Creating brush entities
Quote:
Without 'em, collision is not there, or it errors. |
Re: [Tutorial] Creating brush entities
hi guys ive been trying to learn how to mod. ive been following the valve tutorials at developer.valvesoftware.com/wiki. But I am stuck on the section that teaches you how to author a brush entity http://developer.valvesoftware.com/w...a_Brush_Entity
Apparently I dont have the triggers.h and triggers.cpp files which are needed for functions that allow you to play with brush entities. So basically I can't program my brush entities. So i was wondering is this tutorial like an alternative to teaching us how to program brush entities? |
Re: [Tutorial] Creating brush entities
this section is for source pawn related tutorials and snippets, you're better off asking in the metamod:source section.
|
Re: [Tutorial] Creating brush entities
Could one spawn working ladders?
|
Re: [Tutorial] Creating brush entities
i haven't tried but i don't think you can, in the wiki it mentions "This is an internal entity. When the map is compiled by VBSP it is processed and then removed: it does not exist when the map is running." its the same with some other entities.
|
Re: [Tutorial] Creating brush entities
Great work, this will be extremely useful!
|
Re: [Tutorial] Creating brush entities
This tutorial helped me allot. Thank you blodia !
|
Re: [Tutorial] Creating brush entities
Wow! You've done an impossible thing. Nice!
|
Re: [Tutorial] Creating brush entities
anyone try trigger_teleport ?
PHP Code:
|
Re: [Tutorial] Creating brush entities
i would try and test/fix it for you but unfortunately since the css update i haven't been able to get the steam srcds or the standalone working so i can't do anything until its fixed.
do you get any errors? have you tried TeleportEntity instead of setting the origin and angles keyvalue. you also don't need to set the classname keyvalue. although it shouldn't matter try creating the info_teleport_destination before the trigger_teleport |
Re: [Tutorial] Creating brush entities
my bad it's work
PHP Code:
PHP Code:
|
Re: [Tutorial] Creating brush entities
Quote:
i try but nothing PHP Code:
|
Re: [Tutorial] Creating brush entities
it again me :|
possible to set texture on brush ? or make it visible ? |
Re: [Tutorial] Creating brush entities
you can't do that as that requires bsp models. closest you can do it place a prop_dynamic as mentioned in the first post or maybe an env_sprite_oriented for each face of the brush.
|
Re: [Tutorial] Creating brush entities
Nice work! I played around with this once, but I was trying to rely on the bounds for the model I was using and never thought to change the min/max stuff.
|
Re: [Tutorial] Creating brush entities
try that, spawn model and get
PHP Code:
|
Re: [Tutorial] Creating brush entities
Hey guys, I'm not much of a coder, but I was wondering how I could go about putting a brush entity, func_nobuild into a map? If anyone would like to help It would be greatly appreciated.
|
Re: [Tutorial] Creating brush entities
hmm, how do i rotate a trigger_push brush? rotating the entity with teleportentity changes the direction you are being pushed, but not the area.
|
Re: [Tutorial] Creating brush entities
alinayg edit the code snippet in the first post to make a func_nobuild instead of trigger_push and remove the keyvalues. then you just need a way to trigger the code, you could use it on map start or admin/server command.
Thrawn the engine probably handles rotation for entities using the bounding box, i'm guessing since brushes wouldn't normally be using the bounding box they're not updated when the entity is rotated. |
Re: [Tutorial] Creating brush entities
1 Attachment(s)
so i'd have to adapt the bounding box manually.
i'm assuming the minVec and maxVec are vectors pointing at two opposites corners of the cube. i need to rotate those. because i dont want rotation along the z axis, i can reduce the problem to 2d. i thought this should do the trick (read about it here). it's pretty basic maths, but it doesnt work the way expected. PHP Code:
or no area at all, i guess thats because sometimes the minvec values are larger than the maxvec values. i dont know - i'm stuck. i attached the test-plugin i'm using to debug this. it draws on the floor how the square should look like. |
Re: [Tutorial] Creating brush entities
i've been looking into this more, it seems m_nSolidType 2 is an axis-aligned bounding box so it can't be rotated, its aligned to the world axis and will normally grow/shrink to fit the model.
m_nSolidType 3 is an orientated bounding box which is what you need but looking in const.h of the sdk files it seems its not implemented. http://developer.valvesoftware.com/wiki/Bounding_volume http://developer.valvesoftware.com/wiki/Bounding_box |
Re: [Tutorial] Creating brush entities
huhm, thanks for those infos, makes sense now. :up:
it seems SOLID_OBB isnt implemented, but SOLID_OBB_YAW is. and since i only want to rotate it around the z-axis this could work for me. i'll have a try. EDIT: SOLID_OBB puts an aligned square around the actual rotated bounding box. SOLID_BBOX does not rotate at all. SOLID_OBB_YAW does not work at all :cry: http://thrawn.einfachonline.net/imag...6_08_03_37.jpg |
Re: [Tutorial] Creating brush entities
sorry i don't know what else you could try, guess its another drawback of this method.
|
Re: [Tutorial] Creating brush entities
What could cause a spawned brush to not show up at all, without any errors?
|
Re: [Tutorial] Creating brush entities
Wow, I didn't think this was possible! Has anyone tried using a func_precipitation to see if it can rain/snow? Or is this something that isn't possible to spawn after the map starts?
|
Re: [Tutorial] Creating brush entities
Quote:
|
Re: [Tutorial] Creating brush entities
Quote:
|
Re: [Tutorial] Creating brush entities
Quote:
I know there wouldn't be a texture (the noentry one) because you need to set it in Hammer, but it should at least block the people of a different team. (I set the respawnroomname correctly, and enabled it, but no luck) |
Re: [Tutorial] Creating brush entities
have you set "solid_to_enemies" to 1 and "Solidity" to 1.
|
Re: [Tutorial] Creating brush entities
blodia, if we wanted a larger area than 100x100x100, must we pick a model that covers that larger brush? Say 1000x1000x1000 for example, has issues. Also, has anyone experienced a problem where players become stuck inside of certain brush entities that aren't drawn and aren't solid (e.g. func_precipitation.)
|
Re: [Tutorial] Creating brush entities
it shouldn't matter which model you use and you should be able to use any size brush.
|
Re: [Tutorial] Creating brush entities
I did set solid_to_enemies, but I didn't touch Solidity, as I assumed SolidType already dealt with that.
But this being limited to being parallel to the axes, I can't really use it anymore :/ |
All times are GMT -4. The time now is 02:31. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.