Forged Alliance Forever Forged Alliance Forever Forums 2019-04-23T13:37:01+02:00 /feed.php?f=41&t=11421 2019-04-23T13:37:01+02:00 2019-04-23T13:37:01+02:00 /viewtopic.php?t=11421&p=173839#p173839 <![CDATA[Re: Damage buffs]]>
so...been trying to get a hero unit that has an aura that buffs allies with a % damage increase.
Other hero units have different auras and they all work fine and dandy - maxhp aura, more range aura, more regen... so I know my way around auras.

All except the Affects: Damage one.
It does not affect damage, the same way as Franck states.
I have hooked the buff file in my mod, changed the line just as he instructs, but the buff remains unapplied.
And yes, I did remember to tell the hero units script.lua to load the local buff from the hooked file and not the default one ;)

Anya ideas...anyone?

Statistics: Posted by DDDX — 23 Apr 2019, 13:37


]]>
2016-01-06T15:46:54+02:00 2016-01-06T15:46:54+02:00 /viewtopic.php?t=11421&p=117120#p117120 <![CDATA[Re: Damage buffs]]>
I fixed my problem by hooking the function BuffAffectUnit(unit, buffName, instigator, afterRemove) in the buff.lua file.

This is the code (line 263) :

Code:
wep.DamageMod = val
-- wep.ChangeDamage(val)


It rocks now :D ! the changeDamage method doesn't work.

Statistics: Posted by Franck — 06 Jan 2016, 15:46


]]>
2016-01-06T15:27:36+02:00 2016-01-06T15:27:36+02:00 /viewtopic.php?t=11421&p=117119#p117119 <![CDATA[Re: Damage buffs]]>
Code:
INFO: *BUFF: Unit \000"0"\000 buffed damage to \000450
INFO: > SetProperty(1048576, HitCount): 0
INFO: > SetProperty(1048576, Xp): 0
INFO: { <metatable=table: 1332E370>
INFO:   AimControl={ <metatable=table: 177A7370>
INFO:     _c_object=userdata: CScriptObject* at 1CD74DF8 = [CScriptObject at 0x156C1180]
INFO:   },
INFO:   CurrentRackSalvoNumber=1,
INFO:   DamageMod=0,
INFO:   DamageRadiusMod=0,
INFO:   Disabledbf={ },
INFO:   NumMuzzles=2,
INFO:   RackRecoilReturnSpeed=0.625,
INFO:   RecoilManipulators={ },
INFO:   WeaponAimIsEnabled=true,
INFO:   WeaponCanFire=true,
INFO:   WeaponIsEnabled=true,
INFO:   __mainthread=thread: 1CBDC2D0,
INFO:   _c_object=userdata: CScriptObject* at 1CD74330 = [CScriptObject at 0x159C6A40],
INFO:   unit={ <metatable=table: 1332EC30>
INFO:     ActiveConsumption=false,
INFO:     BeamExhaustEffectsBag={ },
INFO:     Buffs={
INFO:       Affects={
INFO:         Damage={
INFO:           TestBoost={ Add=300, BuffName="TestBoost", Count=1, Mult=1.5 }
INFO:         },
INFO:         MaxHealth={
INFO:           TestBoost={ Add=0, BuffName="TestBoost", Count=1, Mult=1.5 }
INFO:         },
INFO:         MoveMult={
INFO:           TestBoost={ Add=0, BuffName="TestBoost", Count=1, Mult=1.5 }
INFO:         }
INFO:       },
INFO:       BuffTable={
INFO:         GlobalBoost={
INFO:           TestBoost={
INFO:             BuffName="TestBoost",
INFO:             Count=1,
INFO:             Trash={ <metatable=table: 151C1D70> thread: 12424DC0 }
INFO:           }
INFO:         }
INFO:       }
INFO:     },
INFO:     BuildEffectsBag={ },
INFO:     CanBeKilled=true,
INFO:     CanTakeDamage=true,
INFO:     CaptureEffectsBag={ },
INFO:     DamageEffectsBag={ { }, { }, { } },
INFO:     Dead=false,
INFO:     EnergyModifier=0,
INFO:     EventCallbacks={
INFO:       OnCaptured={ },
INFO:       OnCapturedNewUnit={ },
INFO:       OnDamaged={ },
INFO:       OnFailedBeingCaptured={ },
INFO:       OnFailedCapture={ },
INFO:       OnFailedToBuild={ },
INFO:       OnHorizontalStartMove={ },
INFO:       OnKilled={ },
INFO:       OnReclaimed={ },
INFO:       OnStartBeingCaptured={ },
INFO:       OnStartBuild={ },
INFO:       OnStartCapture={ },
INFO:       OnStartReclaim={ },
INFO:       OnStopBeingBuilt={ },
INFO:       OnStopBeingCaptured={ },
INFO:       OnStopCapture={ },
INFO:       OnStopReclaim={ },
INFO:       OnUnitBuilt={ },
INFO:       OnVeteran={ },
INFO:       ProjectileDamaged={ },
INFO:       SpecialToggleDisableFunction=false,
INFO:       SpecialToggleEnableFunction=false
INFO:     },
INFO:     FxDamage1Amount=1,
INFO:     FxDamage2Amount=1,
INFO:     FxDamage3Amount=1,
INFO:     HasFuel=true,
INFO:     IdleEffectsBag={ },
INFO:     MaintenanceConsumption=false,
INFO:     MassModifier=0,
INFO:     MovementEffectsBag={ },
INFO:     OnBeingBuiltEffectsBag={ },
INFO:     ProductionEnabled=true,
INFO:     ReclaimEffectsBag={ },
INFO:     Sync={ <metatable=table: 18C7E370> army=2, id="1048576" },
INFO:     TopSpeedEffectsBag={ },
INFO:     TransportBeamEffectsBag={ },
INFO:     Trash={ <metatable=table: 151C1D70>
INFO:       { <metatable=table: 177A7370>
INFO:         _c_object=userdata: CScriptObject* at 1CD74DF8 = [CScriptObject at 0x156C1180]
INFO:       },
INFO:       thread: 12424DC0
INFO:     },
INFO:     UpgradeEffectsBag={ },
INFO:     VeteranLevel=0,
INFO:     _c_object=userdata: CScriptObject* at 1CD743F8 = [CScriptObject at 0x1CBB7800]
INFO:   }
INFO: }


