Login  Register
 



Post new topicReply to topic
 
Author Message
 PostPosted: 13 May, 2012 
 

Joined: 02 Jul, 2010
Posts: 1261
Offline
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

_________________
Creator of SupCom2
Revamp Expansion Mod
Image
Image
Image


Top
 Profile  
 PostPosted: 14 May, 2012 
 

Joined: 02 Jul, 2010
Posts: 1261
Offline
Never mind i fixed my own problem :P

_________________
Creator of SupCom2
Revamp Expansion Mod
Image
Image
Image


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic



Quick Tools

Search for:
Jump to:  

© 2002-2010 Gas Powered Games Corp. All Rights Reserved. Gas Powered Games is the exclusive trademark of Gas Powered Games Corp.
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
 
Home| Games | Company | News & Press | Support
  Terms of Use   |    Copyright Information   |    Privacy Policy