Beam Weapon Buffs

Everything about mods can be found here.

Moderator: Morax

Beam Weapon Buffs

Postby Dudekahedron » 06 Oct 2016, 22:15

Hi,
I've been trying to figure out how impact buffs work for beam weaponry, particularly how to apply it.
The t2 cybran transporter uses something like this:
Code: Select all
            Buffs = {
                    Add = {
                        OnImpact = true,
                    },
                    AppliedToTarget = true,
                    BuffType = 'STUN',
                    Duration = 2,
                    Radius = 10,
                    TargetAllow = 'MOBILE',
            },

But that yields the following when applied to beam weapons:
Code: Select all
WARNING: Error running OnImpact script in Entity  at 15c06800: attempt to use as string a nil value
         stack traceback:
            [C]: in function `ParseEntityCategory'
            ...faforever\gamedata\lua.nx2\lua\sim\collisionbeam.lua(340): in function `DoUnitImpactBuffs'
            ...faforever\gamedata\lua.nx2\lua\sim\collisionbeam.lua(276): in function `OnImpact'
            ...iance\gamedata\lua.scd\lua\defaultcollisionbeams.lua(467): in function <...iance\gamedata\lua.scd\lua\defaultcollisionbeams.lua:458>

So if we go over to the line of "DoUnitImpactBuffs", we find the following:
Code: Select all
        # Buffs (Stun, etc)
        if targetEntity and IsUnit(targetEntity) then
            self:DoUnitImpactBuffs(targetEntity)
        end

So I know its possible to use buffs with beams, anyone know how to get it to work?
If its important, I am trying to make a [UEF] tank with a laser beam that stuns its targets. Currently using the TDF hiro plasma cannon as the base.
Thanks!!!

EDIT: I can get around this by just using a projectile "underneath" the laser, but that's not very elegant, nor useful for future pursuits of beam-buffs!
Check out my mod (in development): /viewtopic.php?f=41&t=13326
User avatar
Dudekahedron
Avatar-of-War
 
Posts: 118
Joined: 10 Apr 2016, 22:01
Has liked: 42 times
Been liked: 54 times
FAF User Name: Dudekahedron

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest