Raised This Month: $51 Target: $400
 12% 

Entity colosion with player work ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-15-2014 , 07:35   Entity colosion with player work ?
Reply With Quote #1

Can a entity with this model : "models/weapons/c_models/c_caber/c_caber.mdl" collide with player ?

Because I tryed almost everything and any of those lines seems to work :
PHP Code:
SetEntPropEnt(PropProp_Send"m_hEffectEntity"iClient);
DispatchKeyValue(Prop"solid""6");
SetEntProp(PropProp_Send"m_usSolidFlags"152);
SetEntProp(PropProp_Send"m_CollisionGroup"); 
Also, it doesn't seems to start a 'touch event' when the entity touch the ground.
__________________
Want to check my plugins ?
Arkarr is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 03-15-2014 , 10:28   Re: Entity colosion with player work ?
Reply With Quote #2

Probably just wrong flags or model.

This might be helpful: https://forums.alliedmods.net/showpo...52&postcount=4
__________________
luki1412 is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-15-2014 , 11:06   Re: Entity colosion with player work ?
Reply With Quote #3

Which entity?

prop_dynamic/prop_physics should have collisions with the Caber model (on TF2, by the way) as long as you leave the other stuff alone...I've also found that for prop entities (both, I think) setting m_hOwnerEntity will cause the set owner to be able to walk through it. Not sure if the same thing happens with m_hEffectEntity.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-15-2014 , 13:11   Re: Entity colosion with player work ?
Reply With Quote #4

@luki1412
Yup, thanks, already saw.

@MasterOfTheXP
If I understand correctly, this should work ?

PHP Code:
new Float:position[3];
GetClientEyePosition(iClientposition);
position[2] += 60//Spawn upon player head

new Prop CreateEntityByName("prop_physics");//CreateEntityByName("prop_physics_override"); _override needed for velocity and other stuff ? Because if prop_physics won't move, right ?
    
    
if(IsValidEntity(Prop))
    {        
        
SetEntityModel(PropMODEL_PROP);
        
//SetEntPropEnt(Prop, Prop_Send, "m_hEffectEntity", iClient);
        //DispatchKeyValue(Prop, "solid", "6");
        //SetEntProp(Prop, Prop_Send, "m_usSolidFlags", 152);
        //SetEntProp(Prop, Prop_Send, "m_CollisionGroup", 8 );
        
DispatchKeyValue(Prop"StartDisabled""false");
        
DispatchSpawn(Prop);
        
        
TeleportEntity(ProppositionNULL_VECTORNULL_VECTOR);
        
        
DispatchKeyValue(Prop"ExplodeRadius""150");
        
DispatchKeyValue(Prop"ExplodeDamage""100");
        
//SetEntProp(Prop, Prop_Send, "m_nSolidType", 6);
        //SetEntProp(Prop, Prop_Data, "m_takedamage", 2);
        //SetEntProp(Prop, Prop_Data, "m_iMaxHealth", 1);
        
        
AcceptEntityInput(Prop"Enable");
    } 
__________________
Want to check my plugins ?

Last edited by Arkarr; 03-15-2014 at 13:12.
Arkarr is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-15-2014 , 13:59   Re: Entity colosion with player work ?
Reply With Quote #5

That should work, although you'll probably need to replace Enable with TurnOn (since you're setting StartDisabled to false anyway...even though it defaults to false... )

Watch out for that += 60 at the top, too, which should be 60.0 since position is a vector.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-15-2014 , 14:30   Re: Entity colosion with player work ?
Reply With Quote #6

Well, thanks but it's seems like prop_physcis is doing some magical stuff !
My entity doesn't spawn (or at least it's invisible and I can't touch it) !

here is my full code :
Spoiler
__________________
Want to check my plugins ?

Last edited by Arkarr; 03-15-2014 at 14:37.
Arkarr is offline
rswallen
SourceMod Donor
Join Date: Jun 2013
Location: 127.0.0.1
Old 03-15-2014 , 14:51   Re: Entity colosion with player work ?
Reply With Quote #7

The caber is not physics-enabled
rswallen is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-15-2014 , 14:59   Re: Entity colosion with player work ?
Reply With Quote #8

Quote:
Originally Posted by rswallen View Post
The caber is not physics-enabled
Damn, and let me guess, no way to enable it ?
__________________
Want to check my plugins ?
Arkarr is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-15-2014 , 15:00   Re: Entity colosion with player work ?
Reply With Quote #9

Well, you could probably, like, parent it to a prop that does have the proper/desired physics, and then make that prop invisible...but that's not really ideal.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 03-15-2014 , 15:32   Re: Entity colosion with player work ?
Reply With Quote #10

Valve actually recommends parenting to get physics and other functions (at least on the wiki which everyone can edit I guess so it is not always actually our beloved Volvo).
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 03-15-2014 at 15:33.
Dr. Greg House is offline
Reply



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 02:12.


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