I was looking how FA PolyTrails work and i cant seem to mimic its system, I'm crating a projectile for a Gatling bot and i believe in FA for the PolyTrails say for the mongoose it would play each trail one after another, But in SC2 it will just play all 3 trails at once any idea how FA does this?
I would think this would be doing it in FA
Code:
MultiPolyTrailProjectile = Class(EmitterProjectile) {
PolyTrails = {'/effects/emitters/test_missile_trail_emit.bp'},
PolyTrailOffset = {0},
FxTrails = {},
RandomPolyTrails = 0, # Count of how many are selected randomly for PolyTrail table
OnCreate = function(self)
EmitterProjectile.OnCreate(self)
if self.PolyTrails then
local NumPolyTrails = table.getn( self.PolyTrails )
local army = self:GetArmy()
if self.RandomPolyTrails != 0 then
local index = nil
for i = 1, self.RandomPolyTrails do
index = math.floor( Random( 1, NumPolyTrails))
CreateTrail(self, -1, army, self.PolyTrails[index] ):OffsetEmitter(0, 0, self.PolyTrailOffset[index])
end
else
for i = 1, NumPolyTrails do
CreateTrail(self, -1, army, self.PolyTrails[i] ):OffsetEmitter(0, 0, self.PolyTrailOffset[i])
end
end
end
end,
}
All SC2 uses is this
Code:
-- Description:
-- Creates a set of polytrail emitters on a projectile.
--
-- Params:
-- proj - projectile entity.
-- name - polytrail effect template name, index into EffectTemplate definitions.
-- scale (optional) - size scalar multiplier to all emitter blueprints in this effect template.
-- offset (optional) - vector x,y,z position offset to all emitters.
function AttachPolytrailsOnProjectile( proj, name, scale, offset )
if EffectTemplates.Weapons[name] then
local army = proj:GetArmy()
local emit = nil
for _, vEffect in EffectTemplates.Weapons[name] do
emit = CreateTrail( proj, -2, army, vEffect )
if scale then
emit:ScaleEmitter( scale )
end
if offset then
emit:OffsetEmitter( offset[1] or 0, offset[2] or 0, offset[3] or 0 )
end
end
end
end