So it's so strange that the damage buff isn't applied. The aeon commander base dam = 100. The ACU is buffed up to 450 (100*1.5+300) as it said in the log.

Statistics: Posted by Franck — 06 Jan 2016, 15:27


]]>
2016-01-06T14:59:19+02:00 2016-01-06T14:59:19+02:00 /viewtopic.php?t=11421&p=117118#p117118 <![CDATA[Re: Damage buffs]]>
Kalvirox wrote:
Not that I can help with the issue you have. But may I ask how you intend for the buffs to be given.. let me rephrase, what prerequisite us required for a unit to get a buff?


Not so hard ;) :

You have to :
- Add new Buffblueprint as i do in my post in the BuffDefinitions.lua file
- import the buff.lua file in your module
- call the ApplyBuff(unit,Nameofyourbuff) method at the event you want. In my post i call it just at unit creation. But i can imagine that you can call it with shortcut. The unit must be created. It will not work at the beginning of the unit oncreate function.

You can check the possible affects in the function BuffAffectUnit in buff.lua. You can buff Health, Regen, RegenPercent, Damage (may be buggy), DamageRadius, BuildRate...)


It's very interesting, but why the damage buff simply doesn't work...

Statistics: Posted by Franck — 06 Jan 2016, 14:59


]]>
2016-01-06T14:49:15+02:00 2016-01-06T14:49:15+02:00 /viewtopic.php?t=11421&p=117117#p117117 <![CDATA[Re: Damage buffs]]> Statistics: Posted by Kalvirox — 06 Jan 2016, 14:49


]]>
2016-01-06T14:42:59+02:00 2016-01-06T14:42:59+02:00 /viewtopic.php?t=11421&p=117115#p117115 <![CDATA[Damage buffs]]>
I'm currently looking at SupCom FA buff system, and i wanna to make a test.

I define a new BuffBlueprint :

Code:
BuffBlueprint {
    Name = 'TestBoost',
    DisplayName = 'TestBoost',
    BuffType = 'GlobalBoost',
    Stacks = 'REPLACE',
    Duration = 60,
    Affects = {
      MaxHealth = {
            Add = 0,
            Mult = 1.5,
        },
      MoveMult = {
         Add = 0,
         Mult = 1.5,
      },
      Damage = {
         Add = 300,
         Mult = 1.5,
      },
   },
}


It do just for 60s a +50% Health bonus, a +50% speed, acceleration and turn rate bonus, and a +300 and +50% Weapon bonus.

Then i call it in my mod during the unit creation like this :
Code:
Buff.ApplyBuff( self, 'TestBoost')


Everything works fine, the 60s time, the Health bonus, the speed bonus, all are ok.

But the damage bonus doesn't work.

I checked the code, and it seems that this method in the buff.lua at line 263 simply do nothing :
Code:
local wep = unit:GetWeapon(i)
wep:ChangeDamage(val)


Do you know if the ChangeDamage method is active ? Any idea why it doesn't work. I've got no warning or error message in the log.

Statistics: Posted by Franck — 06 Jan 2016, 14:42


]]>