Raised This Month: $115 Target: $400
 28% 

[Tutorial] Creating brush entities


Post New Thread Reply   
 
Thread Tools Display Modes
flud
Senior Member
Join Date: Jun 2009
Location: Latvija
Old 07-08-2010 , 08:48   Re: [Tutorial] Creating brush entities
Reply With Quote #21

it again me

possible to set texture on brush ? or make it visible ?
__________________
Beware of a terrible language
flud is offline
Send a message via Skype™ to flud
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 07-08-2010 , 09:50   Re: [Tutorial] Creating brush entities
Reply With Quote #22

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.
blodia is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 07-12-2010 , 11:17   Re: [Tutorial] Creating brush entities
Reply With Quote #23

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.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
flud
Senior Member
Join Date: Jun 2009
Location: Latvija
Old 07-12-2010 , 21:39   Re: [Tutorial] Creating brush entities
Reply With Quote #24

try that, spawn model and get
PHP Code:
GetEntPropVector(modelProp_Send"m_vecMins",minbounds);
GetEntPropVector(modelProp_Send"m_vecMaxs",maxbounds); 
for me it work
__________________
Beware of a terrible language
flud is offline
Send a message via Skype™ to flud
alinayg
Senior Member
Join Date: Apr 2009
Location: USA, RI
Old 08-18-2010 , 19:11   Re: [Tutorial] Creating brush entities
Reply With Quote #25

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.
__________________
alinayg is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 08-25-2010 , 09:41   Re: [Tutorial] Creating brush entities
Reply With Quote #26

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.
__________________
einmal mit profis arbeiten. einmal.

Last edited by Thrawn2; 08-25-2010 at 09:46.
Thrawn2 is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 08-25-2010 , 16:55   Re: [Tutorial] Creating brush entities
Reply With Quote #27

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.

Last edited by blodia; 08-25-2010 at 16:57.
blodia is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 08-25-2010 , 17:35   Re: [Tutorial] Creating brush entities
Reply With Quote #28

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:
stock RotateVector(Float:vector[3], Float:rotation) {
    new 
Float:rVector[3];
    
rVector vector;
    
rVector[0] = vector[0] * Cosine(rotation) - vector[1] * Sine(rotation);
    
rVector[1] = vector[0] * Sine(rotation) + vector[1] * Cosine(rotation);
    
vector rVector;

the results are not what they should be, instead of a rotated square i get "random" rectangles.
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.
Attached Files
File Type: sp Get Plugin or Get Source (tTriggerPush.sp - 411 views - 7.8 KB)
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 08-25-2010 , 18:45   Re: [Tutorial] Creating brush entities
Reply With Quote #29

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
blodia is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 08-26-2010 , 01:39   Re: [Tutorial] Creating brush entities
Reply With Quote #30

huhm, thanks for those infos, makes sense now.
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
__________________
einmal mit profis arbeiten. einmal.

Last edited by Thrawn2; 08-26-2010 at 02:23.
Thrawn2 is offline
Reply


Thread Tools
Display Modes

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 22:28.


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