[solved] MH2Gold shock wave Protection

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

[solved] MH2Gold shock wave Protection

Post by Letylove49 »

Hello, i need help

How to prevent the shock wave of the redeemer so that it does not push players? (this should only protect when exploding from redeemer or other atomic weapon).

Antiboost doesnt protect against that and that disable the team-kill and i don't want that.   
Auto merged new post submitted 32 minutes later
i have fund a way :

Code: Select all

 if(!bShockWave  && (string (DamageType)=="RedeemerDeath")  )
			if ((Victim.IsA('Bot') || Victim.IsA('PlayerPawn') ) && ( InstigatedBy.IsA('Bot') || InstigatedBy.IsA('PlayerPawn') ) )
			if ( InstigatedBy != Victim ) ActualDamage = 0 ;
Last edited by Letylove49 on Tue Apr 22, 2025 8:45 pm, edited 1 time in total.
Image
Image
Letylove49 aka Alicia
User avatar
sektor2111
Godlike
Posts: 6541
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: MH2Gold shock wave Protection

Post by sektor2111 »

It is not about "ActualDamage" when it comes to the boost... and condition here is incomplete ignoring "friendly fire" settings - which ruins people's settings at this point...
Here is original incomplete code

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); //Ns: Who's Velocity ? Mutator's Velocity ??? Does it even have a logic ?
	       Victim.Velocity = (Victim.Velocity * 0); //Aha, Victim's Velocity... :/ And you will fall in a BT jump right now ?
            }
         }
      }
   }
Velocity (What Velocity ? :omfg: ) is canceled and damage removed without testing difference between "Victim" and "InstigatedBy" (like other stuff from that mod...). In that time it was no 469 fix from any kind and these codes would be advisable to be more polished than they are - also concerning amazing class called "UnrealShare.ScriptedPawn".
Stopping self damage and boosting will need some considerations with regard to "friendly-fire" options and not just canceling anything without discrimination.
Next sequence does "hitsounds", testing if a subclass "Nalirabbit" of Scriptedpawn is being hit - NaliRabbit IT'S NOT Scriptedpawn, and then it will be no deal but probing an useless "ISA", like "BabyCow" which "ISA" Cow as it was since the beginning.