UE2 - UT2kX Different damage for different target?

  • 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.

JohnnySix

Caffienated Haemoglobin
Apr 6, 2002
406
0
16
England
planetunreal.com
I'm trying to change a projectile so it does additional damage if it hits a core or a power node, as yet haven't managed to get it working, I was under the impression that if you pick something higher up the actor tree, it affects children of that actor, but so far the below doesn't seem to do anything.

Would I need to put in additional code to know what team the projectile owner is on, and then check for objects belonging to an opposing team?

simulated function ProcessTouch (Actor Other, Vector HitLocation)
{

hitnodecore=False;
if ( Other.Isa('ONSPowerCore') || Other.Isa('ONSPowerNode'))
{
hitnodecore=True;
log(hitnodecore);
}
if ( (Other != instigator) && (!Other.IsA('Projectile') || Other.bProjTarget))
{
Explode(HitLocation, vect(0,0,1));

}

}
 
Last edited:

JohnnySix

Caffienated Haemoglobin
Apr 6, 2002
406
0
16
England
planetunreal.com
So I solved it, with a little logging, I should've done that before I posted.

I logged the Other variable of ProcessTouch, and realised I'd picked the wrong actor, as it turns out, the spinning thing is actually a separate actor to the ONSPowerNode, and is named ONSPowerNodeEnergySphere.

Now it all works, and damage is scaled for nodes/cores.

Code:
simulated function ProcessTouch (Actor Other, Vector HitLocation)
{

                hitnodecore=False;
                log(Other);
	if ( Other.Isa('ONSPowerNode') || Other.Isa('ONSPowerNodeEnergySphere') || Other.Isa('ONSPowerCoreRed') || Other.Isa('ONSPowerCoreBlue'))
	{
                hitnodecore=True;
                log(hitnodecore);
                }
	if ( (Other != instigator) && (!Other.IsA('Projectile') || Other.bProjTarget))
	{
		Explode(HitLocation, vect(0,0,1));

	}

}