Buffs applied weirdly?

Need help? This is the right place!
Note, reporting bugs and issues should be in the Tech Support forum!

Moderator: PhilipJFry

Buffs applied weirdly?

Postby Dudekahedron » 21 Jan 2017, 00:14

Hi FAF,
I've been attempting to clean up my EMP-beam tank unit. All its supposed to do is fire a beam at a target thereby stunning it.
Except I get weird stun application:
Image

At target, the stun is applied to my units and not the enemy's. Where the beam starts from the stun is applied to enemy targets.!? (Look closely in image for the stun symbol). Only the two blue tanks on the right are firing.
In the DUL301_unit.bp there are two things that seem to control it; "OnFire" and "OnImpact". Disabling one or the other removes the above effects but doesn't fix them.
Code: Select all
            Buffs = {
                {
                    Add = {
                       OnFire = true,
                        OnImpact = true,
                    },
                    AppliedToTarget = false,
                    BuffType = 'STUN',
                    Duration = 2,
                    Radius = 5,
                    TargetAllow = 'ALLUNITS',
                    TargetDisallow = 'COMMAND',
                },
            },
            CollideFriendly = false,


How do I get the OnImpact part to work properly and affect enemy units? Thanks!
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

Re: Buffs applied weirdly?

Postby Exotic_Retard » 21 Jan 2017, 03:12

well im not an expert but why is
Code: Select all
                    AppliedToTarget = false,
also i would disable onfire and only to it onimpact.
take this as an example (from equilibrium):
Code: Select all
Buffs = {
                {
                    Add = {
                        ImpactTypeDisallow = {
                            'Shield',
                        },                   
                        OnImpact = true,
                    },
                    AppliedToTarget = true,
                    BuffType = 'STUN',
                    Duration = 3.5,
                    Radius = 12,
                    TargetAllow = 'TECH1',
                    TargetDisallow = 'TECH2,WALL',
                },
                {
                    Add = {
                        ImpactTypeDisallow = {
                            'Shield',
                        },                   
                        OnImpact = true,
                    },
                    AppliedToTarget = true,
                    BuffType = 'STUN',
                    Duration = 2.5,
                    Radius = 12,
                    TargetAllow = 'TECH2',
                    TargetDisallow = 'WALL',
                },
                {
                    Add = {
                        ImpactTypeDisallow = {
                            'Shield',
                        },                   
                        OnImpact = true,
                    },
                    AppliedToTarget = true,
                    BuffType = 'STUN',
                    Duration = 1.5,
                    Radius = 12,
                    TargetAllow = 'TECH3',
                    TargetDisallow = 'WALL',
                },
            },


if that doesnt work it might just be beam things, since thats from a projectile.
User avatar
Exotic_Retard
Contributor
 
Posts: 1470
Joined: 21 Mar 2013, 22:51
Has liked: 557 times
Been liked: 626 times
FAF User Name: Exotic_Retard

Re: Buffs applied weirdly?

Postby Sprouto » 21 Jan 2017, 04:11

I do believe that the downside of the OnFire trigger would be to try and buff units around the firing weapon - as opposed to those at the point of impact -- and -- as pointed out, AppliedToTarget should be equal to true.
Sprouto
Priest
 
Posts: 366
Joined: 08 Sep 2012, 05:40
Has liked: 54 times
Been liked: 74 times
FAF User Name: Sprouto

Re: Buffs applied weirdly?

Postby Dudekahedron » 21 Jan 2017, 06:39

AppliedToTarget should have read true in my original post, my bad. I pasted after I had been fiddling.

It seems really odd to me that OnFire would affect enemy units correctly (in radius of the muzzle) but OnImpact would only affect allied units (in radius of the target). As far as I can tell, the CollisionBeam.lua and Projectile.lua in lua.nx2 have the same code to determine what the beam weapon is applied to as well.

Any idea how I should go about "fixing" this part of supcom?
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

Re: Buffs applied weirdly?

Postby Sprouto » 21 Jan 2017, 07:39

The AddBuff function appears in Unit.lua and the specific reference to the STUN buff appears there. Now, it might help if I knew what you were going for.
Sprouto
Priest
 
Posts: 366
Joined: 08 Sep 2012, 05:40
Has liked: 54 times
Been liked: 74 times
FAF User Name: Sprouto

Re: Buffs applied weirdly?

Postby Dudekahedron » 21 Jan 2017, 16:48

I want my beam weapon to stun enemy units.
Or more generally, I want weapon buffs to work on enemy units "on impact"
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 Help

Who is online

Users browsing this forum: No registered users and 1 guest