Continental Shielding

Post here if you want to help developing something for FAF.

Continental Shielding

Postby IceDreamer » 25 Jan 2014, 20:45

So I have always thought that to prevent LABs from being hurt inside the Shield of the Continental would be a simple matter of expanding and lowering the shield. It is not. For some reason the motion of the transport affects things. When it is hovering, or moving slowly, the expanded and lowered Shield, coupled with an increase in flight altitude, the LABs are unscathed.

What I think happens is that the projectile hits the Shield, but then the explosion happens a tick later. If this were true, the explosion would be happening inside the Shield and would therefore kill the unit, because the transport has moved on since then. It would also explain why it is that the LABs at the rear are almost always unaffected when one flies right into a Flack, but the ones at the front are kills. I can find no reason for the explosion to be delayed though, or even for it to be happening at all. It should be cancelled by the impact with the Shield.

Any ideas? Any idea how we might solve this? Is it possible to say "If Shield = True, clamped units take 0 Damage"?
IceDreamer
Supreme Commander
 
Posts: 2607
Joined: 27 Dec 2011, 07:01
Has liked: 138 times
Been liked: 488 times

Re: Continental Shielding

Postby Domino » 25 Jan 2014, 22:13

hehe, the answer is simple,

it pertains to hitboxes, which dont move fluidly with the unit, it happens like this, first the unit moves, AND THEN the hitbox moves to the position of the unit, so really the hitbox is always chasing the unit.. this is why the units at the front get hit, because the hitbox is not covering them.

sadly though the fix is not easy.. because making the hitbox larger obvioulsy has major drawbacks with it being a sphere..
you could try making the hitbot an oblong shape and make it slighly longer than it should be and slightly larger in width/height.

this is prolly the only fix worth doing.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Continental Shielding

Postby Domino » 25 Jan 2014, 22:15

you can use if self:IsState('Attached') then return in a hooked ondamage event to stop attached units taking damage when being transported.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Continental Shielding

Postby ZLO_RD » 26 Jan 2014, 04:23

Domino wrote:you can use if self:IsState('Attached') then return in a hooked ondamage event to stop attached units taking damage when being transported.

units in trans should not take damage only if shield is "on"
http://www.youtube.com/user/dimatularus
http://www.twitch.tv/zlo_rd
TA4Life: "At the very least we are not slaves to the UI"
User avatar
ZLO_RD
Supreme Commander
 
Posts: 2265
Joined: 27 Oct 2011, 13:57
Location: Russia, Tula
Has liked: 303 times
Been liked: 400 times
FAF User Name: ZLO

Re: Continental Shielding

Postby IceDreamer » 28 Jan 2014, 02:43

I think I've given up on this idea. Pip pointed out to me that making it work would leave to attacks involving 4 or 5 of these being practically indestructible by ground based AA, particularly of the mobile variety. That wouldn't be good for gameplay :/
IceDreamer
Supreme Commander
 
Posts: 2607
Joined: 27 Dec 2011, 07:01
Has liked: 138 times
Been liked: 488 times

Re: Continental Shielding

Postby Resin_Smoker » 20 Feb 2014, 04:44

IceDreamer wrote:I think I've given up on this idea. Pip pointed out to me that making it work would leave to attacks involving 4 or 5 of these being practically indestructible by ground based AA, particularly of the mobile variety. That wouldn't be good for gameplay :/



Na the transport would still be attackable , just that the units with in the shield would and should be immune to damage so long as they're inside it. As Domino stated use OnTransport to get on an event that removes the hit boxes from the attached units. After they are released from transport or if the transport dies, enable the hit boxes from the units blueprint spec.

Resin
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Continental Shielding

Postby IceDreamer » 11 May 2014, 23:44

OK I'm reviving this whole thing. I've been looking through the unit.lua and all that jazz and I now have the logic ready in my head. As usual my lack of lua is letting me down, as I don't know how to physically type what's in my head into code. This is what I've brushed up, and there's no way it will work, but it's my way of showing people who might be able to help what I'm trying to achieve. What needs to change is what's physically written.

Code: Select all
#Something along these lines
#   OnDamage = function(self, instigator, amount, vector, damageType, unit)
#      unit:OnDamage = function(self, instigator, amount, vector, damageType)
#         if self:ShieldIsOn() and unit:SetCanTakeDamage == true then
#            unit:SetCanTakeDamage(false)
#         elseif self:ShieldIsOn() and unit:SetCanTakeDamage == false then   
#         end
#         if self:ShieldIsOn(false) and unit:SetCanTakeDamage == false then
#            unit:SetCanTakeDamage(true)
#         elseif self:ShieldIsOn(false) and unit:SetCanTakeDamage == true then
#         end
#      end
#   end


Basically, I want to put something like this in the continental's unit script. In layman's terms, when the Continental takes damage, I want it to check its own shield and the damage state of the attached unit in the sequence described. That's the biggest problem I have is I don't know how I'm supposed to refer to the attached unit.

This is obviously quite CPU expensive to check every OnDamage. I have another direction of logic taking form in my head but it's not clear yet, and once again I can't write it even when it is.
IceDreamer
Supreme Commander
 
Posts: 2607
Joined: 27 Dec 2011, 07:01
Has liked: 138 times
Been liked: 488 times

Re: Continental Shielding

Postby IceDreamer » 12 May 2014, 03:52

I need to say, in effect "For each unit attached to me, do this" in some form of

Code: Select all
self:GetAttached(unit)
    unit:SetCanTakeDamage()


Type thing...
IceDreamer
Supreme Commander
 
Posts: 2607
Joined: 27 Dec 2011, 07:01
Has liked: 138 times
Been liked: 488 times

Re: Continental Shielding

Postby IceDreamer » 12 May 2014, 21:54

OK so luadoc has GetAttachedUnitsList. Does that mean I can go self:GetAttachedUnitsList() and then tell all those units to SetCanTakeDamage?
IceDreamer
Supreme Commander
 
Posts: 2607
Joined: 27 Dec 2011, 07:01
Has liked: 138 times
Been liked: 488 times

Re: Continental Shielding

Postby Ze_PilOt » 12 May 2014, 22:35

Yes, but setting a unit invincible is quite dangerous.
Check all possible cases.

- Shields dropping & transferring damage.
- Shields dropping because lack of E.
- Giving the units to a ally.
- ?
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Next

Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest