So i have an effect that follows a player and draws a sprite on them. When the player leaves the PVS the effect was made in, the effect gets "stuck" there and essentially stops working.
I was wondering if it was at all possible to make effects ignore PVS. If it isn't possible, could we have some way to make it happen to certain effects? I realize this could be a problem, if you had some idiots using this feature the totally wrong way it would probably cause more issues than it solves.
But for some effects it looks like ignoring PVS is the only way to make it work properly.
Uh, is there a way to parent the effect's actual entity to the player? That might do it.
Try making a dummy invisibile SENT with a [url=http://wiki.garrysmod.com/?title=ENT.UpdateTransmitState]transmit state[/url] set to TRANSMIT_ALWAYS, then parent it to a player and parent your effect to it.
Not sure the transmit state applies to properties such as position and angle, so if that doesn't work, maybe you can make that SENT store its position in a networked var every frame.
I've noticed that the PVS of an effect is set when you call EffectData:SetStart(). Try updating that with its position every so often.
Uh i thought you could only use SetStart etc. when you dispatch the effect...
Well the effect data is passed as a reference to use C++ terminology, so I don't see why not.
[QUOTE=yngndrw;16921166]Well the effect data is passed as a reference to use C++ terminology, so I don't see why not.[/QUOTE]
I believe the engine does not keep a reference of that object indefinitely.
on server
local SmokeData = EffectData()
SmokeData:SetEntity(car)
SmokeData:SetOrigin(car:GetPos())
util.Effect("carsmoke",SmokeData,true,true)
works for me, it stays attached to the entity
its just that when entitys leave YOUR pvs
they only update every 30 secs or so, so it gets jumpy
In init: self.Entity:SetParent(self.somethingtofollow)
or
In think: self.Entity:SetPos(self.somethingtofollow:EyePos())
Sorry, you need to Log In to post a reply to this thread.