Forged Alliance Forever Forged Alliance Forever Forums 2019-06-05T19:04:40+02:00 /feed.php?f=41&t=17629 2019-06-05T19:04:40+02:00 2019-06-05T19:04:40+02:00 /viewtopic.php?t=17629&p=175341#p175341 <![CDATA[Re: Overcharge stun on projectile]]>

self:DisableBuff('STUN')

Exellent!!!
I took Speed's advice and looked at the cybran sacu, though i was 99% certain the buff was done with 2 weapons, one with buff the other without.

Thank you both for your help. The solution was, as is often the case, simple and easy.

Statistics: Posted by DDDX — 05 Jun 2019, 19:04


]]>
2019-06-05T13:43:00+02:00 2019-06-05T13:43:00+02:00 /viewtopic.php?t=17629&p=175337#p175337 <![CDATA[Re: Overcharge stun on projectile]]>
If i remember well, ACU got 2 oc weapons (1 for manual and 1 for auto oc).

This code is not valid :
Code:
local Stunns = self:GetCurrentTargetPos()
Stunns:SetStunned(7, self)

You cannot stun a position, only a unit.

This one is not valid too :
Code:
Stunns:SetStunned(7, self)


Target:SetStunned(7) is ok.

I use a different way in my mod to make stuns, since the duration can be dynamic. But if i remember well, you can add buffs in a weapon bp. So you should be able to pass a stun as a buff.

The matter with your method in modding OnWeaponFired, is that you will stun on weapon fired not on projectile hit.

Statistics: Posted by Franck83 — 05 Jun 2019, 13:43


]]>
2019-06-05T08:35:43+02:00 2019-06-05T08:35:43+02:00 /viewtopic.php?t=17629&p=175334#p175334 <![CDATA[Re: Overcharge stun on projectile]]> I can only have ONE OC weapon.
More than one does not get recognized.

The SACU gets a second weapon that has stun in bp, while the 1.st gets disabled.

Game code cannot distinguish between more than 1 OC weapons.

Statistics: Posted by DDDX — 05 Jun 2019, 08:35


]]>
2019-06-05T06:51:21+02:00 2019-06-05T06:51:21+02:00 /viewtopic.php?t=17629&p=175333#p175333 <![CDATA[Re: Overcharge stun on projectile]]> Statistics: Posted by speed2 — 05 Jun 2019, 06:51


]]>
2019-06-04T21:42:49+02:00 2019-06-04T21:42:49+02:00 /viewtopic.php?t=17629&p=175328#p175328 <![CDATA[Overcharge stun on projectile]]>
Quick question.

The goal is to make an enhancement that gives the Overcharge weapon stun, that it previously did not have without that enhancement.

Now, I know how to make enhancements, I know how to piggy-back an EMP weapon on another beam weapon (like the Manticore t3 Cybran turret from Blackops does)
The problem comes when I try to do the same, but on a projectile weapon, not beam weapon.
So, my projectile weapon (Overcharge) needs to start with no stun, but gain a stun with an enhancement, while still remaining an overcharge weapon.
From what i can tell, the problem lies here
Code:
OnWeaponFired = function(self)    --the weapon is Overcharge, projectile
                LOG("----- Overcharge fired...");
                local wep = self.unit:GetWeaponByLabel('laser1emp')  --this is my dummy weapon, taken from the Manticore Blackops Unleashed turret, it does the stunns
                self.targetaquired = self:GetCurrentTargetPos()
                LOG("----- Overcharge target defined...");
                if self.targetaquired then      -----------THIS!!! This is where it fails.
                LOG("----- if Overcharge target defined then...");
                    if self:HasEnhancement('RailGun3') then
                        LOG("----- Overcharge we got enhancement...");
                       wep:SetTargetGround(self.targetaquired)
                        LOG("----- Overcharge settargetground done...");
                        self:SetWeaponEnabledByLabel('laser1emp', true)
                        LOG("----- Overcharge emp enabled...");
                        wep:SetTargetGround(self.targetaquired)
                        LOG("----- Overcharge emp target set...");
                        wep:OnFire()
                        LOG("----- Overcharge emp fired...");

                self:OnDisableWeapon()
                self:ForkThread(self.PauseOvercharge)
                SDFHeavyQuarnonCannon.OnWeaponFired(self)
            end,


in the "if self.targetaquired then" part, the thing stops. As if a projectile loses its target when it fires?
The same code works on beams (i have enhancements that give me beams, and further enhancements that piggyback an emp invisible projectile onto that beam to make it stun...I know how to do that).

Some of the steps I tried:

-make 2 overcharge-class weapons, the second one with a stun buff, have one enabled one disabled, switch between them with enhancements (does not work, the game only recognizes the first overcharge-class weapon)

-giving a stun order directly in the OnWeaponFired of the Overcharge weapon
local Stunns = self:GetCurrentTargetPos()
Stunns:SetStunned(7, self) --game did not know what SetStunned was

Steps to try - maybe a code that lets me have stun on overcharge right from the start, but DISABLES the buff of the weapon, till i enable it with an enhancement? What would that command be?

perhaps a function that triggers every time the OC weapon fires, borrows its current target and forces fire the emp weapon on the same target as the OC weapon fired upon, then shuts down?

Or is there an easier way to do this?

Statistics: Posted by DDDX — 04 Jun 2019, 21:42


]]>