Announcement

Collapse
No announcement yet.

[Tutorial] Third Person Game with GOW camera

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

    #46
    Hey guys, thanks for the comments, and sorry for the long time between my own comments.

    So, for everyone who is wondering about weapons, this tutorial is written with entirely custom scripts, meaning that really hardly anything besides the camera and basic movement stuff is implemented. This means, that, just by following this tutorial, you will not have weapons. You'll need to implement them yourself.

    This leaves you with a few options.

    Number one, you could follow one of the tutorials the exist on custom weapons, although this might require a fair bit of coding, and you'll have to understand how to properly mesh the two tutorials.
    Number two, you could attempt to extract the weapons related code from the UTGame scripts.
    Number three, if you're not interested in creating a full game, you could use the camera script and adapt it to work with the UTGame scripts so as to port this into Unreal Tournament.

    If I had the time right now (which I may have fairly soon), I'd go in and see if I could work one of these solutions myself and post up a tutorial. For now, though, unfortunately you're on your own with weapons.

    As for specifics, Ronsen, like I said, this tutorial does not currently include weapons, but you could try one of the ideas I listed above. About c/c++, I think it's entirely possible to learn Unrealscript without knowing c++ first. All it takes is a little drive to learn how c++ works, since unrealscript is based in c++. I myself hadn't done any c++ at all in years, and I'm foraging ahead ok.

    @rahatropa, thanks much for the compliments! The way you're doing seems like it would work fine, but I would recomment consolidating all of your essential camera functions in your camera script. This way, when you create a game with a bunch of different viewpoints and such, you need only to define your camera class from the playercontroller script and everything switches correctly. As for how to do it in the camera script, let me run over the major points:

    First, I would do zooming using freecamdistance as described in my tutorial. This consolidates all of your vector math and camera functions in the camera script. Keeping everything in the camera script will definitely make things less confusing.

    As for how to lock camera angles, it's fairly simple. I'm using some script from this tutorial for the example, as I don't know what your code looks like, but hopefully it will be clear:

    Lets take our camera script from the first tutorial section and add an isometric state.

    Code:
    Under our switch-case statement, below the if statement for ThirdPerson camera style, we'll add another if statement.
    
    if (CameraStyle == 'Isometric') // A basic if statement
    {
    	Rot.pitch = -10000;
               Rot.yaw = -5500; // With these two statements, we're telling the camera to stay fixed at these rotation values, provided by rahatropa
    
    }
    
    You're also going to need to add the line case 'Isometric' : under the case declaration for ThirdPerson. You will also, of course, also have to provide a way to switch camerastyles; this is described in the GOW Camera section of the tutorial.
    Now, if you're using any tutorials I've read, the camera script should use a variable called Rot for the rotation of the camera, as it is here, so this should be relevant to whatever sort of script you're using. If you need to address this rotation from outside the camera script, you'll need to address it by typecasting. If you need help on any of this, please post your code either here or in another thread, and I'd be happy to take a look.

    @Sashy, like I said, I haven't tried using this with existing scripts that come with the UDK. What scripts are you creating custom and what scripts are you taking from UT3 or UDK?

    If I've missed anyone, or anything isn't clear, just post or message me, and I'll get back to you ASAP.

    Cheers!

    Comment


      #47
      Originally posted by jhawks View Post
      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.

      UTInput.ini

      it is in the releases 'BEFORE' april
      everything works PERFECTLY! i added the Crosshair and Targetinfos from the UDN tutorials. brilliant. camera got collision.

      I simply <3 you

      my question here is :

      since i would like to do some transitions between a "sequence" camera i wonder how to return to the "custom or your camera"..
      basically i am doin transitions with matinee, and need the "camera object" ?!?
      how to access your camera/s within UT by matinee ?!

      thanks !

      Comment


        #48
        Originally posted by Psilocybe View Post
        @Sashy, like I said, I haven't tried using this with existing scripts that come with the UDK. What scripts are you creating custom and what scripts are you taking from UT3 or UDK?

        If I've missed anyone, or anything isn't clear, just post or message me, and I'll get back to you ASAP.

        Cheers!
        Simply using anything other than GameInfo will deactivate your camera.
        D:

        UTDeathMatch or UDKGame.

        Comment


          #49
          @ k0s, Thank you for answering that question, and @jhawks, sorry I missed it! Like he said, this was written on the April release, meaning that pretty much everything that had the prefix UT no says UDK. UTInput.ini should serve your purposes just fine.

          As for your second question, it won't rebuild, as in it throws back an error (and if so, what error) or it says that nothing needs compiling?

          @k0s, I haven't done much work in Matinee yet, but I imagine there is some sort of switch that allows you to return to the default camera after a cut scene.

          @Sashy, did you try putting the relevant code:

          Code:
          bDelayedStart=false
          PlayerControllerClass = class 'YourGame.YourGamePlayerController' //Setting the Player Controller to your custom script
          DefaultPawnClass = class 'YourGame.YourGamePawn' //Setting the Pawn to your custom script
          into the defaultproperties of UTDeathMatch or UDKGame? If you've already tried this, look around in the script files and find anything that could be changing these default values.

          It sounds like everyone is getting some utility out of this

          Cheers!

          Comment


            #50
            Thanks again for all of the work on this.
            I switched it up a little, made the shouldercam the default camera, adjusting the placement is really easy this way. I really like how it is pretty simple and easy to understand. I was looking at another code that does 3rd person and also cover as well and it made my eyes cross.

            Anyways, my question is the HUD. Before I start playing with it. Would I just bring over anything from the default ini files that are for HUD options and place them into the new ini files? And if so where do they go.

            Thats really my big problem in understanding script. I don't know where to put in new code to expand this tutorial without breaking everything and being yelled at by udk.
            I'm sure there is a tutorial on basic scripting. But any of the basic ones I've found just rehash basically what's already in your tutorial.

            ... I'm most likely just looking in the wrong place I think.

            anyways, thanks again for this really good tutorial.

            Comment


              #51
              Originally posted by k0s View Post
              UTInput.ini

              it is in the releases 'BEFORE' april
              everything works PERFECTLY! i added the Crosshair and Targetinfos from the UDN tutorials. brilliant. camera got collision.

              I simply <3 you

              my question here is :

              since i would like to do some transitions between a "sequence" camera i wonder how to return to the "custom or your camera"..
              basically i am doin transitions with matinee, and need the "camera object" ?!?
              how to access your camera/s within UT by matinee ?!

              thanks !
              If your talking about a cinematic type of event? Or just changing the camera in special places in your map?

              I have been doing a little reading on the cinematic event, which would be another level, level a ends where the cinematic begins, and level b begins where the cinematic ends.

              You could most likely do that for special places maybe with level streaming. (which I have not played with yet, so I could be WAY off.) But my idea would be to split it into 3 levels as well, except instead of animation of cinematic event, it would be cinematic cameras with player controlled movement, so basicly set up the same way. and if level streaming works like I think it might, (As in load another map into memory as you come to the point, or it works by only loading small parts of the map at a time) but then again if the level is really small maybe you could do the 3 cuts without a big delay inbetween if kept really small. again . just a thought.
              or just ... I dunno. I'll play with it more after work tomorrow.

              Comment


                #52
                @sirtoggle, It sounds like you're getting the hang of it. Keep messing around with the code, and above all, keeping going through tutorials on not only Unrealscript, but C++ as well. Understanding basic program flow, functional programming, and things like if then else statements is key to learning Unrealscript.

                If you have some specific questions about how to do something, first search and see if someone has a tutorial, and then go ahead and post a thread to get some hands-on help.

                I'd have to disagree with you there on cinematics though. As I understand it, you can take control of the camera and freeze the player (there's an event for that) when you start a Matinee event and proceed to run your animations and such, and then hand control back to the player (again, I've used a kismet event that does this), all within the same level.

                When I get more time to work on my current project, I'll keep everyone updated about how I go about scripting the cut scenes (and everything else too!)

                Cheers.

                Comment


                  #53
                  Yeah I see what you were talking about I haven't played with it too much yet.

                  also I did a search before for hud, and got nothing, now I did one for 'take damage, kismet' and found a detailed tutorial.
                  http://forums.epicgames.com/showthre...Damage,+Kismet
                  If anyone else is pondering the same questions in life as I am.

                  Comment


                    #54
                    hi
                    i'm a real newbie and this is the first time i come here and see anyone's post. this is the first time i hear about UDK and the third person.
                    when i install UDK, there're two major icons, UDK Game and UDK Editor in the start menu. when i run the editor, i blank map brings up without any changes being applied. when i bring up the game it also brings the game and not any changes above r applied. i created the four scripts, but nothing changed.

                    Comment


                      #55
                      i get a Message:
                      Scripts are outdated. Would you like to rebuild now?
                      i select Yes. then scripts are compiled in a window that never closed. it seems that something remains up after compilation succeeds. because the message appears again if i close the window manually and try to run the game again.
                      it sounds something is going wrong. what's the problem?

                      Comment


                        #56
                        the compilation window output is as follows:
                        Init: Command line:
                        Init: Base directory: C:\UDK\UDK-2010-04\Binaries\Win32\
                        Init: Character set: Unicode
                        Log: Executing Class UnrealEd.MakeCommandlet
                        --------------------Core - Release--------------------
                        --------------------Engine - Release--------------------
                        --------------------GameFramework - Release--------------------
                        --------------------UnrealEd - Release--------------------
                        --------------------IpDrv - Release--------------------
                        --------------------OnlineSubsystemPC - Release--------------------
                        --------------------UDKBase - Release--------------------
                        --------------------UTEditor - Release--------------------
                        --------------------UTGame - Release--------------------
                        --------------------UTGameContent - Release--------------------
                        --------------------YourGame - Release--------------------
                        Warning, Can't find files matching C:\UDK\UDK-2010-04\Binaries\Win32\..\..\Development\Src\YourGame\C lasses\*.uc

                        Warning/Error Summary
                        ---------------------
                        Warning, Can't find files matching C:\UDK\UDK-2010-04\Binaries\Win32\..\..\Development\Src\YourGame\C lasses\*.uc

                        Success - 0 error(s), 1 warning(s)

                        Execution of commandlet took: 19.76 seconds

                        Comment


                          #57
                          by creating the requested folder the compilation succeeded with no error/ no warnings. i closed the compilation window manually. the next time i started the game it launched without the message. but nothing differed. the game started as it was. maybe i've to toggle between cameras? how?

                          Comment


                            #58
                            @ hamidi
                            Left shift is the camera toggle key if you did everything as per the tutorial.

                            By your first post I am assuming that you are trying to test this on a blank map, if so you will need to make a test map and build all, or load a map that came with UDK. then right click and goto 'play from here' or 'play level' or even 'play in viewport' to see the changes this makes.
                            Again I might just be assuming wrong. I tend to do that a lot.

                            Comment


                              #59
                              for the love of all things Holy, please put your DefaultProperties blocks at the END of your source.

                              Comment


                                #60
                                i created the scripts based on the documents.
                                i'm not going to change the default map at the point.
                                when i run the game and click the left Shift key nothing changes.
                                how can i make sure that the problem is for scripts or for something else.
                                what can be wrong?
                                thx

                                Comment

                                Working...
                                X