• Custom particle effect not working.
    22 replies, posted
I get the error message "Attempted to precache unknown particle system "smoketrials"!" and "Attempting to create unknown particle system 'smoketrials' " in the console when trying it. It is a muzzle smoke effect produced after firing my custom weapon for Trouble In Terrorist Town. The particle file is included in the particles folder and in particle_manifest.txt with [QUOTE]"file" "!particles/smoketrails.pcf" [/QUOTE]. If anyone knows a solution to this please help me. Thanks in advance.
[QUOTE=ImBoredRu;39116164]I get the error message "Attempted to precache unknown particle system "smoketrials"!" and "Attempting to create unknown particle system 'smoketrials' " in the console when trying it. It is a muzzle smoke effect produced after firing my custom weapon for Trouble In Terrorist Town. The particle file is included in the particles folder and in particle_manifest.txt with .[/QUOTE] The manifest file is obsolete. You have to use [LUA]game.AddParticles("particles/yourparticlefile.pcf")[/LUA] both server- and clientside.
[QUOTE=Silverlan;39116235]The manifest file is obsolete. You have to use [LUA]game.AddParticles("particles/yourparticlefile.pcf")[/LUA] both server- and clientside.[/QUOTE] Where is that suppose to be added in?
[QUOTE=ImBoredRu;39116380]Where is that suppose to be added in?[/QUOTE] Just put it into a lua-file and throw it into 'lua/autorun/'. [EDITLINE]-[/EDITLINE] You'll also have to use AddCSLuaFile to make sure the clients receive it as well: [LUA] AddCSLuaFile() game.AddParticles("particles/yourparticlefile.pcf") [/LUA]
[QUOTE=Silverlan;39116384]Just put it into a lua-file and throw it into 'lua/autorun/'.[/QUOTE] Thanks for the fast reply :downs: . [editline]6th January 2013[/editline] [QUOTE=Silverlan;39116384]Just put it into a lua-file and throw it into 'lua/autorun/'. [EDITLINE]-[/EDITLINE] You'll also have to use AddCSLuaFile to make sure the clients receive it as well: [LUA] AddCSLuaFile() game.AddParticles("particles/yourparticlefile.pcf") [/LUA][/QUOTE] I have just tried that but it still gives me the same error message :( .
[QUOTE=ImBoredRu;39116164]"Attempted to precache unknown particle system "smoke[B]trials[/B]"!" and "Attempting to create unknown particle system 'smoke[B]trials[/B]' "[/QUOTE] Typo? Check your code, sometimes it's hard to spot things like this
[QUOTE=my_hat_stinks;39116599]Typo? Check your code, sometimes it's hard to spot things like this[/QUOTE] Thanks for the reply. There was indeed a typo in my weapon qc file but even after fixing it, it still gives me the same error message expect this time its "smoketrails" not "smoketrials" :(
[QUOTE=ImBoredRu;39116707]Thanks for the reply. There was indeed a typo in my weapon qc file but even after fixing it, it still gives me the same error message expect this time its "smoketrails" not "smoketrials" :([/QUOTE] Are you trying to create the effect serverside or clientside? If you're creating it clientside, you'll have to precache it on the server beforehand using PrecacheParticleSystem("smoketrails").
[QUOTE=Silverlan;39116736]Are you trying to create the effect serverside or clientside? If you're creating it clientside, you'll have to precache it on the server beforehand using PrecacheParticleSystem("smoketrails").[/QUOTE] I'm creating it cilentside but even after adding that i still get the error message "Attempting to create unknown particle system 'smoketrials' " . But the other one doesn't appear anymore.
Are you sure the name of your particle that you're trying to display(the one in the .pcf) is smoketrails?
[QUOTE]Are you sure the name of your particle that you're trying to display(the one in the .pcf) is smoketrails?[/QUOTE] Thanks for the suggestion, but it still gives me the same error message after changing it in the lua file as it is named "smoke_trail" (I checked it using VIDE).
Show us the bit of your code where you're spawning the effect mate.
[QUOTE=Failure;39129978]Show us the bit of your code where you're spawning the effect mate.[/QUOTE] [QUOTE]$sequence Shoot "shoot.smd" ACT_VM_PRIMARYATTACK 1 snap fps 30.00 { { event 5001 1 "silenceduzi.shoot" } { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_9mm 1 100" } { event AE_CL_CREATE_PARTICLE_EFFECT 10 "smoketrails follow_attachment muzzleflash" } }[/QUOTE]
Wait thats not lua that's particles in model. [url]https://developer.valvesoftware.com/wiki/Particles_on_models[/url]
[QUOTE=Failure;39143071]Wait thats not lua that's particles in model. [url]https://developer.valvesoftware.com/wiki/Particles_on_models[/url][/QUOTE] Oh sorry, the lua file is, [QUOTE]AddCSLuaFile() game.AddParticles("particles/smoketrails.pcf") PrecacheParticleSystem("smoke_trail")[/QUOTE]
They both need to be called in GM:Initialize as far as I know. You have the right syntax for the functions. They just need to be called server AND client in Initialize.
[QUOTE=JetBoom;39153314]They both need to be called in GM:Initialize as far as I know. You have the right syntax for the functions. They just need to be called server AND client in Initialize.[/QUOTE] How do I do that? Do I change the lua code to, [QUOTE]GM:Initialize AddCSLuaFile() game.AddParticles("particles/smoketrails.pcf") PrecacheParticleSystem("smoke_trail")[/QUOTE]?
[QUOTE=ImBoredRu;39153389]How do I do that? Do I change the lua code to, ?[/QUOTE] Hooks would be better [lua]hook.Add( "Initialize", "Initialize particles/smoketrails.pcf", function() --Your code here end)[/lua]
[QUOTE=my_hat_stinks;39154231]Hooks would be better [lua]hook.Add( "Initialize", "Initialize particles/smoketrails.pcf", function() --Your code here end)[/lua][/QUOTE] I tried changing the code to [QUOTE]hook.Add( "Initialize", "Initialize particles/smoketrails.pcf", function() AddCSLuaFile() game.AddParticles("particles/smoketrails.pcf") PrecacheParticleSystem("smoke_trail") end)[/QUOTE] but it still gives me the same error message, I'm not sure if I did right or wrong. Would you guys like me to upload the files?
Weird, i did the way Silverlan mentioned on my SWEP and it worked. Also, yes, an upload would be useful.
[QUOTE=Matsilagi;39167646]Weird, i did the way Silverlan mentioned on my SWEP and it worked. Also, yes, an upload would be useful.[/QUOTE] Alright. [URL="https://www.dropbox.com/s/hl22mb3ryul2bqy/particlesandstuff.zip"]Download the file here[/URL]
[QUOTE=ImBoredRu;39179099]Alright. [URL="https://www.dropbox.com/s/hl22mb3ryul2bqy/particlesandstuff.zip"]Download the file here[/URL][/QUOTE] The particle is called "smoke_trail", not "smoketrails", so the qc code should be: [CODE]$sequence Shoot "shoot.smd" ACT_VM_PRIMARYATTACK 1 snap fps 30.00 { { event 5001 1 "silenceduzi.shoot" } { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_9mm 1 100" } { event AE_CL_CREATE_PARTICLE_EFFECT 10 "smoke_trail follow_attachment muzzleflash" } }[/CODE] [EDITLINE]-[/EDITLINE] Also, the Initialize hook isn't required. I believe AddCSLua doesn't even work unless you call it immediately.
[QUOTE=Silverlan;39179605]The particle is called "smoke_trail", not "smoketrails", so the qc code should be: [CODE]$sequence Shoot "shoot.smd" ACT_VM_PRIMARYATTACK 1 snap fps 30.00 { { event 5001 1 "silenceduzi.shoot" } { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_9mm 1 100" } { event AE_CL_CREATE_PARTICLE_EFFECT 10 "smoke_trail follow_attachment muzzleflash" } }[/CODE] [EDITLINE]-[/EDITLINE] Also, the Initialize hook isn't required. I believe AddCSLua doesn't even work unless you call it immediately.[/QUOTE] Thanks Silverlan and everyone else for your constant help, this problem is now fixed :dance: .
Sorry, you need to Log In to post a reply to this thread.