CarnivorousJelly 
			Posting Freak80  
	
		
			
Changing Particle Colour 
 
				I currently have a script which involves a transition from day to night. I think it looks pretty awesome but I'm biased because I made it. The only problem I have with this script is that I cannot find any ways to change the colour of particle systems. The current ones on the map are orange (because it was sunset), which looks awful with blue lighting. Kind of like a giant cloud of SunnyD. 
Is there a way to change the colour without destroying/creating new particles? I would prefer for that to be my last resort.
Spoiler below!  
And, if you don't mind answering one more question, is there a way to shorten this:
void OnStart()
 
 
 
Thanks for your help!
			
 
 
 
	03-15-2013, 06:37 AM  
		
	 
 
	
		PutraenusAlivius 
			Posting Freak119  
	
		
			
RE: Changing Particle Colour 
 
				Just change the colour of the particle.
			
			
			
"Veni, vidi, vici.""I came, I saw, I conquered." 
			
		 
 
 
	03-15-2013, 06:52 AM  
		
	 
 
	
		CarnivorousJelly 
			Posting Freak80  
	
		
			
RE: Changing Particle Colour 
 
				 (03-15-2013, 06:52 AM) JustAnotherPlayer Wrote:  
How...? The lights change colour 
in game  due to the script I set up. I can't find a script that lets me change particle colour.
Edit: I probably worded my question oddly, so here's a video of what I did. It's still currently uploading but shouldn't take longer than 90 minutes to finish.
[video=youtube]
http://youtu.be/unv4EGfkE9E [/video]
Hopefully I fixed the brightness issue with the video.
			
 
			
			
 
 
 
	03-15-2013, 07:04 AM  
		
	 
 
	
		FlawlessHappiness 
			Posting Freak171  
	
		
			
RE: Changing Particle Colour 
 
				No, I don't think it's possible.
If a PS is created, it's created.
So now you can destroy it, and create a new one... or better:
Create a new one where the first one was, and THEN destroy the first one.
You specify colors with:
CreateParticleSystemAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS,float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart, float afFadeMaxStart, float afFadeMaxEnd);
Trying is the first step to success.
			
		 
 
 
	03-15-2013, 07:54 AM  
		
	 
 
	
		Adrianis 
			Senior Member27  
	
		
			
RE: Changing Particle Colour 
 
				Depending on which PS your trying to use, maybe it would be best with a custom particle that itself doesn't last long, then re-create it in a loop using BeeKayK's method rather than apply it in the level ed (e.g. for the floating dust particles), so that it fades out/in naturally. Otherwise if the player is right next to it they may notice sets of particles appearing/dissapearing suddenly (although I'm not sure whether destroying a particle fades it or just stops it instantly)
			
			
			
 
 
 
	03-15-2013, 10:52 AM  
		
	 
 
	
		CarnivorousJelly 
			Posting Freak80  
	
		
			
RE: Changing Particle Colour 
 
				Thanks for the help! Both the light dust and fog fade out, which looks really nice, but the new particles are not being created :\
Here's the script for the particles (based on a 20 second change for the lights) :
if (GetGlobalVarInt("NightTriggered") == 0)
I have it labelled so that the particles numbered 30-47 are the new ones created and anything below that is deleted (there are some holes in my numbers from creating excess particle systems and deleting them).
Other than the lack of new particles, it looks really nice! Thanks again 
 
 
 
	03-15-2013, 10:51 PM