Since this forum seems to get more attention than the requests one, and I wasn't really requesting, but asking a question, I'll post this here instead:
I use the following on my server:
[lua]
p.trail = util.SpriteTrail(p, 0, Color(255,255,255,255), false, 15, 5, 2, 0.025, p:GetNWInt("Trail") .. ".vmt")
[/lua]
but this usually makes parts of the trail, at certain angles, clip with the ground. How could I move it up a few units?
p.trail:SetPos(p.trail:GetPos()+Vector(0,0,20))
Not sure about this but it should work. Put that after the p.trail = util.SpriteTrail, and that only needs to be done once each util.spritetrail.
I don't think that would work, the sprite is probably parented to the entity, and thus it will just jump back.
Try do something like
[lua]
p.trail:SetParent()
// SetPos shit here
p.trail:SetParent(Ent)
[/lua]
I did:
[lua]
p.trail = util.SpriteTrail(p, 0, Color(255,255,255,255), false, 15, 5, 2, 0.025, p:GetNWInt("Trail") .. ".vmt")
p.trail:SetParent()
p.trail:SetPos(p.trail:GetPos()+Vector(0,0,100))
p.trail:SetParent(p)
[/lua]
But nothing changes with the trail position.
Sorry for the bump, but what I'm now doing is something like this:
[lua]
p.trail = util.SpriteTrail(p, p:LookupAttachment("chest"), Color(p.r,p.g,p.b,255), false, 15, 5, 2, 0.025, p:GetNWInt("Trail") .. ".vmt")
[/lua]
This works, 90% of the time, and attaches to player chest, but sometimes, the lookup fails, and returns 0, and it seems quite random as to when this occurs. Anyone got a better suggestion? Maybe some way to still parent to feet but just move upwards?
Oh, and if you're wondering what the p.r, p.g, p.b values are, I'm now using client convars, with GetInfoNum() so players can set their own colours :)
[QUOTE=Donkie;27878507]I don't think that would work, the sprite is probably parented to the entity, and thus it will just jump back.
Try do something like
[lua]
p.trail:SetParent()
// SetPos shit here
p.trail:SetParent(Ent)
[/lua][/QUOTE]
Setting the position of a parented entity will change its relative position to the parent. And as to why nothing is working perplexes me. Try creating your own env_spritetrial.
[lua]
local trail = ents.Create("env_spritetrail")
trail:SetKeyValue("spritename",p:GetNWInt("Trail") .. ".vmt")
--set other keyvalues found here [url]http://developer.valvesoftware.com/wiki/Env_spritetrail[/url]
trail:SetPos(p:GetPos()+Vector(0,0,100))
trail:SetParent(p)
trail:Spawn()
[/lua]
Sorry, you need to Log In to post a reply to this thread.