Announcement

Collapse
No announcement yet.

Coding recharging armor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Coding recharging armor

    I'm kinda new to uscript. I was wondering if anybody knew of a tutorial or the files needed to code recharging armor. (Just like Halo... how the shield recharges) I'm looking to do something similar to this. Actually totally like this... even the HUD. LOL. But, I'm not worried about the HUD just yet.

    Basicly a way the player would always have 100 Armor at spawn and it would recharge back to 100 if no damage was being dealt to player after so many seconds.

    #2
    Perhaps you could do something like the Regeneration mutator in ut2003 (MutRegen.uc), only apply it to armor instead of health.

    Comment


      #3
      Armor Mod

      This should do most of what you would like. Players start at 100 armor and get 5 every two seconds.


      //-----------------------------------------------------------
      // MutXRegenShield
      //-----------------------------------------------------------
      class MutXRegenArmor extends Mutator;

      var float RegenPerInterval;
      var float RegenInterval;

      //Remove all the existing Armor
      function bool IsRelevant(Actor Other, out byte bSuperRelevant)
      {
      if ( Other.IsA('ArmorPickup') )
      {
      bSuperRelevant = 0;
      return false;
      }

      if ( Pawn(Other) != None )
      {
      Pawn(Other).ShieldStrength = 100;
      }
      return Super.IsRelevant(Other, bSuperRelevant);
      }

      // Don't call Actor PreBeginPlay() for Mutator
      event PreBeginPlay()
      {
      SetTimer(RegenInterval,true);
      }

      //Update the armor if it is the same as the last update
      function Timer()
      {
      local Controller C;

      for (C = Level.ControllerList; C != None; C = C.NextController)
      {
      if (C.Pawn != None && C.Pawn.ShieldStrength < 100)
      {
      C.Pawn.ShieldStrength = Min( C.Pawn.ShieldStrength+RegenPerInterval, 100);
      }
      }

      }

      defaultproperties
      {
      RegenPerInterval=5.000000
      RegenInterval=2.0
      GroupName="Armor"
      FriendlyName="Ultra Armor Regeneration"
      Description="All players regenerate armor to 100."
      }

      Comment


        #4
        Thx you so much for the help guys.

        Comment


          #5
          u know, there is already a halo shield mutator for ut2004/03. Its called HaloShiled2k4. It will regen your shiekd anywhere up to 1000 at any rate of speed. And you can set it to be any amount of time without being hit before it recharges. U can download it off ut2003hq.com if you want to try it.

          Comment

          Working...
          X