Forged Alliance Forever Forged Alliance Forever Forums 2014-05-14T15:54:04+02:00 /feed.php?f=2&t=6526 2014-05-14T15:54:04+02:00 2014-05-14T15:54:04+02:00 /viewtopic.php?t=6526&p=72893#p72893 <![CDATA[Re: Deflector Shields]]>
Edit: what would happen if you have two shields over each other? Interesting ballistics ensured?

Statistics: Posted by Elikian — 14 May 2014, 15:54


]]>
2014-05-14T15:49:30+02:00 2014-05-14T15:49:30+02:00 /viewtopic.php?t=6526&p=72892#p72892 <![CDATA[Re: Deflector Shields]]>
Resin

Statistics: Posted by Resin_Smoker — 14 May 2014, 15:49


]]>
2014-05-14T15:19:20+02:00 2014-05-14T15:19:20+02:00 /viewtopic.php?t=6526&p=72890#p72890 <![CDATA[Re: Deflector Shields]]>

Statistics: Posted by Mad`Mozart — 14 May 2014, 15:19


]]>
2014-05-14T10:28:37+02:00 2014-05-14T10:28:37+02:00 /viewtopic.php?t=6526&p=72882#p72882 <![CDATA[Re: Deflector Shields]]>

Statistics: Posted by IceDreamer — 14 May 2014, 10:28


]]>
2014-05-14T09:46:11+02:00 2014-05-14T09:46:11+02:00 /viewtopic.php?t=6526&p=72881#p72881 <![CDATA[Re: Deflector Shields]]> Statistics: Posted by Krapougnak — 14 May 2014, 09:46


]]>
2014-05-14T08:24:36+02:00 2014-05-14T08:24:36+02:00 /viewtopic.php?t=6526&p=72879#p72879 <![CDATA[Re: Deflector Shields]]> Statistics: Posted by Seriph — 14 May 2014, 08:24


]]>
2014-05-14T08:21:34+02:00 2014-05-14T08:21:34+02:00 /viewtopic.php?t=6526&p=72878#p72878 <![CDATA[Re: Deflector Shields]]> https://www.youtube.com/watch?v=AFMtjSJ ... e=youtu.be

Please keep in mind that this was done just to test the concept. Below is a copy of the script used via Projectile.lua hook.

Code:
do

local Util = import('/lua/utilities.lua')
local Entity = import('/lua/sim/Entity.lua').Entity
local oldProjectile = Projectile
local EffectTemplate = import('/lua/EffectTemplates.lua')
local utilities = import('/lua/utilities.lua')

--> Triggers all logs to report if flag set true, selfwise use the local flags within each function for specific outputs
local masterDebug = false

Projectile = Class(oldProjectile) {

   OnImpact = function( self, targetType, targetEntity )      
      local myDebug = true
      if masterDebug and myDebug then
         WARN('OnImpact')
         WARN('   projectile "self" ID:', self:GetEntityId() )
         if targetEntity != nil then
            WARN('   targetEntity ID:', targetEntity:GetEntityId() )
         else
            WARN('   no target, assuming projectile impacted ground')         
         end         
      end
      --> Prevent projectiles used in as props or effects from triggering reflection
      if self and not self:BeenDestroyed() and targetEntity != nil then   
         if self.DamageData and self.DamageData.DamageAmount > 0 then   
            if self.ReflectorEntity != nil and self.ReflectorEntity == targetEntity then
               --> Last Impact         
               if masterDebug and myDebug then         
                  WARN('   LastImpact, returning false')
               end
               return false            
            elseif targetEntity.ProjectileReflector then               
               if masterDebug and myDebug then         
                  WARN('   Reflecting projectile')
               end
               --> Copy the basic data needed from the old projectile
               local dD = self.DamageData               
               dD.Launcher = self:GetLauncher()
               dD.bp = self:GetBlueprint().BlueprintId   
               local vX, vY, vZ = self:GetVelocity()
               local sX, sY, sZ = unpack( self:GetPosition() )
               local oX, oY, oZ = unpack( targetEntity:GetPosition() )
               local offsetX = sX - oX
               local offsetY = sY - oY
               local offsetZ =   sZ - oZ                                          
               --> Randomize the vector a bit so the child projectile doesnt always return down the original vector (Left and right spread)
               vX = utilities.GetRandomFloat( (vX * 0.800), (vX * 1.200) )                                     
               --> Reflected child projectile
               local reflectorProj = targetEntity:CreateProjectile( dD.bp, offsetX, offsetY, offsetZ, 0, 0, 0)
               WARN('   self launcher: ', self:GetLauncher():GetBlueprint().BlueprintId   )
               WARN('   reflectorProj launcher: ', reflectorProj:GetLauncher():GetBlueprint().BlueprintId )
               --> Remember what the projectile reflected from
               reflectorProj.ReflectorEntity = {}
               reflectorProj.ReflectorEntity = targetEntity
               --> Pass Damage Data
               reflectorProj.DamageData = dD                           
               --> Reflect the projectile
               reflectorProj:SetVelocity( -vX, -vY, -vZ )   
               reflectorProj:SetVelocity( 20 )
               reflectorProj:SetLifetime( 4 )            
               reflectorProj:SetVelocityAlign( true )
               if dD.Launcher != nil then
                  reflectorProj:SetNewTarget( dD.Launcher )
               end
               reflectorProj:TrackTarget( false )
               if masterDebug and myDebug then         
                  WARN('   Destroying old proj')
               end                                                                                                                           
                   self:Destroy()
                   return false
            end
         else
            if myDebug and masterDebug then
               WARN('   Projectiles used for props or effects detected')
            end   
         end      
      end                           
      --> Run old
      if myDebug and masterDebug then
         WARN('   Running oldProjectile.OnImpact')
      end                        
      oldProjectile.OnImpact(self, targetType, targetEntity)                  
   end,
}
end

Statistics: Posted by Resin_Smoker — 14 May 2014, 08:21


]]>
2014-02-12T15:36:53+02:00 2014-02-12T15:36:53+02:00 /viewtopic.php?t=6526&p=65028#p65028 <![CDATA[Re: Deflector Shields]]> Statistics: Posted by Resin_Smoker — 12 Feb 2014, 15:36


]]>
2014-02-03T23:27:02+02:00 2014-02-03T23:27:02+02:00 /viewtopic.php?t=6526&p=64068#p64068 <![CDATA[Re: Deflector Shields]]>
Seriph wrote:
Make the projectiles reflect in "random" pattern so you can't have a deflector kill a fatboy by bouncing his projectiles back at him.



Working on this... Currently only effective 10% of the time.

Resin

Statistics: Posted by Resin_Smoker — 03 Feb 2014, 23:27


]]>
2014-02-03T23:26:26+02:00 2014-02-03T23:26:26+02:00 /viewtopic.php?t=6526&p=64067#p64067 <![CDATA[Re: Deflector Shields]]>
lextoc wrote:
Very nice, you can send them in huge armies hehe


They will not be cheap to build and can be flanked as they are not very fast.

Resin

Statistics: Posted by Resin_Smoker — 03 Feb 2014, 23:26


]]>
2014-02-03T23:25:52+02:00 2014-02-03T23:25:52+02:00 /viewtopic.php?t=6526&p=64066#p64066 <![CDATA[Re: Deflector Shields]]>
Krapougnak wrote:
After Domino, you.
Welcome back Resin you were sorely missed ! 8-)


Thank you!

Statistics: Posted by Resin_Smoker — 03 Feb 2014, 23:25


]]>
2014-02-03T15:45:01+02:00 2014-02-03T15:45:01+02:00 /viewtopic.php?t=6526&p=64028#p64028 <![CDATA[Re: Deflector Shields]]> Statistics: Posted by Seriph — 03 Feb 2014, 15:45


]]>
2014-02-03T15:03:05+02:00 2014-02-03T15:03:05+02:00 /viewtopic.php?t=6526&p=64027#p64027 <![CDATA[Re: Deflector Shields]]> Statistics: Posted by lextoc — 03 Feb 2014, 15:03


]]>
2014-02-03T14:46:26+02:00 2014-02-03T14:46:26+02:00 /viewtopic.php?t=6526&p=64026#p64026 <![CDATA[Re: Deflector Shields]]> Welcome back Resin you were sorely missed ! 8-)

Statistics: Posted by Krapougnak — 03 Feb 2014, 14:46


]]>
2014-02-03T08:08:17+02:00 2014-02-03T08:08:17+02:00 /viewtopic.php?t=6526&p=64008#p64008 <![CDATA[Re: Deflector Shields]]> .

Statistics: Posted by Golol — 03 Feb 2014, 08:08


]]>