Problem with UMSG? Or is it something else?

Hey there.

I’m currently trying to fix Leeroy’s Swep Base, but im having trouble with this one part.

I believe this has to do with the smoke that the gun emits after it has fired (similar to Left4Dead and CSGO).

The problem is that when the gun is fired, it creates this weird ball of red crosses that seems to get larger and larger.

If i remove these lines:



	if ( self.Owner:IsNPC() ) then return end
	
	if SERVER then
		umsg.Start("CallSmokeTrailEffect", self.Owner)
			umsg.Float(0)
			umsg.String(self.SmokeMuzzleAttachment)
		umsg.End()
		umsg.Start("CallSmokeTrailEffect", self.Owner)
			umsg.Float(self.EjectDelay or 0.1)
			umsg.String(self.SmokeEjectAttachment)
		umsg.End()
	end	


It no longer does the ball, however, the smoke still wont work.
Is it alright to remove the umsg? Is something wrong with it?

Here is the code of the shared.lua that i have fixed so far

Can someone point me in the right direction here? I have absolutely no idea what is broken.

This is caused by a Particle Effect not being loaded into the game.

You gotta do http://wiki.garrysmod.com/page/Global/PrecacheParticleSystem for every particle you want to use ( sometime before you actually use the effect ) and http://wiki.garrysmod.com/page/game/AddParticles for every files that contains any of the particles you use.

Thanks for that fast reply.

Hmm, He may have been using a custom particle effect. Thanks for that. I am not really knowledgeable with Leeroy’s base.

I also added a picture for better illustration purposes.

Edit: Apperantly the script meant to precache them had some script errors in them. Got them fixed and testing in a bit

I know what it looks like and I told you exactly the problem you experience and how to fix it.

The problem still persists. I added the code to precache the particles and add them to every lua file that uses them, but i still get that problem. (and also to BEFORE i use the effect)

You don’t need to add to every file, just one file is enough. I suggest making an autorun file that does this for you.

You did it wrong then or for the wrong files/particles.

Bump.

I created autorun files to precache and add the particles, but they aren’t helping.

Post your game.AddParticles, PrecacheParticleSystem, the file, and where EXACTLY have you placed the file, also, post console log as you might be trying to use particles from L4D/Portal2 which are unusable in GMod.

I created a lua file in the autorun folder with this inside:
[lua]
game.AddParticles(“particles/lee_particle.pcf”)
game.AddParticles(“particles/muzzle_smoke.pcf”)
game.AddParticles(“particles/muzzles_universal.pcf”)
[/lua]

In the swep i have added this in the VERY beggining of the gun and i have also put this in the PrimaryAttack function
[lua]

PrecacheParticleSystem(“muzzle_smoke_trail”)
PrecacheParticleSystem(“muzzle_lee_pistol”)
PrecacheParticleSystem(“muzzle_lee_simple_pistol”)
PrecacheParticleSystem(“muzzle_lee_rifle”)
PrecacheParticleSystem(“muzzle_lee_shotgun”)
PrecacheParticleSystem(“muzzle_lee_silenced”)
PrecacheParticleSystem(“muzzle_lee_sniper”)
PrecacheParticleSystem(“muzzle_simple_silenced”)
PrecacheParticleSystem(“muzzle_lee_rg”)
PrecacheParticleSystem(“muzzle_sparks_pistol”)
PrecacheParticleSystem(“muzzle_smoke”)
PrecacheParticleSystem(“3D_Smoke_Trail”)
[/lua]

The particles i am using should work for gmod and are the same particles as the ones in this video.

Also in the console i get this error:



Cannot update control point 0 for effect 'error'. 


Do you need anything else?

Post whole console log.

You can put game.AddParticles just before PrecacheParticleSystem. Make sure both are called shared.

Ok, now for some reason when i started gmod i no longer get the ball of crosses effect, however the smoke effect doesn’t emit. I think it would be better to just redo the whole code.

How can i attach an effect (in my case muzzle_smoke_trail ) to the muzzle attachment of my swep?

oh and i do get these errors on the console now:



Warning: Unhandled usermessage 'SendViewAnim'
Couldn't dispatch user message (19)
Warning: Unhandled usermessage 'CallMuzzleEffect'
Warning: Unhandled usermessage 'CallSmokeTrailEffect'
Warning: Unhandled usermessage 'CallSmokeTrailEffect'


bump