When creating particles using CLuaParticleEmitter, all clients can see the particles on their screen.
However, if someone is in a different Visleaf, or outside the map in the skybox, the particles do not get created on their client / screen.
Is there any way to fix this OTHER than just creating the particles over and over? (This is a smoke effect that needs to get created only once.)
I'm personally against using global Particle Emitters, I like doing things clientside. But, to accomplish this, you can create the effect and add it to every ones PVS.
[url]http://wiki.garrysmod.com/page/GM/SetupPlayerVisibility[/url]
[url]http://wiki.garrysmod.com/page/Global/AddOriginToPVS[/url]
There's also Transmit to always transmit, transmit only during in PVS, or never transmit ( I haven't tried this with ParticleEmitter, so I'm not sure if it'll work ):
[url]http://wiki.garrysmod.com/page/Enums/TRANSMIT[/url]
My solution ( Not knowing exactly what the smoke is for, etc ), would be to have a ParticleEmitter created on the LocalPlayer( ) where the position is updated any-time something needs to be emitted ( You only need 1 ParticleEmitter for everything, just ParticleEmitter:SetPos( newPos ) to update the position ); then have a net-message or whatever transmit telling the client what do render in simple a simple ENUM / Position message.
So, here's what I have so far:
[lua]local function mySetupVis_PG( ply )
AddOriginToPVS( spos )
end
hook.Add( "SetupPlayerVisibility", "PG_RENDER"..tostring(self.Entity), mySetupVis_PG )[/lua]
That get's called when my grenade explodes. Then, later down in the code, an if CLIENT statement creates the smoke.
When someone throws a grenade, and I'm outside the skybox, after the grenade detonates I can now see all player models when I previously couldn't.
However, I don't see the smoke.
If the throws the grenade again, then I see the smoke.
Why are all player models becoming visible from all visleafs? The "spos" I specified is the self:GetPos() of the entity. Why isn't the smoke becoming visible the first throw, but the players are?
Sorry, you need to Log In to post a reply to this thread.