[solved] UKBadboy ( no push when the redeemer explodes

Discussions about Coding and Scripting
User avatar
Letylove49
Masterful
Posts: 528
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: AK admin
Location: suisse

[solved] UKBadboy ( no push when the redeemer explodes

Post by Letylove49 »

I would like that the players don't get pushed when the UKBadboy reedmer explodes. But the team-kill for others weapons must stay and the ohter weapons can push- i want only excluded some weapons to push

weapons info :

Code: Select all

  
      AmmoName=Class'UKBadBoy.GreenXNHAM'
      ProjectileClass=Class'UKBadBoy.NukeMissileE'
     AltProjectileClass=Class'UKBadBoy.NukeMissileD'
     MyDamageType=UltimaNuke
     AltDamageType=MushroomNuke
MydamageType NuclearExplosion come from class : NukeMissileA.

here the 3 paramettre :

Selfdamage: here the player must no get damage from this weapons :
if ( ! bPlayerUKBadboySelfDamage && (string (DamageType)==""NuclearExplosion") ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
if( ! bPlayerUKBadboy2SelfDamage && (string (DamageType)=="MushroomNuke") ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
if( ! bPlayerUKBadboy3SelfDamage && (string (DamageType)=="UltimaNuke") ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
team damage : This weapons must no kill teammate on Mh)
if ( !bUKBadBoyTeamDamage && (string (DamageType)=="NuclearExplosion") )
if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
if ( InstigatedBy != Victim ) ActualDamage = 0 ;
if ( !bUKBadBoyTeamDamage2 && (string (DamageType)=="MushroomNuke") )
if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
if ( InstigatedBy != Victim ) ActualDamage = 0 ;
if ( !bUKBadBoyTeamDamage3 && (string (DamageType)=="UltimaNuke") )
if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
if ( InstigatedBy != Victim ) ActualDamage = 0 ;
Push: Here this weapon should no push the player ( but still do it)
if (! bUKBadBoyTeamPush && (string (DamageType)==""NuclearExplosion") )
if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ; Velocity = Vect(0,0,0); Victim.Velocity = (Victim.Velocity * 0);
if (! bUKBadBoyTeamPush2 && (string (DamageType)=="MushroomNuke") )
if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ; Velocity = Vect(0,0,0); Victim.Velocity = (Victim.Velocity * 0);
if (! bUKBadBoyTeamPush3 && (string (DamageType)=="UltimaNuke") )
if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ; Velocity = Vect(0,0,0); Victim.Velocity = (Victim.Velocity * 0);
)
Last edited by Letylove49 on Tue Dec 02, 2025 11:00 am, edited 1 time in total.
Image
Image
Letylove49 aka Alicia
JackGriffin
Godlike
Posts: 3829
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: : UKBadboy ( no push when the redeemer explodes

Post by JackGriffin »

I addressed that a long time ago in a fix for Hermskii I'll send to you.
So long, and thanks for all the fish
User avatar
Letylove49
Masterful
Posts: 528
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: AK admin
Location: suisse

Re: : UKBadboy ( no push when the redeemer explodes

Post by Letylove49 »

ok thanks in advance.
Image
Image
Letylove49 aka Alicia
JackGriffin
Godlike
Posts: 3829
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: : UKBadboy ( no push when the redeemer explodes

Post by JackGriffin »

I'm sorry it took so long to reply. I got hurt on a camping trip and I've been stuck on my recliner for a while. Getting old is annoying.

So in MH2 I added this as an option:

Code: Select all

   if(bUseAntiBoost)
   {
      if(Victim != None && InstigatedBy != None)
      {
         if (InstigatedBy.IsA('PlayerPawn') && Victim.IsA('PlayerPawn'))
         {
	    Momentum = Vect(0,0,0);
            ActualDamage = 0;
            if (string(DamageType)=="RedeemerDeath")
            {
	       Velocity = Vect(0,0,0);
	       Victim.Velocity = (Victim.Velocity * 0);
            }
         }
      }
   }
Just plug in the specific checks for damage type and/or instigator and you'll be good. The only thing I don't like about this is players can cheese certain spots in rare maps by blasting themselves with a deemer. Since it cancels out all the velocity the players will just drop straight down if they shoot themselves. If the map has tossed the player for some reason then it stops that tossing. Mostly it doesn't break things but it can be a bit annoying if you were being moved a long distance, or it can be a bit of an exploit of you were being punished away from an area and you stopped it. I never really figured out how to address these unique circumstances but they are pretty rare.
So long, and thanks for all the fish
User avatar
Barbie
Godlike
Posts: 3327
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: : UKBadboy ( no push when the redeemer explodes

Post by Barbie »

JackGriffin wrote: Fri Jul 25, 2025 4:25 pm So in MH2 I added this as an option:
Idk the full code but it looks like you set Mutator's velocity to 0. :lol:
You do not have the required permissions to view the files attached to this post.
"If Origin not in center it be not in center." --Buggie
User avatar
Letylove49
Masterful
Posts: 528
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: AK admin
Location: suisse

Re: : UKBadboy ( no push when the redeemer explodes

Post by Letylove49 »

JackGriffin wrote: Fri Jul 25, 2025 4:25 pm I'm sorry it took so long to reply. I got hurt on a camping trip and I've been stuck on my recliner for a while. Getting old is annoying.

So in MH2 I added this as an option:

Code: Select all

   if(bUseAntiBoost)
   {
      if(Victim != None && InstigatedBy != None)
      {
         if (InstigatedBy.IsA('PlayerPawn') && Victim.IsA('PlayerPawn'))
         {
	    Momentum = Vect(0,0,0);
            ActualDamage = 0;
            if (string(DamageType)=="RedeemerDeath")
            {
	       Velocity = Vect(0,0,0);
	       Victim.Velocity = (Victim.Velocity * 0);
            }
         }
      }
   }
thanks.

this option will disable the team-kill on all weapons and I would only like these following weapons not to push and not to kill teammates or ourselves. After I don’t know if it’s possible to do that.

Warheadlauncher
UKBadBoy
NWUltimaProtosVIII
NWNuclearLauncherVIII
NWUltimaProtosV3
NWNuclearLauncherV3
the others weapons should be able to team-kill.
Image
Image
Letylove49 aka Alicia
User avatar
Barbie
Godlike
Posts: 3327
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: : UKBadboy ( no push when the redeemer explodes

Post by Barbie »

Sadly in event TakeDamage() you cannot retrieve what weapon was used nor the projectile that created this damage.
A workaround is to use the weapon the instigator is currently holding, but instigator might have changed weapon meanwhile or even has left the match, so this may fail.

Ofc you can react on the DamageType, if it is specific for a weapon, but mostly a DamageType is used by multiple projectiles.
Here is a (not complete) list of MyDamageType:

Code: Select all

Chunk@UnrealI.u/Chunk.uc:     MyDamageType=shredded
ClusterGrenade@ClusterRedeemer.u/ClusterGrenade.uc:      MyDamageType="RedeemerDeath"
ClusterRocket@ClusterRedeemer.u/ClusterRocket.uc:      MyDamageType="RedeemerDeath"
ClusterWarShellGrenades@ClusterRedeemer.u/ClusterWarShellGrenades.uc:      MyDamageType="RedeemerDeath"
ClusterWarShellRazors@ClusterRedeemer.u/ClusterWarShellRazors.uc:      MyDamageType="RedeemerDeath"
ClusterWarShellRockets@ClusterRedeemer.u/ClusterWarShellRockets.uc:      MyDamageType="RedeemerDeath"
DispersionAmmo@UnrealShare.u/DAmmo5@UnrealShare.u/THmapAmmo5@THmapPak.u/THmapAmmo5.uc:    MyDamageType=Burned
PBolt@Botpack.u/PBolt.uc:     MyDamageType=zapped
PlasmaSphere@Botpack.u/PlasmaSphere.uc:     MyDamageType=Pulsed
PlasmaSphere@RYSWeps2.u/PlasmaSphere.uc:    MyDamageType=Pulsed
Razor2@Botpack.u/Razor2Alt@Botpack.u/Razor2Alt.uc:       MyDamageType=RipperAltDeath
RocketMk2@Botpack.u/RocketMk2.uc:        MyDamageType=RocketDeath
RocketMk2@Botpack.u/PlasmaRocket@PlasmaTitan.u/PlasmaRocket.uc:    MyDamageType=Plasma
ShockProj@Botpack.u/ShockProj.uc:     MyDamageType=jolted
UT_BioGel@Botpack.u/UT_BioGel.uc:     MyDamageType=Corroded
UTChunk@Botpack.u/UTChunk.uc:     MyDamageType=shredded
UT_Grenade@Botpack.u/UT_Grenade.uc:     MyDamageType=GrenadeDeath
WarShell@Botpack.u/WarShell.uc:     MyDamageType=RedeemerDeath
"If Origin not in center it be not in center." --Buggie
User avatar
Letylove49
Masterful
Posts: 528
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: AK admin
Location: suisse

Re: : UKBadboy ( no push when the redeemer explodes

Post by Letylove49 »

Ok i put here the Weapons an the class of Projectiles :

My goal is to the players don't get pushed , kill himself and cannaot make team-kill only with the follow weapons . the others wepons must be ignored. ( the function is on mh2 block all the weapons .)

i have no put the Warheadlauncher and MH2Wareadlancher because for this weapons that work like exptected.

UKBadBoy:
ProjectileClass=Class'UKBadBoy.NukeMissileE'
AltProjectileClass=Class'UKBadBoy.NukeMissileD'
MyDamageType=UltimaNuke
AltDamageType=MushroomNuke

NukeMissileA: (DamageType)=="NuclearExplosion")
NukeMissileE :MyDamageType=UltimaNuke
NukeMissileD=MyDamageType:=MushroomNuke



NWUltimaProtosVIII
ProjectileClass=Class'UltimaProjectile'
UltimaProtos :(DamageType)=="Nuclear05")
UltimaProjectile:(DamageType)=="NuclearUltima")


NWNuclearLauncherVIII
ProjectileClass=Class'NuclearMissile'
AltProjectileClass=Class'NuclearGuidedMissile'
NuclearLauncher :(DamageType)=="Nuclear")
NuclearMissile:(DamageType)=="Nuclear00")

NWUltimaProtosV3

ProjectileClass=Class'UltimaProjectile'
UltimaProtos : (DamageType)=="Nuclear05")
UltimaProjectile : (DamageType)=="Nuclear05")

NWNuclearLauncherV3

ProjectileClass=Class'NuclearMissile'
AltProjectileClass=Class'NuclearGuidedMissile'
NuclearLauncher : (DamageType)=="Nuclear")
NuclearMissile :(DamageType)=="Nuclear00")

Now i put here the function of my mutator :

For each weapons i have create 3 options : TeamDamage, SelfDamage, TeamPusch.

Code: Select all

function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation, out Vector Momentum, name DamageType)
{
	if ( Victim != none && InstigatedBy != none )
	{
		if ( ! bGameStarted ) 
	//	if ( Victim != none && InstigatedBy != none )
		if ( Victim.IsA('ScriptedPawn') && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			bGameStarted = true;

For  UKBadBoy:
		[b][color=#FF0000]if ( ! bPlayerUKBadboySelfDamage && (string (DamageType)=="NuclearExplosion")  ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0;[/color][/b]
                if( ! bPlayerUKBadboy2SelfDamage && (string (DamageType)=="MushroomNuke")  ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
                if( ! bPlayerUKBadboy3SelfDamage && (string (DamageType)=="UltimaNuke")  ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;

	         if ( !bUKBadBoyTeamDamage  && (string (DamageType)=="UltimaNuke")     )
	  if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0 ;
     [color=#FF0000]                   if ( !bUKBadBoyTeamDamage2  && (string (DamageType)=="NuclearExplosion")     )
			if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0 ;[/color]
			       if ( !bUKBadBoyTeamDamage3  && (string (DamageType)=="MushroomNuke")     )
			if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0 ;

if (! bUKBadBoyTeamPush  && (string (DamageType)=="NuclearExplosion")     )
		        if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
                        if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ;   Velocity = Vect(0,0,0);   Victim.Velocity = (Victim.Velocity * 0);
                        if (! bUKBadBoyTeamPush2  && (string (DamageType)=="MushroomNuke")     )
		        if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
                        if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ;   Velocity = Vect(0,0,0);   Victim.Velocity = (Victim.Velocity * 0);
                        if (! bUKBadBoyTeamPush3  && (string (DamageType)=="UltimaNuke")     )
		        if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
                        if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ;   Velocity = Vect(0,0,0);   Victim.Velocity = (Victim.Velocity * 0);
                        
                        
 For      NWUltimaProtosv3 and VIII    
             
              if ( ! bPlayerUltimaProtov3SelfDamage && (string (DamageType)=="Nuclear05")  ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
                if ( ! bPlayerUltimaProtovIIISelfDamage && (string (DamageType)=="NuclearUltima")  ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
               
                if ( !bUltimaProtov3TeamDamage  && (string (DamageType)=="Nuclear05")     )
			if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0 ;
                        if ( !bUltimaProtovIIITeamDamage  && (string (DamageType)=="NuclearUltima")     )
			if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0 ;
                     
                    if ( !bUltimaProtov3TeamPush  && (string (DamageType)=="Nuclear05")     )
		        if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
                        if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ;   Velocity = Vect(0,0,0);   Victim.Velocity = (Victim.Velocity * 0);
                        if ( !bUltimaProtovIIITeamPush  && (string (DamageType)=="NuclearUltima")     )
		        if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
                        if( InstigatedBy != Victim )Momentum = Vect(0,0,0) ;   Velocity = Vect(0,0,0);   Victim.Velocity = (Victim.Velocity * 0);
                        
                              
 For     NWNuclearLauncherVIII and v3                    
            if ( ! bPlayerNWNuclearLauncherSelfDamage && (string (DamageType)=="Nuclear")  ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
		if ( ! bPlayerNWNuclearLauncher2SelfDamage && (string (DamageType)=="Nuclear00")  ) if ( Victim.IsA('PlayerPawn') ) if ( InstigatedBy == Victim ) ActualDamage = 0 ;
		
		if ( !bNWNuclearLauncherTeamDamage  && (string (DamageType)=="Nuclear")     )
		        if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0  ;
			if ( !bNWNuclearLauncher2TeamDamage  && (string (DamageType)=="Nuclear00")     )
		        if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0;
			
			if (! bNWNuclearLauncherTeamPush  && (string (DamageType)=="Nuclear")     )
		      if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
		        if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ;   Velocity = Vect(0,0,0);   Victim.Velocity = (Victim.Velocity * 0);
		        if (! bNWNuclearLauncher2TeamPush  && (string (DamageType)=="Nuclear00")     )
		       if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
                        if( InstigatedBy != Victim ) Momentum = Vect(0,0,0) ;   Velocity = Vect(0,0,0);   Victim.Velocity = (Victim.Velocity * 0);
		            
Image
Image
Letylove49 aka Alicia
JackGriffin
Godlike
Posts: 3829
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: : UKBadboy ( no push when the redeemer explodes

Post by JackGriffin »

Barbie wrote: Fri Jul 25, 2025 5:25 pm Idk the full code but it looks like you set Mutator's velocity to 0. :lol:
Hey B, you brought back a great memory! I remember working on this and getting frustrated that I couldn't manually adjust the victims velocity to 0,0,0 correctly when they got blasted. Generally I code with a hammer because I'm not skilled (or smart) enough to use a scalpel. I remember testing the "velocity * 0" part and that did what I wanted it to do. I should have deleted the previous line but since it wasn't causing problems I never noticed I forgot to delete it.

God nothing is more humbling than having your code scrutinized :lol2:
So long, and thanks for all the fish