Custom particles and the Steam Workshop

Here’s my problem:

I have custom particles in my map. I can add my .pcf files to my particles folder, but I also need to edit my manifest file. I can also add these .pcf files to my addon, but how can I get Garry’s Mod to use them without everyone editing a manifest .txt file?

It’s probably a stupid question and I’m missing something, but I’ve been stuck on this for a few days now, and with no result in sight, here I am.

Thanks.

I’m not sure how to do the actual process, but you use caching to do it. You have to do something with Lua. Not much help but hopefully it points you in the right direction.

Well, I’ll keep searching. Hopefully this will make my searches a bit more specific.

Alright, I’ve finally found it. You need to create an lua folder for you addon, and an autorun folder inside of it. Then a lua file - any name. Just make sure it’s original or it may be overwritten.

game.AddParticles(“particles/particlename.pcf”)

is the code you need to load particles.

why cant you just use the:
maps/map_name_particles.txt
(example: de_dust_particles.txt)
that contain your particles:


particles_manifest
{

	"file""!particles/pcf_file_name.pcf"
}



there are different way to use custom particles, why do the shit way (editing the manifest file) when you only need one file with the good name ?

Because he said it’s for the workshop. The Workshop does not authorize uploading txt files.

You need to precache the files via an autorun file in the Lua folder.

[lua]if CLIENT then
game.AddParticles(“particles/waterfall.pcf”)
game.AddParticles(“particles/forest_dynamic_rain.pcf”)
end[/lua]

Basically just add the name of the .PCF file and it will cache it for use.

You cant pack anything ?

Thank you! This is the clearest answer I’ve found yet.

So if you make a map using custom particles, you add that to your addons/mymap/lua/ folder as “autorun.lua”?

The name of the lua file can be anything - just make sure it’s something original. I’d probably use sharpob_mapname.lua or something like that.

Guys, need your help, I can not understand what I’m doing wrong :frowning: I want to add to your map the effect of smoke from the Left 4 dead 2. smoke_campfire environmental_fx.pcf it is in the file.
I place environmental_fx.pcf file in \ Steam \ steamapps \ common \ GarrysMod \ garrysmod \ particles I create a txt file with the name of my test map gm_test_room2_manifest.txt
Here are the contents of the file:

particles_manifest
{

file    "particles/environmental_fx.pcf"

}

The same file is created in \ Steam \ steamapps \ common \ GarrysMod \ garrysmod \ maps only with the name gm_test_room2_particles.txt
When starting my test map I get two errors in the console

  1. Unable to read particle definition particles/environmental_fx.pcf! UtlBuffer is the wrong type!
  2. Attempting to create unknown particle system ‘smoke_campfire’

And one more question. Why garry’s mod particles browser can not open the Particle of Left 4 dead 2? For example, take the same environmental_fx.pcf?

P.S. Sorry for my english :slight_smile:

It would seem L4D2 particles are incompatible. Try TF2 particles for a cartoony aesthetic or the particles from Black Mesa; which are good, generally realistic particles.

Thanks!

I found out that you can convert L4D2’s particles to be compatible using VIDE, however.

Just the small caveat that Portal 2 has an even newer version, that doesn’t work. If anyone knows how to convert Portal 2 particles into orangebox particles, please let me know.

as far I know editing the header of a pcf (with an hex editor) work for some formats

but it doesn’t work directly from Portal2/Alien Swarm to orangebox games.

What you should try is:

First edit the header so the pcf can be loaded by L4D2 particle editor.
Then in L4D2 particle editor, save the pcf under a new name.

Edit the header of the new pcf and see if i can be loaded in garry’s mod/css/tf2 particle editor.

If that doesn’t work, maybe its possible to do a step with L4D1 since it has a small format difference with L4D2.
And after that, editing the header to load it in orange box games