Help : create a napalm kamikaze weapon

Everything about mods can be found here.

Moderator: Morax

Help : create a napalm kamikaze weapon

Postby Krapougnak » 26 Mar 2016, 20:17

Hi,

I want to create a T3 Mobile bomb that creates a napalm explosion doing damage overtime.

I got the Fx good but for whatever reason can't get the napalm to work when the unit explodes.

Help and advice welcomed.

I tried this :

Code: Select all
CMobileKamikazeBombWeapon1 = Class(KamikazeWeapon){

   FxDeath = CybranmodedweaponsEffectTemplates.CMobileKamikazeBombExplosion1,

   CreateProjectileForWeapon = function(self, bone)
        local projectile = self:CreateProjectile(bone)
        local damageTable = self:GetDamageTable()
        local blueprint = self:GetBlueprint()
        local data = {
            Instigator = self.unit,
            Damage = blueprint.DoTDamage,
            Duration = blueprint.DoTDuration,
            Frequency = blueprint.DoTFrequency,
            Radius = blueprint.DamageRadius,
            Type = 'Normal',
            DamageFriendly = blueprint.DamageFriendly,
        }

        if projectile and not projectile:BeenDestroyed() then
            projectile:PassData(data)
            projectile:PassDamageData(damageTable)
        end
        return projectile
    end,


    OnFire = function(self)

      local army = self.unit:GetArmy()


        for k, v in self.FxDeath do

            CreateEmitterAtBone(self.unit,-2,army,v)

        end

      KamikazeWeapon.OnFire(self)
    end,

}

User avatar
Krapougnak
Contributor
 
Posts: 340
Joined: 12 Jul 2012, 11:03
Has liked: 193 times
Been liked: 24 times
FAF User Name: Krapougnak

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest