Announcement

Collapse
No announcement yet.

Charging up to fire

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

    Charging up to fire

    Ok i have tried everything i can think of, and looked at ever actor that has a charge bar.

    But I can't seem to make a wepon that you have to charge the bar to full, and then let go to fire

    Any ideas, help please

    #2
    can't you just do a check in DoFireEffect() (in your WeaponFire class)? something like:

    Code:
    function DoFireEffect()
    {
       if(HoldTime >= myMaxHoldTime)
          super.DoFireEffect();
       else
          return;
    
       //...
    }
    
    defaultproperties
    {
       bFireOnRelease=true
       myMaxHoldTime=5
       //...
    }

    Comment


      #3
      yeah that should do it:noob:

      Comment


        #4
        The shield gun code is a great example as well.

        Comment


          #5
          SkyShooters example did not work at all, the effect still happens as soon as I press fire

          Comment


            #6
            Make sure bFireOnRelease is set to true. Oh and you need to reset the holdTime each time you actually fire.

            Comment


              #7
              And still no working...

              my code:
              Code:
              var int myMaxHoldTime;
              
              function DoFireEffect()
              {
                 if(HoldTime >= myMaxHoldTime)
                    {
                    HoldTime = 0;
                    super.DoFireEffect();
                    }
                 else
                    return;
              }
              
              DefaultProperties
              {
                  bFireOnRelease=true
                  AmmoClass=class'ShockAmmo'
                  AmmoPerFire=5
                  DamageType=class'DamTypeSuperShockBeam'
                  FireRate=0.7
                  myMaxHoldTime=5
              }
              The super class is the Enhanced Shock rifle beam
              It Fires as soon as i hit fire, every time

              Comment


                #8
                Never mind for some reason UDE was not deleting the old .u and it was not actually compline my changes...

                Still does not work though. Now it goes when I let go even if it's not fully charged, and the shot never actually happens, just the muzzle flash and ammo consumption

                Comment


                  #9
                  do you have UT2k3?? because i can't find anywhere a "Enhanced Shock rifle beam" in 2004...

                  there's a SuperShockBeamFire, but nothing enhanced.

                  just to say it clear... you have to extend a weaponfire class or one of its children. And for this it would be the SuperShockBeamFire.

                  maybe its different in 2003.

                  Comment


                    #10
                    Sorry i meant SuperShockRifleBeam, I always think of it as the Enhance Shockrifle thus the name clash

                    Comment


                      #11
                      Are you looking for a weapon exactly like the hell benders rear turret?

                      Comment


                        #12
                        i've done a simmalr weapon for UT2003. if you want to force players to fully charge before firing, use the AllowFire() function, but u must use it in your fire class, and typecast HoldTime and myMaxHoldTime. i would like to give an example, but no code infront of me ><

                        Comment

                        Working...
                        X