Right now the way I'm making trails is spawning info entities and then setting the position of the info entities to certain bones because I want the trails to be on certain bones. I then use Util.SpriteTrail on the info entity. I find this process to be a little sketchy and inefficient since I'm setting the the position every tick. The trails are also ahead of the player when they are running with super speed. Is there a less sketchy way to do this?
Can't you just use util.SpriteTrail on the entity you want, and set it to the right attachment (second argument)? Or alternatively, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetParentPhysNum]Entity:SetParentPhysNum[/url] (the page states that this doesn't work serverside, but I suggest you test this)
Off-topic, how are you creating the info entity?
[QUOTE=NeatNit;50340736]Can't you just use util.SpriteTrail on the entity you want, and set it to the right attachment (second argument)? Or alternatively, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetParentPhysNum]Entity:SetParentPhysNum[/url] (the page states that this doesn't work serverside, but I suggest you test this)
Off-topic, how are you creating the info entity?[/QUOTE]
What hook should I create the entities and parent them in if I were to put the hook in a server autorun?
[editline]17th May 2016[/editline]
[QUOTE=NeatNit;50340736]Can't you just use util.SpriteTrail on the entity you want, and set it to the right attachment (second argument)? Or alternatively, [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetParentPhysNum]Entity:SetParentPhysNum[/url] (the page states that this doesn't work serverside, but I suggest you test this)
Off-topic, how are you creating the info entity?[/QUOTE]
[CODE]
function SWEP:Deploy()
self:SetNetworkedInt( "DCFOV", self.Owner:GetFOV() )
self.Owner:SetMaxSpeed(10000)
self:SetHoldType(self.HoldType)
self.Owner:SetFOV(120, 0.5)
self.speedmod = true
if SERVER then
self.TrailTarget0 = ents.Create('info_target')
self.TrailTarget0:Spawn()
self.TrailTarget1 = ents.Create('info_target')
self.TrailTarget1:Spawn()
self.TrailTarget2 = ents.Create('info_target')
self.TrailTarget2:Spawn()
self.TrailTarget3 = ents.Create('info_target')
self.TrailTarget3:Spawn()
self.TrailTarget4 = ents.Create('info_target')
self.TrailTarget4:Spawn()
self.TrailTarget5 = ents.Create('info_target')
self.TrailTarget5:Spawn()
self.TrailTarget6 = ents.Create('info_target')
self.TrailTarget6:Spawn()
self.TrailTarget7 = ents.Create('info_target')
self.TrailTarget7:Spawn()
self.TrailTarget8 = ents.Create('info_target')
self.TrailTarget8:Spawn()
self.TrailTarget9 = ents.Create('info_target')
self.TrailTarget9:Spawn()
self.TrailTarget10 = ents.Create('info_target')
self.TrailTarget10:Spawn()
end
end
[/CODE]
[IMG]http://i.imgur.com/BAMFGst.png[/IMG]
[QUOTE=Kevlon;50342300][IMG]http://i.imgur.com/BAMFGst.png[/IMG][/QUOTE]
Attachments are too ahead of the player, so trails appear at a forward offset. He's using the entities so that they appear farther back. util.SpriteTrail doesn't allow you to modify its position.
It's not simple but it's obviously possible to draw these yourself completely on the client (without the need to mess around with entities).
If you want to modify heavily how trails work / are drawn this is the way to do it.
[QUOTE=code_gs;50342646]Attachments are too ahead of the player, so trails appear at a forward offset. He's using the entities so that they appear farther back. util.SpriteTrail doesn't allow you to modify its position.[/QUOTE]
Can't you just move the returned entity?
[QUOTE=Kevlon;50342686]Can't you just move the returned entity?[/QUOTE]
It's position always updates with the player. I suppose you could offset it every tick, but that would be kinda lame.
Maybe it's a matter of setting lag compensation on the returned trail entity?
[QUOTE=Kevlon;50342300][IMG]http://i.imgur.com/BAMFGst.png[/IMG][/QUOTE]
Does that say BoneID like I said above? I don't think so, but thanks for the sarcastic response. That's only for attachments. Not bones.
Sorry, you need to Log In to post a reply to this thread.