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

[CS:GO] How to spawn a smoke grenade effect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 02-24-2016 , 17:53   [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #1

I've looked around, but haven't found a solid example on spawning a smoke (the kind a smoke grenade creates). Not sure if I should be looking toward the particle system or temporary entities for this.

Ideally I just want to spawn the smoke exactly as thrown from a smoke grenade at given coordinates. Even better would being able to adjust the duration of it.
__________________
splewis is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 02-24-2016 , 20:50   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #2

I explored this a bit awhile back but never got to the point of mimicking the underlying effect that well. Ended up using an env_smokestake which looks quite a bit different. A few things I would try are spawning the weapon_smokegrenade and AcceptEntityInput(smokegrenade, "FireUser1")

The underlying effect is from the env_particlesmokegrenade entity, so it may be possible to create this, giving it the smoke material, materials/particle/...?, etc.
__________________

Last edited by databomb; 02-24-2016 at 20:50.
databomb is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-25-2016 , 03:40   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #3

Ive done blood spatter particals by just using the partical name.

If you use the partical viewer in the sdk can you find the smoke partical effect?
__________________
Neuro Toxin is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-25-2016 , 05:55   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #4

Couldn't you just spawn a smoke grenade and detonate it right there?
PartialCloning is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 02-25-2016 , 10:56   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #5

As the other said you could simply use a smoke grenade and detonate it, but here is another solution which works too. The smoke is a bit different from the smoke grenades

int SmokeIndex = CreateEntityByName("env_particlesmokegrenade" );
if (SmokeIndex != -1 && iEntity != -1)
{
SetEntProp(SmokeIndex, Prop_Send, "m_CurrentStage", 1);
SetEntPropFloat(SmokeIndex, Prop_Send, "m_FadeStartTime", fadestart);
SetEntPropFloat(SmokeIndex, Prop_Send, "m_FadeEndTime", fadeend);
DispatchSpawn(SmokeIndex);
ActivateEntity(SmokeIndex);
TeleportEntity(SmokeIndex, vec, NULL_VECTOR, NULL_VECTOR);
__________________
zipcore is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 02-25-2016 , 12:10   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #6

Dr.api made a color smoke plugin before.
but this plugin didn't work anymore after valve change smoke_detonate event
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 02-25-2016 , 14:53   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #7

Thanks, I'll try these out.
__________________
splewis is offline
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 02-26-2016 , 18:17   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #8

My attempt at detonating one normally spawns the grenade, but doesn't set it off (I can pick it up and detonate it myself)

Code:
float vec[3] = {-670.0, -1630.0, -104.77};
int ent = CreateEntityByName("weapon_smokegrenade");
DispatchSpawn(ent);
ActivateEntity(ent);
TeleportEntity(ent, vec, NULL_VECTOR, NULL_VECTOR);
bool success = AcceptEntityInput(ent, "FireUser1");
LogMessage("sent smoke, success = %d", success);
This does print "success = 1". Using FireUser 2-4 also didn't work, nor did passing myself as the 3rd arg (activator) to AcceptEntityInput. Any help would be appreciated.

zipcore's approach does get me a smoke effect, but I'd have to get all the properties tweaked for it to look normal.
__________________

Last edited by splewis; 02-26-2016 at 18:18.
splewis is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 11-11-2016 , 08:54   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #9

Anyone any progress on this?

Still looking to make a "env_particlesmokegrenade" looking like a real smoke.
__________________
ImACow is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 11-11-2016 , 12:17   Re: [CS:GO] How to spawn a smoke grenade effect
Reply With Quote #10

One way to do this:
PHP Code:
int entity CreateEntityByName("smokegrenade_projectile");
TeleportEntity(entityoriginNULL_VECTORNULL_VECTOR);
DispatchSpawn(entity); 
when you want it to explode:
PHP Code:
SetEntProp(entityProp_Send"m_nSmokeEffectTickBegin"GetGameTickCount()); 
Things to keep in mind:
- The grenade will keep moving
- Smoke sound will not be made
- You will get "faded" screen when you get close to the grenade after it exploded. It stays until you remove the grenade, so when smoke disappears you will still get faded screen when you walk into it as grenade stays.
- The smoke doesn't follow the grenade
__________________
Deathknife 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 20:55.


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