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

[Tutorial] Creating brush entities


Post New Thread Reply   
 
Thread Tools Display Modes
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-29-2013 , 06:46   Re: [Tutorial] Creating brush entities
Reply With Quote #51

You can scale prop_physics objects, you just have to do it before you activate them.
If you use this method on large/complex objects, it will lag the server as it does the calculation.
If you kill the entity (Acceptentiyinput(ent, "kill)) without setting the model scale back to 1.0, it will crash your server.

If you scale it after you activateentity the server will use the physics of the prescaled model.

Your best bet is to make the thing nonsolid, and parent it to something that is.
__________________
Profile - Steam Group - Plugins - Blog - Donate
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 05-29-2013 at 06:47.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-30-2013 , 11:22   Re: [Tutorial] Creating brush entities
Reply With Quote #52

Quote:
Originally Posted by friagram View Post
You can scale prop_physics objects, you just have to do it before you activate them.
If you use this method on large/complex objects, it will lag the server as it does the calculation.
If you kill the entity (Acceptentiyinput(ent, "kill)) without setting the model scale back to 1.0, it will crash your server.

If you scale it after you activateentity the server will use the physics of the prescaled model.

Your best bet is to make the thing nonsolid, and parent it to something that is.
prop_physics is a point entity, not a brush entity.
__________________
Am I back? Well, we'll see.
Powerlord is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-31-2013 , 02:45   Re: [Tutorial] Creating brush entities
Reply With Quote #53

I'm well aware, my response was regarding:


Quote:
Originally Posted by TnTSCS View Post
This started me down a path I hope would allow me to do something, but turns out Source doesn't allow full model scaling...

I was trying to change the size of a prop_physics_multiplayer, but after a few attempts and help from IRC (Drifter and Peace-Maker), it turns out:

<@asherkin> Source doesnt support full model scaling

If anyone has any other ideas how to dynamically set a models size, please advise... or maybe Source will one day support it.
__________________
Profile - Steam Group - Plugins - Blog - Donate
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-31-2013 , 22:33   Re: [Tutorial] Creating brush entities
Reply With Quote #54

Quote:
Originally Posted by friagram View Post
I'm well aware, my response was regarding:
So, you were replying to a post over a year old that is completely outdated anyway.
__________________

Last edited by asherkin; 05-31-2013 at 22:33.
asherkin is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-01-2013 , 10:25   Re: [Tutorial] Creating brush entities
Reply With Quote #55

Quote:
Originally Posted by asherkin View Post
So, you were replying to a post over a year old that is completely outdated anyway.
Shrug, I just looked at the most recent replies, which were.. recent. Didn't bother to check if everything in the thread was. Go yell at the person who grave-dug the post.

Here, have an eagle
__________________
Profile - Steam Group - Plugins - Blog - Donate
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 06-01-2013 at 10:27.
friagram is offline
KnifeLemon
Member
Join Date: Oct 2012
Location: South Korea
Old 10-13-2013 , 11:20   Re: [Tutorial] Creating brush entities
Reply With Quote #56

I cant spawn to func_buyzone


Help Me

Quote:
public Action:Command_Spawn_BuyZone(client, args)
{
decl Float:vAngles[3];
decl Float:vOrigin[3];
decl Float:vBuffer[3];
decl Float:vStart[3];
decl Floatistance;
decl Float:position[3];

GetClientEyePosition(client,vOrigin);
GetClientEyeAngles(client, vAngles);

//get endpoint for teleport
new Handle:trace = TR_TraceRayFilterEx(vOrigin, vAngles, MASK_SHOT, RayType_Infinite, TraceEntityFilterPlayer);

if(TR_DidHit(trace))
{
TR_GetEndPosition(vStart, trace);
//GetVectorDistance(vOrigin, vStart, false);
Distance = -35.0;
GetAngleVectors(vAngles, vBuffer, NULL_VECTOR, NULL_VECTOR);
position[0] = vStart[0] + (vBuffer[0]*Distance);
position[1] = vStart[1] + (vBuffer[1]*Distance);
position[2] = vStart[2] + (vBuffer[2]*Distance);
CloseHandle(trace);

// Spawn
new ent = CreateEntityByName("func_buyzone");
if (ent != -1)
{
DispatchKeyValue(ent, "pushdir", "0 90 0");
DispatchKeyValue(ent, "speed", "500");
DispatchKeyValue(ent, "spawnflags", "64");
}

DispatchSpawn(ent);
ActivateEntity(ent);

TeleportEntity(ent, position, NULL_VECTOR, NULL_VECTOR);
PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
SetEntityModel(ent, "models/props/cs_office/vending_machine.mdl");

new Float:minbounds[3] = {-100.0, -100.0, 0.0};
new Float:maxbounds[3] = {100.0, 100.0, 200.0};
SetEntPropVector(ent, Prop_Send, "m_vecMins", minbounds);
SetEntPropVector(ent, Prop_Send, "m_vecMaxs", maxbounds);

SetEntProp(ent, Prop_Send, "m_nSolidType", 2);

new enteffects = GetEntProp(ent, Prop_Send, "m_fEffects");
enteffects |= 32;
SetEntProp(ent, Prop_Send, "m_fEffects", enteffects);
}
else
{
PrintHintText(client, "%t", "Wrong entity");
CloseHandle(trace);
}

return (Plugin_Handled);
}
__________________
MY s-low.net Model !

http://s-low.net/forum/viewforum.php...57326b47f0de50

my wordpress model download center

http://knifelemon.wordpress.com/

MY Youtube .CH : http://www.youtube.com/knifelemon
Steam Profile : KnifeLemon ProFile
Skype : knifelemon

Last edited by KnifeLemon; 10-13-2013 at 11:21.
KnifeLemon is offline
Send a message via Skype™ to KnifeLemon
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 10-13-2013 , 15:49   Re: [Tutorial] Creating brush entities
Reply With Quote #57

PHP Code:
DispatchKeyValue(ent"pushdir""0 90 0");
            
DispatchKeyValue(ent"speed""500");
            
DispatchKeyValue(ent"spawnflags""64"); 
those keyvalues are for the trigger_push from the snippet i posted, you need the keyvalues for the buyzone, looking at the valve wiki and datamap dump you should only need

PHP Code:
DispatchKeyValue(ent"team""value"); 
where value is which team can use it
Code:
0-None
1-All Teams
2-Terrorist
3-Counter-Terrorist
blodia is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 12-27-2013 , 12:43   Re: [Tutorial] Creating brush entities
Reply With Quote #58

Is possible to make more complex brush entity? Not just rectangle but eg. "circle" or hexagon (type of platform shape)?

Last edited by KissLick; 12-27-2013 at 12:44.
KissLick is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 12-28-2013 , 12:40   Re: [Tutorial] Creating brush entities
Reply With Quote #59

Quote:
Originally Posted by KissLick View Post
Is possible to make more complex brush entity? Not just rectangle but eg. "circle" or hexagon (type of platform shape)?
I think you'd need already compiled circle / hexagon model for that
__________________
...
Oshizu is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 12-28-2013 , 14:28   Re: [Tutorial] Creating brush entities
Reply With Quote #60

My first guess was that

PHP Code:
SetEntityModel(ent"models/props/cs_office/vending_machine.mdl"); 
sets the model for collisions and

PHP Code:
SetEntPropVector(entProp_Send"m_vecMins"minbounds);
SetEntPropVector(entProp_Send"m_vecMaxs"maxbounds); 
sets dimensions of this model.

But I am not sure of that, because:
Quote:
Originally Posted by blodia
must set a model on the entity, it doesn't matter which as it won't be visible
Maybe set
PHP Code:
SetEntProp(entindexProp_Send"m_nSolidType"2); 
to another value.. not sure of that..

And I do not know about any option how to "import" bsp to another map..
KissLick 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 00:10.


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