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

stock PrecacheParticleSystem()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rochellecrab
Junior Member
Join Date: Nov 2010
Old 01-13-2011 , 07:23   stock PrecacheParticleSystem()
Reply With Quote #1

A small and usefull stock:

Code:
stock PrecacheParticleSystem( const String:p_strEffectName[] )
{
	static s_numStringTable = INVALID_STRING_TABLE;

	if ( s_numStringTable == INVALID_STRING_TABLE  )
		s_numStringTable = FindStringTable( "ParticleEffectNames" );

	AddToStringTable( s_numStringTable, p_strEffectName );
}
Call it in the OnMapStart() forward. It will prevent server from lagging when creating new particle systems for the first time.
I tested it in Left 4 Dead 2. I don't know about other mods, but the most possible is that every >= OrangeBox support this.
__________________
Rochellecrab is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 01-13-2011 , 15:49   Re: stock PrecacheParticleSystem()
Reply With Quote #2

Now we just need a way to precache particle files. Strange how that isn't a feature yet.
__________________
Mecha the Slag is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-13-2011 , 17:57   Re: stock PrecacheParticleSystem()
Reply With Quote #3

Quote:
Originally Posted by Mecha the Slag View Post
Now we just need a way to precache particle files. Strange how that isn't a feature yet.
What are particle files ?
I can tell you.. because it's not in Valve's Engine Interface.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 01-15-2011 , 07:09   Re: stock PrecacheParticleSystem()
Reply With Quote #4

uhh pretty much every file in tf/particles/
__________________
Mecha the Slag is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 01-27-2011 , 14:30   Re: stock PrecacheParticleSystem()
Reply With Quote #5

I thought you could just PrecacheGeneric .pcf files...
I'm doing it in one of my plugins.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 01-29-2011 , 14:24   Re: stock PrecacheParticleSystem()
Reply With Quote #6

you can just add the files you want to particles_manifest and they'll pre load automatically.
blodia is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 02-09-2011 , 14:48   Re: stock PrecacheParticleSystem()
Reply With Quote #7

2blodia, I've tried, the game only loads standard pcf, the game does not want to read the new pcf, only works if we replace an existing one to new
2FlaminSarge, please give an example of how to do it
Nail is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 02-10-2011 , 21:01   Re: stock PrecacheParticleSystem()
Reply With Quote #8

I'm doing this in one plugin:
HTML Code:
else if (StrContains(strLine, ".pcf", false) != -1)    PrecacheGeneric(strLine, true);
It's in the TF2 Equipment Manager.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge 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 12:12.


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