Creating and Editing Particle Systems
josepezdj wrote:
Doug, isn't that what I was saying?
Did you know, I'm stupid and should read! 
Even though I'm using the same name than an already existing particle and packing the pcf file inside the bsp, it seems to be using the stocked particle (inside the vpk) instead... Ofc I used the path-fixup...
I'll continue figuring out a way though...
josepezdj wrote:
Well, I've been trying, and so far no luckEven though I'm using the same name than an already existing particle and packing the pcf file inside the bsp, it seems to be using the stocked particle (inside the vpk) instead... Ofc I used the path-fixup...
I'll continue figuring out a way though...
Try a custom DLC folder? That seems to be the only way I get stuff to work...
What you can also do is copy the PCF, rename that, and have your edits of the particle(s) in there. This way, it reads a "new" PCF instead of one that shipped with the game.
Again, never tried to ship a map with particles, all I ever did was make edits to particles in DLC folders...
reepblue wrote:
What you can also do is copy the PCF, rename that, and have your edits of the particle(s) in there. This way, it reads a "new" PCF instead of one that shipped with the game.
No no no, what I was trying is right that
I did extract all partciles from the vpk to local folders, editted some particles and packed them into the bsp... In game I could only see the usual particle, not the editted one. It doesn't seem to work like sounds, scripts and the rest of stuff that's "packable". My final conclusion is that Valve, when they updated the game engine and established the searching/precaching priority, apart from loading the VPKs on atartup (and getting rid of the addons folder and VPKs inside them), they only left out some exceptions, like for materials, sounds or the scripts, for which the game can load both inside the VPK and outside and if you pack them inside the bsp, they acquire priotity over the VPK...
About a DLC folder, yeah I know that will works, same as a sourcemod, but my interest is to make a standalone map, in order to distribute that only file.
For Example: portal_projectile.pcf would be portal_projectile_myedit.pcf ; and portal_1_projectile_3rdperson would be portal_3_projectile_3rdperson.
Have the map load portal_3_projectile_3rdperson and the manifest portal_projectile_myedit.pcf.Never override with Portal 2, you can only 'hex' it. If that is your goal, maybe a vscript can swap out the stock with yours. (Like if you were actually wanting to replace the projectile ball.)
reepblue wrote:
If that is your goal, maybe a vscript can swap out the stock with yours
Haha yeah! I was searching for some script functions to achieve it right a moment ago
I think this would be the only way ![]()
First of course, as mentioned, the manifest is loaded at runtime (not when the map's loaded) so even if you'd hexed a .pcf to point at a different texture you're screwed.
But even if you were trying to rename one, say paint_bomb_fx.pcf, and you renamed it to paint_bomb_fx_hexed.pcf, and added that to the manifest, and then made a sourcemod to load it, hexed the name of the particle emitters inside to make new ones, or hexed the texture names inside, there's an issue with the file format that's going to just cause the game to crash.
Every table element has a globally unique ID, 16 bytes long and apparently random. Thus if you try and load what is essentially the same .PCF with two different file names there will be a conflict and p2 will crash.
Few options here:
1- Override+hex an existing one in a pak01_dir.vpk inside a higher priority folder.
2- Override+hex an existing one in a sourcemod (also must be in a pak01_dir.vpk )
3- Rename one + Manually alter all the IDs. Which sounds fairly easy and laborious, but remember, table elements can reference eachother by their indexes internally. So good luck with that.
4- Bit of a cheat... there are tons of particles already there which have missing textures, you can just add those manually and pack them into your map
Unfortunately, it doesn't look terribly likely that you'd be able to pack a new one into a map :\
sicklebrick wrote:
4- Bit of a cheat... there are tons of particles already there which have missing textures, you can just add those manually and pack them into your map.
Well, undoubtedly this is the way to go... This is a job I already did some time ago using the Alien Swarm particle editor and I don't mind to share it here
These are the missing materials for the 'broken' particles:
BROKEN PARTICLES AND THEIR MISSING TEXTURES
command_target_ping_arrow2 => material: "particle\coop\command_target_particle_arrow_beam.vmt"
command_target_ping_flash => material: particle\coop\command_target_particle_arrows.vmt
fire_incinerator_constant => material: "particle\fire_particle_4\fire_particle_4.vmt"
fire_incinerator_door => material: "particle\smoke1\smoke1.vmt"
fire_incinerator_door_heatwaver => material: "particle\warp1_warp.vmt"
fire_incinerator_heatwaver => material: "particle\warp1_warp.vmt"
fire_incinerator_heatwaver_constant => material: "particle\warp1_warp.vmt"
fire_incinerator_window_base => material: "particle\fire_particle_4\fire_particle_4.vmt"
fire_incinerator_window_constant_flames => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_incinerator_window_constant_flames2 => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_large_02 => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_large_02_warp => material: "particle\warp1_warp.vmt"
fire_medium_01 => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_medium_01_fillerb => material: "particle\fire_particle_2\fire_particle_2.vmt"
fire_medium_01_fillerb Version #2 => material: "particle\fire_particle_2\fire_particle_2.vmt"
fire_ploom_01 => material: "particle\fire_particle_2\fire_particle_2.vmt"
robot_point_beam_b => material: "particle\whitebeam.vmt"
robot_point_beam_core => material: "particle\whitebeam.vmt"
robot_point_beam_core_RED => material: "particle\whitebeam.vmt"
Few considerations:
-
Some of those .VMT files the particles need are inside the (/portal 2/portal2/) pak01_dir.VPK file, but others aren't.
-
The .VTF files that those .VMTs listed above are pointing to are mostly missing though. Even thought there are still some of them inside the pak_dir01.VPK, they seem to be buggy. Examples: fire_particle_4.vtf and smoke1.vtf. Why? looks like Portal2 needs the previous versions of them (from HL2), the main difference to the ones shipped with the game is the texture's size and images' distribution inside them.
-
All working materials needed (except those first 2 in the list) are attached to this post
Just unzip the file under your /materials/ folder. There should appear a new folder called 'particle' under /materials/ with those required files. Once you restart the game the particles should be working (again, except the first 2). -
THESE ATTACHED FILES (again, plus the first 2 ones in that list >.<) are the ones to edit if you want some custom particles in your map, all you have to do is to pakrat them before publishing to the workshop. And due to the mentioned above, remember to respect the textures' file format/size in order to make them to work properly.
-
Regarding those 2 first missing materials, a further research is needed in order to know what texture size is needed in order to make the particles to work properly. However, due to their purplecheckerboard-look, I think there are some already existing textures from other particles that could fit, it's just trial an error :p I'll do some further testing myself and post whatever I find.
-
After putting these missing materials under your materials/particle folder, the broken entities 'func_dustmotes' or 'func_dustcloud' will be magically fixed

Cheers!
By size, do you mean some of them require a very specific texture size in terms of width/height (which would be kinda weird) or that the placement of the graphics inside the texture are important?
Edit: Seriously though... thanks 
sicklebrick wrote:
Damn O_o Good work Jose!
Thanks, man! You too!
Well, I know it might be weird... however, even not knowing at all how the textures for particles work, if I think about models and UV-mapping, and how the placement inside of the texture is used by the different parts on the model, I guess this should be similar to that... or not :p
This is what I mean for example:
I found them in old games and attached them for anyone interested. I can't see any difference/improvement in its appearance in game though >.<
They are meant to be into the materials/sprites folder
