How does the shield work?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Donator

New Member
Jun 26, 2003
146
0
0
Vienna
Visit site
Sounds simple enough. I am trying to code up a modifiction of the standard shield that briefly spawns a sphere like mesh around the target when hit to give the illusion of an actually invisible shielding field surrounding the player that only becomes visible when absorbing damage. You all know star trek, you know the clichee. I'm just not satisfied with that orange shader. Problem is, I'm at a complete loss where to start. Where is the function that actually generates that damage overlay and from where is it called?
 

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
40
Inside the machine
Visit site
xPawn.ShieldAbsorb(), but to change that youll need to make a gametype... which probably isnt what youre going for. What you could do as a cheap alternative is make a new GameRules class and in its NetDamage function spawn your translucent sphere effect if xPawn(Injured).ShieldStrength > 0
 

Donator

New Member
Jun 26, 2003
146
0
0
Vienna
Visit site
The 'cheap alternative' was very helpful, thanks a lot.

I still don't understand where the damage overlay is generated, since ShieldAbsorb() only does 'return damage' as I see it, no actual texture change. I'm able to generate the sphere now, so my second question would be, how do I get rid of the orange damage overlay shader?
 

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
40
Inside the machine
Visit site
Code:
(in xPawn.ShieldAbsorb)
if (ShieldStrength > damage)
{
    ShieldStrength -= damage;
    [b]SetOverlayMaterial( ShieldHitMat, ShieldHitMatTime, false );[/b]
    PlaySound(sound'WeaponSounds.ArmorHit',SLOT_Pain,2*TransientSoundVolume,,400); 
    return 0;
}
the bold part might be the culprit behind that. SO, what you could try doing is something of this sort in your NetDamage() to get rid of it after the fact
Code:
injured.SetOverlayMaterial(none, 0.0, false);
 
Last edited:

Donator

New Member
Jun 26, 2003
146
0
0
Vienna
Visit site
Going to try that now. Oddly enough, I've no idea where to find those lines you mention. The ShieldAbsorb() function in the xPawn class when viewed in UnrealED only contains the line 'return damage;' for me. And even odder, when trying to export xPawn, WOTGreal crashes, period, no questions asked. Anyway, thanks, you've been a big help. Off to experimenting now...
 

Donator

New Member
Jun 26, 2003
146
0
0
Vienna
Visit site
But it doesn't matter much as I see now, because the shield effect blocks your view anyway. Cool. Some more fiddling with materials and it's ready to rock...
 

Attachments

  • ShieldShot2.jpg
    ShieldShot2.jpg
    54.7 KB · Views: 25