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!