Raised This Month: $32 Target: $400
 8% 

Solved [L4D2]Shockwave?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 11-22-2022 , 14:05   [L4D2]Shockwave?
Reply With Quote #1

does anyone know how to create a shockwave?

like in this video:


i wanted to put in explosions and impacts of something

I was trying to create with CreateTimer but it turned out a little good


PHP Code:
float vPos[3], Pos[3];

blah blah blah //take the position of the entity

CreateTimer(GetVectorDistance(vPosPos)/5000.0ShockWaveentity); //the distance will be divided with some speed of sound or explosion (time = distance divided by speed <- this is in physics). 5000 is velocity mach 4. 

//Let's assume that the speed is mach 4(5000 km/h) and the distance is 1000 units(from the game, when we take a distance), this will give 0.2 seconds for the effect of the shock wave to affect the entity


Action ShockWave(Handle timerint entity)
{
//what will happen to the entity

__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube

Last edited by King_OXO; 12-04-2022 at 18:50.
King_OXO is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 11-22-2022 , 14:16   Re: [L4D2]Shockwave?
Reply With Quote #2

I don't think the engine will handle like that. Physics are expensive.

Maybe you can do something with the explosion (env_explosion) or breaking a propane + Gravity Physics extension.
__________________
Marttt is offline
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 11-22-2022 , 14:35   Re: [L4D2]Shockwave?
Reply With Quote #3

Quote:
Originally Posted by Marttt View Post
I don't think the engine will handle like that. Physics are expensive.

Maybe you can do something with the explosion (env_explosion) or breaking a propane + Gravity Physics extension.
the env_explosion does not have a shock wave, I already checked
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube
King_OXO is offline
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 11-22-2022 , 15:05   Re: [L4D2]Shockwave?
Reply With Quote #4

Quote:
Originally Posted by Marttt View Post
I don't think the engine will handle like that. Physics are expensive.

Maybe you can do something with the explosion (env_explosion) or breaking a propane + Gravity Physics extension.
that's what i was talking about, look at the entities below the video. They are thrown back by the "shock wave"

__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube
King_OXO is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 11-22-2022 , 16:46   Re: [L4D2]Shockwave?
Reply With Quote #5

So the video is from your utube channel,

Didn't you already accomplished that, or is some kind of private plugin that you don't have the source code.
__________________

Last edited by Marttt; 11-22-2022 at 16:46.
Marttt is offline
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 11-22-2022 , 16:57   Re: [L4D2]Shockwave?
Reply With Quote #6

Quote:
Originally Posted by Marttt View Post
So the video is from your utube channel,

Didn't you already accomplished that, or is some kind of private plugin that you don't have the source code.
I made the source code myself, I just wanted to improve the code I put in the main topic, like, create a real shock wave, i created with CreateTimer just divide the distance from the explosion or impact site by the speed of the shock wave (any value) and we have the time of the shock wave effect with the entity (like in the video when the cars are thrown backwards). The shock wave I'm talking about is the one that increases in width and distance (but has a range limit) and decreases the effect of chaos like in the main topic video
Attached Files
File Type: sp Get Plugin or Get Source (l4d_nuke_missile.sp - 86 views - 22.8 KB)
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube

Last edited by King_OXO; 11-22-2022 at 17:08.
King_OXO is offline
Skyy
AlliedModders Donor
Join Date: Jan 2010
Location: Toronto, Canada
Old 12-02-2022 , 05:03   Re: [L4D2]Shockwave?
Reply With Quote #7

You can create a "shockwave" effect that can both knock players backwards, as well as give them a little bit (or a lot) of air, using the TeleportEntity method.
You'll need to get the origin point of both the blast point and the player in order to know which angles to push the player at. You can use m_vecOrigin for both players and non-player entities.

It's super easy stuff.
Skyy 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 23:07.


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