Raised This Month: $2 Target: $400
 0% 

Solved "Bouncing" Props


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chrissy
Member
Join Date: May 2013
Old 06-07-2020 , 16:45   "Bouncing" Props
Reply With Quote #1

I'm simply trying to create a prop which acts like a bouncy ball. I know it's possible to simulate bouncing as I've done it before but can't for the life of me remember what I did.

I've tried "prop_physics" with no success and now I'm trying "prop_physics_multiplayer" but I can't even get the prop to appear... I imagine the souce engine has something which can do what I need but I just need some guidance since I'm not very versed with props. Thanks

PHP Code:
int Prop CreateEntityByName("prop_physics_multiplayer");
    
    if(
IsValidEntity(Prop))
    {
        
PrintToChatAll("Poo");
        
        
float vAngles[3], vEyePos[3], vEndPos[3];
        
        
GetClientEyePosition(ClientvEyePos);
        
GetClientEyeAngles(ClientvAngles);

        
Handle trace TR_TraceRayFilterEx(vEyePosvAnglesMASK_SHOTRayType_InfiniteTraceFilterAllEntitiesClient);

        
TR_GetEndPosition(vEndPostrace);

        
delete trace;
        
        
DispatchKeyValue(Prop"model""models/props/cs_italy/orange.mdl");
        
DispatchKeyValue(Prop"phyicsmode""2");
        
DispatchKeyValue(Prop"massScale""1.0");
        
        
DispatchSpawn(Prop);
        
        
//SetEntityMoveType(Prop, MOVETYPE_FLY);
        
        
vEndPos[2] += 20.0;
                    
        
TeleportEntity(PropvEndPosNULL_VECTORNULL_VECTOR);
    } 

Last edited by Chrissy; 06-14-2020 at 06:52. Reason: Solved
Chrissy is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Old 06-07-2020 , 17:18   Re: "Bouncing" Props
Reply With Quote #2

m_flElasticity
kadet.89 is offline
Send a message via Skype™ to kadet.89
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 06-08-2020 , 05:48   Re: "Bouncing" Props
Reply With Quote #3

you may find this helpfull in the future
https://raw.githubusercontent.com/Dr...o/netprops.txt
__________________
kratoss1812 is offline
Chrissy
Member
Join Date: May 2013
Old 06-08-2020 , 07:57   Re: "Bouncing" Props
Reply With Quote #4

Quote:
Originally Posted by kadet.89 View Post
m_flElasticity
Couldn't get "prop_physics_multiplayer" to spawn so I just used "prop_physics" but the property doesn't really do anything as far as I can tell. Tried both very low and very high float values.

EDIT: This is what I've done and it doesn't work for some reason.
PHP Code:
int Prop CreateEntityByName("prop_physics");
    
    if(
IsValidEntity(Prop))
    {
        
PrintToChatAll("Podo");
        
        
float vAngles[3], vEyePos[3], vEndPos[3];
        
        
GetClientEyePosition(ClientvEyePos);
        
GetClientEyeAngles(ClientvAngles);

        
Handle trace TR_TraceRayFilterEx(vEyePosvAnglesMASK_SHOTRayType_InfiniteTraceFilterAllEntitiesClient);

        
TR_GetEndPosition(vEndPostrace);
        
vEndPos[2] += 200.0;

        
delete trace;
        
        
DispatchKeyValue(Prop"model""models/props/cs_italy/orange.mdl");
        
        
DispatchSpawn(Prop);
        
        
SetEntPropFloat(PropProp_Send"m_flModelScale"3.0);
        
SetEntPropFloat(PropProp_Send"m_flElasticity"0.2);
        
        
TeleportEntity(PropvEndPosNULL_VECTORNULL_VECTOR);
    } 

Last edited by Chrissy; 06-08-2020 at 08:05.
Chrissy is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Old 06-10-2020 , 19:39   Re: "Bouncing" Props
Reply With Quote #5

I now see in CSGO m_flElasticity is only used for CBaseCSGrenadeProjectile, to make smoke, he and other projectiles bounce. It doesn't work for physics props
You could create a he projectile, block the countdown (m_flDetonateTime) and change the model, it will be just like physics prop.

These entity types can be used:
hegrenade_projectile
flashbang_projectile
molotov_projectile
tagrenade_projectile (not sure about this one)
smokegrenade_projectile
Btw it is safe to change projectile classname in OnEntityCreated to any, even prop_physics

Or you can implement own CBaseCSGrenadeProjectile::ResolveFlyCollision Custom for physics_prop

Last edited by kadet.89; 06-10-2020 at 19:49.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Chrissy
Member
Join Date: May 2013
Old 06-14-2020 , 06:45   Re: "Bouncing" Props
Reply With Quote #6

Quote:
Originally Posted by kadet.89 View Post
I now see in CSGO m_flElasticity is only used for CBaseCSGrenadeProjectile, to make smoke, he and other projectiles bounce. It doesn't work for physics props
You could create a he projectile, block the countdown (m_flDetonateTime) and change the model, it will be just like physics prop.

These entity types can be used:
hegrenade_projectile
flashbang_projectile
molotov_projectile
tagrenade_projectile (not sure about this one)
smokegrenade_projectile
Btw it is safe to change projectile classname in OnEntityCreated to any, even prop_physics

Or you can implement own CBaseCSGrenadeProjectile::ResolveFlyCollision Custom for physics_prop
Interesting idea. However I resorted to using a particle system instead. I never did get prop_phyics_multiplayer to spawn but that's for another day.

Thank you all
Chrissy 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 06:15.


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