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

How to override particles manifest?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-27-2019 , 20:02   How to override particles manifest?
Reply With Quote #1

Hi,

if I want to add custom particle to game, without overwriting particles/particles_manifest.txt file:
Quote:
particles_manifest
{
...
"file" "particles/l4d2onl4d_environmental_fx.pcf"
}
it is impossible to spawn particle effect. You will get:
Quote:
Attempting to create unknown particle system 'xxx'
Is it possible to register particle system in-game?

I also read this topic: https://forums.alliedmods.net/showthread.php?t=276909
where mentioned about some extension that nobody see.

Any solution for current moment?
Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 01-27-2019 at 20:02.
Dragokas is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-28-2019 , 16:02   Re: How to override particles manifest?
Reply With Quote #2

Probably a good idea to show the code for your current attempt.
__________________
Neuro Toxin is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-28-2019 , 16:54   Re: How to override particles manifest?
Reply With Quote #3

Neuro Toxin,

Precaching part: https://forums.alliedmods.net/showpo...47&postcount=4
Spawning part:
PHP Code:
void SpawnEffect(int clientchar[] sParticleName)
{
    
float pos[3];
    
GetClientEyePosition(clientpos);

    
int iEntity CreateEntityByName("info_particle_system", -1);
    if (
iEntity != -1)
    {
        
PrintToChat(client"\x03[Passific] Spawning effect on: \x05%N"client);
        
        
DispatchKeyValue(iEntity"effect_name"sParticleName);
        
DispatchKeyValueVector(iEntity"origin"pos);
        
DispatchSpawn(iEntity);
        
SetVariantString("!activator");
        
AcceptEntityInput(iEntity"SetParent"client);
        
ActivateEntity(iEntity);
        
AcceptEntityInput(iEntity"Start");
        
SetVariantString("OnUser1 !self:kill::1.5:1");
        
AcceptEntityInput(iEntity"AddOutput");
        
AcceptEntityInput(iEntity"FireUser1");
    }

pcf to kv converter to get effect names:
Code:
dmxconvert -i "game\particles\example.pcf" -ie binary -o "result\kv.txt" -oe keyvalues2 -of tex
Not work for custom particles (return "Attempting to create unknown particle system"). It work if only you add particle file name to manifest.
Work ok for default particles (because there are already exist in that manifest).

Second attempt (according to valve article):
- maps\l4d_garage01_alleys_particles.txt
- particles\l4d_garage01_alleys_manifest.txt

Not work, at least in L4D1.

addons/*.vpk method work but it can't be implemented since L4D1 doesn't support uploading vpk-s.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-26-2021 , 23:37   Re: How to override particles manifest?
Reply With Quote #4

Sorry for necro this thread. Don't know if you had solved this issue.

But I had this same question recently and your valve article link reference helped me a lot.

So first of all according to the wiki, if you change the "particles/particles_manifest.txt" it doesn't work, cause it will read the file inside the "pak01_dir.vpk" anyway.

Source here:
Code:
Source 2007 usage
Due to the recent Steampipe update, particles now require VPK integration. This is because the VPK takes priority over non-VPK files, so the VPK's manifest will always overwrite your own.
What I have tried on L4D2, I created a file inside the maps folder (dead center for example)
So my file will end like this: "left4dead2/maps/c1m1_hotel_particles.txt"
And I added a new line (based on the original "particles/particles_manifest.txt") to the end of the file

Would look something like this:

Code:
particles_manifest
{
	"file"		"!particles/error.pcf"
... // A lot of lines here
... // then

	"file"		"particles/custom_particle_test.pcf"
}
What I have to add to my plugin?
I had to use a FastDL to transmit this .txt to my clients and also the custom particle (.pcf)

So the code ended up like this:

PHP Code:
public void OnMapStart()
{
    
AddFileToDownloadsTable("maps/c1m1_hotel_particles.txt");
    
AddFileToDownloadsTable("particles/custom_particle_test.pcf");
    
PrecacheGeneric("particles/custom_particle_test.pcf"true);

Then it worked.

Just sharing here in case helps someone else.

Note: I didn't try the "particles/<mapname>_particles.txt" solution, which may work too.
This may not work for custom maps when the custom .vpk already has this file
__________________

Last edited by Marttt; 03-26-2021 at 23:40.
Marttt is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-27-2021 , 08:18   Re: How to override particles manifest?
Reply With Quote #5

No, I didn't resolve it in the normal way.

The mentioned way is ethically a bad idea from L4D devs. Because now others' people servers conflict with that manifest file if they may also want to use his own custom manifest for that particular map, but they can't do it anymore due to overwriting protection.

The only good way to use it if you are the author of a custom map.

I would also recommend you to incapsulate manifest in a vpk addon file, making less troubles for people to resolve conflicts similar to described one. You are able to use it with FastDL.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 03-27-2021 , 11:01   Re: How to override particles manifest?
Reply With Quote #6

the only way to change particle manifest in l4d its by using vpk with your own modified manifest only works in particle folder as particles_manifest.txt so you could transmit that vpk with fastdl
foxhound27 is offline
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 03-27-2021 , 11:02   Re: How to override particles manifest?
Reply With Quote #7

another thing you can do its using same pcf (custom) and add new effects to it this way no bugs will occur on client side you can do this with many files you want

Last edited by foxhound27; 03-27-2021 at 11:07.
foxhound27 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-27-2021 , 11:52   Re: How to override particles manifest?
Reply With Quote #8

Hmm got it. Thank you both. (Dragokas / Foxhound)

Kinda sorry for my lack of knowledge on FastDL things, first time trying it.

So my instructions worked cause the client didn't have the file and was downloading it for the first time.
But if I add (or change) more particles it will stop working cause it won't overwrite/update the file and also will conflict with any server that uses the same procedure.
(probably the same issue with other custom files)

The only solution for L4D2 would be creating a VPK as said (which also helps to find conflicting files) and maybe adding it to the workshop as an addon (that automatically updates) [I already saw some servers doing it]

While in L4D1 we don't have this solution cause there is no workshop the only option would be sending a .vpk (new name) to the client download every time you update something

Still is not guarantee the load order (maybe the game loads in alphabetic order)

Yeah very challenging, we all know how is to tell some players to download stuff, etc, usually doesn't go well (lack of knowledge on modifying files)
__________________

Last edited by Marttt; 03-27-2021 at 12:00.
Marttt is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-27-2021 , 12:14   Re: How to override particles manifest?
Reply With Quote #9

Game loads things in order defined in gameinfo.txt file => Key "SearchPaths".
But, the "addons" => .vpk containers override it.

Yeah, I think workshop would be the clearest available solution.
For L4D1 server admins could distribute the file somewhere in their local groups.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas 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 01:07.


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