Announcement

Collapse
No announcement yet.

[Tutorial] Third Person Game with GOW camera

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

    #31
    Ah, well right now the DeltaTime function isn't in the tutorial at all. It basically returns the time since the last program cycle. This is useful in the lerping functions, since the way it's written now, the lerp function is called every tick. This becomes a problem in that, this makes the speed of the zoom dependent on how fast your game runs.
    If you add in a statement telling the UDK not to lerp update unless a certain time has passed, even if the frame rate goes through the roof, the camera will still move at the same rate.

    Comment


      #32
      I tried a system where if you zoom in after a certain range, the game goes in first person mode, but when the camera goes in first person, the character is a lot higher than in third person, tested with a square texture, and if I look down, I see my character below.

      I think I will just make the character transparent when you zoom in, without going in first person. Also can you give me tips to change my character movement in such a way that he never strafes or walk backwards? I want it to always walk in the direction you press the button (relative to the camera) but turning the whole body in the direction it's moving. Only face the same way as the camera when attacking or neutral.

      A video to make it clearly:

      http://www.youtube.com/watch?v=uZkL4UBw3lE


      I just need some tips on what function does what so I can start messing around.
      Thanks in advance!

      Comment


        #33
        Right, well naturally this problem with height will happen, since the camera is centered on the center of the character, rather than the eye height. You can fix this easily if you've implemented the Z axis offset in the GOW camera portion of the tutorial. You'd simply play around with the value of TargetZ until you get the height you want.

        As for character transparency, you need to do just that: when the camera enters first person mode you need to set the value of bOwnerNoSee in your pawn script to True.

        In regards to custom player movement like what you described, I don't have enough experience right now to say exactly how you would do that. Rest assured though, when I do, I'll post a tutorial.

        Good luck and cheers!

        JT

        Comment


          #34
          I'm having issues with the camera popping way out.


          Not sure why, anyone else have this behavior?

          Comment


            #35
            Nevermind, I got it working. This is some great code, awesome tutorial. Keep it up.

            Comment


              #36
              Originally posted by farshad12 View Post
              Yes, there is not DefaultGun variable, instead you need to use this line in your GameInfo class's DefaultProperties block:

              DefaultInventory(0)=class'CustomGame.CustomLinkGun '
              hmm, thats not really working for me

              Comment


                #37
                I'm having trouble extending anything other than GameInfo.
                When I try, I lose my custom camera and can't turn it on.

                I don't think I have enough knowledge to redo the whole game system, but I can't find something that could be overwriting my camera in UDKGame or UTDeathmatch.

                Comment


                  #38
                  hi,
                  thanks for the tutorial, just started to play around with the udk, so right
                  now not really an idea what i'm doing :-)

                  it worked for me pretty well. but i can't see any weapon
                  (shooting also not possible) in the 3rd person view.
                  did i make something wrong or is that not possible yet?

                  do we have to say the engine it should render the weapons in 3rd person view?

                  (is it possible to learn the unrealscript language for a person without any c/c++ knowledge?)

                  thanks

                  Comment


                    #39
                    Originally posted by ronsen View Post
                    hi,
                    thanks for the tutorial, just started to play around with the udk, so right
                    now not really an idea what i'm doing :-)

                    it worked for me pretty well. but i can't see any weapon
                    (shooting also not possible) in the 3rd person view.
                    did i make something wrong or is that not possible yet?

                    do we have to say the engine it should render the weapons in 3rd person view?

                    (is it possible to learn the unrealscript language for a person without any c/c++ knowledge?)

                    thanks
                    Hey mate, yeah im having the same problem as you can see. Its not that we need to tell it to render, Since it is using GamePawn instead of UTPawn then we have to declare default guns and some other stuff i think, im not sure how to do it so much tho.

                    Comment


                      #40
                      Originally posted by Prophet_ View Post
                      hmm, thats not really working for me
                      It should work. What do you write for it exactly? Where you put it?

                      In the case you have a coustom weapon, you must write somthing like this:
                      Code:
                      DefaultInventory(0)=class'[YourProjectName].[CustomGun]'
                      Just replace [YourProjectName] and [CustomGun] with yours. Be sure your weapon class extends inventory class direct or indirect.

                      Otherwise if you want to use a normal weapon like LinkGun, you must write this:
                      Code:
                      DefaultInventory(0)=class'UTGame.UTWeap_LinkGun'
                      You can change UTWeap_LinkGun with any existing weapon.

                      Hope it helps.

                      Comment


                        #41
                        Great tutorial and props for commenting your code! I have a question I was hoping you could answer as you seem to have a solid understanding of UDK's camera class. Basically, I'm creating an "isometric" camera for a point-and-click player. It is largely based on the isometric tutorials that were posted here but I'm beginning to question if how it's done is a hacky solution that might lead to headaches down the road. The way it's currently set up is by changing two functions, CalcCamera in my Pawn class, and UpdateRotation in my PC class (this is the one that is really making me question whether or not it's the right way of doing it).

                        (My Pawn's DefaultCameraMode btw returns ThirdPerson) In my pawn's CalcCamera I overwrite out_CamLoc so that end = Location - Vector(Controller.Rotation) * 600.f . This is what I use to move the camera away from my Pawn, where 600.f is the camera distance. If it were a variable and I had a function for mouse wheel up/down that added/took from it, it would behave correctly for camera zooming in and out. So with the camera distance taken care of all that's left is setting up a fixed camera rotation, which is where my concern lies:

                        Currently, I'm locking the camera's rotation in my PlayerController's UpdateRotation function by defining ViewRotation.Pitch = -10000 and ViewRotation.Yaw = -5500 (respective Unr Units for the rotation degrees I wanted in my isometric camera). My understanding is that the UpdateRotation function updates both the rotation of the Controller and the Controller's Pawn, which isn't ideal for a point-and-click setup where the Pawn's rotation (based on where they're moving to) would change while the camera's rotation should remain fixed. Removing Pawn.FaceRotation(NewRotation, deltatime) at the end of UpdateRotation() would probably solve this, but I guess my question is, is this the right way of setting up my camera for my needs? Or is there a better solution involving UpdateViewTarget as you did in your custom camera. By the way I do have a custom camera that extends GameThirdPersonCamera, but all its currently doing is defining the FOV of the camera.

                        I hope my question makes sense! I've struggled making sense of 3rd person camera setup with all the various classes that can control it!

                        Comment


                          #42
                          Both of the cameras worked fine for me but I need to know how do I get my LinkGun back.

                          Comment


                            #43
                            For those without guns, read this: http://udn.epicgames.com/Three/Devel...ptProject.html

                            Comment


                              #44
                              I'm having trouble with 2 things:

                              I done the first half of the tutorial, getting a third person camera working with zoom. But when I do the next half about creating a Shoulder Cam, I can't find "UDKinput.ini". The closest is "DefaultInput.ini" (located under UDK\UDK-2010-03\UTGame\Config) because inside it I see the game's bindings.

                              Second, just a sort of off-track. I decided to change the mouse's left and right movements to that of "A" and "D" (so that the character turns left or right when you press A or D respectively).

                              That didn't work and when I pasted over the file with the original (I made a backup of the original DefaultInput.ini), the game and the editor won't rebuild even though I made sure that the file wasn't read-only.

                              Help please =( I can't figure it out.

                              Comment


                                #45
                                I second that your commenting is fantastic, robust enough to understand, but not too lengthy as to become a lecture. Keep up the good work psilocybe.

                                Comment

                                Working...
                                X