![]() |
|
|
#1 |
|
Registered User
Join Date: Jun. 26th, 2003
Location: Vienna
Posts: 146
|
How does the shield work?
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?
|
|
|
|
|
|
#2 |
|
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
__________________
How can you challenge a perfect immortal machine? |
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun. 26th, 2003
Location: Vienna
Posts: 146
|
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? |
|
|
|
|
|
#4 |
|
Code:
(in xPawn.ShieldAbsorb)
if (ShieldStrength > damage)
{
ShieldStrength -= damage;
SetOverlayMaterial( ShieldHitMat, ShieldHitMatTime, false );
PlaySound(sound'WeaponSounds.ArmorHit',SLOT_Pain,2*TransientSoundVolume,,400);
return 0;
}
Code:
injured.SetOverlayMaterial(none, 0.0, false);
__________________
How can you challenge a perfect immortal machine? Last edited by EvilDrWong; 29th Jun 2003 at 11:51 AM. |
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jun. 26th, 2003
Location: Vienna
Posts: 146
|
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...
|
|
|
|
|
|
#6 |
|
oh! here, try downloading the source straight from epic:
http://unreal.epicgames.com/Files/UT...225-Source.zip
__________________
How can you challenge a perfect immortal machine? |
|
|
|
|
|
|
#7 |
|
Registered User
Join Date: Jun. 26th, 2003
Location: Vienna
Posts: 146
|
Great. Now I can also see it. I really wonder why the xPawn from the sourcecode zip differs from the one I see in UEd (?!).
|
|
|
|
|
|
#8 |
|
Registered User
Join Date: Jun. 26th, 2003
Location: Vienna
Posts: 146
|
injured.SetOverlayMaterial(none, 0.0, false);
does not work, by the way. Maybe the overlay's drawn before NetDamage is called. |
|
|
|
|
|
#9 |
|
Registered User
Join Date: Jun. 26th, 2003
Location: Vienna
Posts: 146
|
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...
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|