Raised This Month: $7 Target: $400
 1% 

Creating, Parenting, and Constraining Particle Effect to Player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirrwell
Member
Join Date: Jul 2013
Old 08-18-2014 , 05:57   Creating, Parenting, and Constraining Particle Effect to Player
Reply With Quote #1

Sorry if that title is a bit of a mouthful. Basically, what I'm trying to do is make a donator specific plugin that will allow donators to choose a particle effect that they can walk around with, parented to them.

I've got things going for the most part, however when parenting the particle effect to the player, it trails as the player moves until the particles decay. What I want is for the particle system to be constrained to the player so that the ENTIRE system moves with the player.

To better understand, here's how the particles behave now:



What I'm using to create the particle is a slightly modified function from some TF2 particle plugin for projectiles:

Code:
stock CreateParticle(client, String:szParticleEffectName[])
{
	new iParticle = CreateEntityByName("info_particle_system");
	if (IsValidEdict(iParticle))
	{
		decl Float:fPosition[3];
		GetEntPropVector(client, Prop_Send, "m_vecOrigin", fPosition);
		
		TeleportEntity(iParticle, fPosition, NULL_VECTOR, NULL_VECTOR);
		DispatchKeyValue(iParticle, "effect_name", szParticleEffectName);

		SetVariantString("!activator");
		AcceptEntityInput(iParticle, "SetParent", client, iParticle, 0);			

		DispatchSpawn(iParticle);
		ActivateEntity(iParticle);
		AcceptEntityInput(iParticle, "Start");
	}
}
Having that trail is a bit undesirable, as at least in this particular game, you have instances where you need to get away from somebody or they'll kill you. And with a particle effect, well, that makes you that much more of an easy target.

I'm unsure if the issue is with the particle effect itself or if it's with the script. I'd also be interested in doing this with a set of custom particles, however without having a modified particles_manifest.txt (or the ability to download the custom particle effect) it doesn't seem like it can be done. Though I'm sure you can force it to download, I was wondering if maybe it would be possible to append to particles_manifest.txt, as with this particular game, it does not use .vpk files.

Any help is greatly appreciated.

Last edited by Spirrwell; 08-18-2014 at 05:57.
Spirrwell is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 08-19-2014 , 19:31   Re: Creating, Parenting, and Constraining Particle Effect to Player
Reply With Quote #2

I believe that's something set in the particle editor. And without adding particle manifest for each map I don't think you can have custom particles, but that may not apply for your game.
Alienmario is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 08-21-2014 , 07:17   Re: Creating, Parenting, and Constraining Particle Effect to Player
Reply With Quote #3

Sorry, i post in wrong topic. Pls Delete.
__________________



Sorry for my very bad english
Greetings HSFighter

Last edited by HSFighter; 08-21-2014 at 07:20.
HSFighter is offline
Send a message via ICQ to HSFighter
Mehis
Senior Member
Join Date: Mar 2013
Location: basement
Old 08-23-2014 , 10:14   Re: Creating, Parenting, and Constraining Particle Effect to Player
Reply With Quote #4

You cannot change the particle effect's lifetimes. This is something that you cannot change through the engine. You'll have to make your own particle effect or modify the existing one.

Particle Editor Wiki Page

Last edited by Mehis; 08-23-2014 at 10:14.
Mehis 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 03:31.


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