Announcement

Collapse
No announcement yet.

How to Zoom 2x, 5x, 8x, etc...?

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

    How to Zoom 2x, 5x, 8x, etc...?

    I am looking at the zoom of the Sniper Rifle and Lightning Gun and notice how you hold the AltFire down to make it increase zoom. What attributes can I look into to make it so, for Example, a click of the AltFire will increase zoom to 1/4 of the Full Zoom of the Sniper Rifle, another press makes it zoom 3/4, and another press of AltFire and it will increase the zoom to the max?

    #2
    Taking a look at the sniper rifle( ClientStartFire function) what you seem to be looking for is togglezoom() in your playercontroller
    so your gonna need a custom player controller with a custom zoom function, and a weapon that calls the togglezoom. One way of doing the zoom would be a bunch of if statements that check the current fov and change it accordingly
    Personally I alway thought the ut zoom >all

    Comment


      #3
      You mean in script? Of course. Cleanest way is to make an array of zoom levels and cycle through that.

      Comment


        #4
        fov = zoom[++i] ftw
        if statements be damned

        Comment


          #5
          Thanks Aquatic Sheep and Xyx. I am not experienced enough with Uscript yet to tell if you guys are talking about two different ways or not.
          fov = zoom[++i] ftw , what is that? Can you explain a bit more? Is the custom player controller built into the weapon.uc? I agree with you AquaticSheep the " ut zoom >all ". This is not for a sniper rifle but another weapon.

          Comment


            #6
            playercontroller is a class of its own seperate to weapon, its job is to control your pawn. I'm sure there is probably a way of zooming directly from the weapon.
            fov =zoom[++i]; like Xyx said, zoom would be an array of fovs. i is your counter, ++i increments i before fov is set, so the end result would be fov is set to the next fov level

            course then you'd want it to loop back to zero when it reaches the last zoom level
            so fov = zoom[++i%ZoomLevels]; ftw! [/rant]

            Comment


              #7
              c++ programmer?

              Comment


                #8
                Pure C all the way baby

                Comment

                Working...
                X