Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

UDK action game - 3rd person camera code

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

  • Hello, I have ran into a bit of a wall when using this script - I'm attempting to use the original version of the script on page1. It just appears to give me the default in-game settings of GameInfo, The steps I have taken include
    1. Created this folder "UDK-2012-10\Development\Src\ActionGame\Classes" and placed "ActionPawn.uc" + "ActionPlayerController.uc" inside with the respective code.
    2. Edited "DefaultEngine.ini" to include "+ModEditPackage=ActionGame" (Also tried +EditPackages=ActionGame for what its worth) as the last entry under the field [UnrealEd.EditorEngine]
    3. Deleted UDKEngine.ini, closed everything and recompiled all scripts without error. (Only a warning message telling me theres nothing in MyMods which is from a previous script)
    4. Open UDK navigate to world properties change PIE to gameinfo (Do not see anything resembling "ActionGame"), run the game and it just gives me the floating character with no UI.

    Those are the steps Ive taken, If i have missed something could anyone fill me in? Would be greatly appreciated!
    Thanks in advance

    Edit: Forget to add the class, Whoops! :3

    class ActionGame extends UTDeathMatch;

    defaultproperties
    {
    DefaultPawnClass=class'ActionGame.ActionPawn'
    PlayerControllerClass=class'ActionGame.ActionPlaye rController'
    MapPrefixes[0]="Action"
    }

    Comment


    • Hey. i somehow got the scripts working with my own files, but when i try running just the code you have, the mesh appears invisible. Everything compiles fine, and this bit of code:
      UTPC.SetBehindView(true);
      SetMeshVisibility(UTPC.bBehindView);
      UTPC.bNoCrosshair = true;

      should make it visible correct? If someone could help me on this, i would appreciate it.

      Comment


      • Originally posted by TheHybrid View Post
        Hey. i somehow got the scripts working with my own files, but when i try running just the code you have, the mesh appears invisible. Everything compiles fine, and this bit of code:
        UTPC.SetBehindView(true);
        SetMeshVisibility(UTPC.bBehindView);
        UTPC.bNoCrosshair = true;

        should make it visible correct? If someone could help me on this, i would appreciate it.

        I have the same problem. Everything compiles perfectly but the Mesh is not visible.

        Code:
        //override to make player mesh visible by default
        simulated event BecomeViewTarget( PlayerController PC )
        {
           local UTPlayerController UTPC;
        
           Super.BecomeViewTarget(PC);
        
          
              UTPC = UTPlayerController(PC);
              if (UTPC != None)
              {
                 //set player controller to behind view and make mesh visible
                 UTPC.SetBehindView(true);
                 SetMeshVisibility(UTPC.bBehindView); 
                 UTPC.bNoCrosshair = true;
              }
           }
        ...doesn't work.

        Anyone can help?

        Comment


        • Hi.. I saw this post and tried to used this codes.. but when I compile it says "error. in the ControllerPlayer class, "var" can't be use here" .. what could this be?

          Comment


          • I'm having the same problem of the mesh not showing up. I wonder if its something with the newest UDK build.

            Comment


            • @Carmy_Angel:
              Make sure all of your variables (var) in the class file are at the top of your script right under the "class ClassName extends ClassName" header for the .uc file thats throwing the error.

              This should fix your problem.

              Comment


              • Hi guys, i have one small problem. If i extend my game from UTGame, all this camera code isn't working, it seems like the PlayerControllerClass and DefaultPawnClass are completely ignored, i just get the UTGame default First Person Camera. Like this:

                Code:
                class TestGame extends UTGame; //this doesn't work, TestPlayerController and TestPawnClass ignored
                
                defaultproperties
                {
                	PlayerControllerClass=class'Test.TestPlayerController'
                	DefaultPawnClass=class'Test.TestPawn'
                }

                But if i extend the class from UDKGame i can see that the camera is working correctly (i set my own custom mesh). The reason why i want to extend it from UTGame is because i want to quickly get access to gun and to see how my camera behaves while firing weapons.

                Code:
                class TestGame extends UDKGame; //when extending from UDKGame it works
                
                defaultproperties
                {
                	PlayerControllerClass=class'Test.TestPlayerController'
                	DefaultPawnClass=class'Test.TestPawn'
                }
                Thanks.

                PS help for the guys who can't see their mesh: I couldn't see it as well, but i solved it by specifying the mesh i want to be displayed by putting this in the Pawn class, default properties

                Code:
                defaultproperties
                {
                
                	CamHeight = 40.0
                	CamMinDistance = 40.0
                	CamMaxDistance = 350.0
                   	CamOffsetDistance=250.0
                	CamZoomTick=20.0	
                	Begin Object Class=SkeletalMeshComponent Name=UNCSkeletalMeshComponent
                	SkeletalMesh=SkeletalMesh'CH_IronGuard_Male.Mesh.SK_CH_IronGuard_MaleA'
                	AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
                	AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale'
                	PhysicsAsset=PhysicsAsset'CTF_Flag_IronGuard.Mesh.S_CTF_Flag_IronGuard_Physics'
                	End Object
                	Mesh=UNCSkeletalMeshComponent
                	Components.Add(UNCSkeletalMeshComponent)
                }

                Comment


                • Originally posted by dejocar View Post
                  PS help for the guys who can't see their mesh: I couldn't see it as well, but i solved it by specifying the mesh i want to be displayed by putting this in the Pawn class, default properties

                  Code:
                  defaultproperties
                  {
                  
                  	CamHeight = 40.0
                  	CamMinDistance = 40.0
                  	CamMaxDistance = 350.0
                     	CamOffsetDistance=250.0
                  	CamZoomTick=20.0	
                  	Begin Object Class=SkeletalMeshComponent Name=UNCSkeletalMeshComponent
                  	SkeletalMesh=SkeletalMesh'CH_IronGuard_Male.Mesh.SK_CH_IronGuard_MaleA'
                  	AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
                  	AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale'
                  	PhysicsAsset=PhysicsAsset'CTF_Flag_IronGuard.Mesh.S_CTF_Flag_IronGuard_Physics'
                  	End Object
                  	Mesh=UNCSkeletalMeshComponent
                  	Components.Add(UNCSkeletalMeshComponent)
                  }
                  This works perfectly. Got the mesh to show up. Thanks for helping out all the people that are still starting UnrealScript

                  Comment


                  • No problem, i am starting with UnrealScript as well so i know how frustrating can it be

                    Btw update on my issue - i managed to add premade UT weapon, the 'link gun'. I can see my character now running around in 3rd person nicely, but i can't see the weapon I can fire the weapon and see projectiles, but the weapon mesh is invisible -_- Since i am using the default wepon i guess that there is nothing wrong with that, probably something lacks in this camera code which is causing the weapon to not be displayed. The original camera code from this thread was written 2.5 years ago, probably something changed in the meantime in UDK and something must be specified to display 3rd person weapons. Could anybody help? Thanks

                    Comment


                    • 3rd Person Weapon issue

                      Originally posted by dejocar View Post
                      No problem, i am starting with UnrealScript as well so i know how frustrating can it be

                      Btw update on my issue - i managed to add premade UT weapon, the 'link gun'. I can see my character now running around in 3rd person nicely, but i can't see the weapon I can fire the weapon and see projectiles, but the weapon mesh is invisible -_- Since i am using the default wepon i guess that there is nothing wrong with that, probably something lacks in this camera code which is causing the weapon to not be displayed. The original camera code from this thread was written 2.5 years ago, probably something changed in the meantime in UDK and something must be specified to display 3rd person weapons. Could anybody help? Thanks
                      Im still having same problem.. the ONLY way i have gotten it to work is to follow the isometric from UDK but thats not why where here.. WE want the mouse zoom 3d rotate and the fuctions that ACTION has gvien us. SO With the MESH issue i just read
                      Code:
                      defaultproperties
                      {
                      
                      	CamHeight = 40.0
                      	CamMinDistance = 40.0
                      	CamMaxDistance = 350.0
                         	CamOffsetDistance=250.0
                      	CamZoomTick=20.0	
                      	Begin Object Class=SkeletalMeshComponent Name=UNCSkeletalMeshComponent
                      	SkeletalMesh=SkeletalMesh'CH_IronGuard_Male.Mesh.SK_CH_IronGuard_MaleA'
                      	AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
                      	AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale'
                      	PhysicsAsset=PhysicsAsset'CTF_Flag_IronGuard.Mesh.S_CTF_Flag_IronGuard_Physics'
                      	End Object
                      	Mesh=UNCSkeletalMeshComponent
                      	Components.Add(UNCSkeletalMeshComponent)
                      }
                      This SHOWS the MESH so why cant we just SHow the Weapon???


                      SkeletalMesh=SkeletalMesh'WP_LinkGun.Mesh.SK_WP_Li nkGun_3P' is what i found for the mesh for basic link gun lets work from here

                      Comment


                      • @Supamigit man you are lucky today. I solved this problem few days ago but today i remembered that i posted in this thread so i visited it now to post my solution. And lucky you that you posted today as well the solution - the class that determines how the weapon will look like in 3rd person is the weapon attachment class. I am using my custom weapon and i set everything there, but basically this is how it should go:

                        Code:
                        class MyWeapon_Attachment extends UTBeamWeaponAttachment;
                        
                        defaultproperties
                        {
                        // this will set how the mesh will look like in 3rd person 
                        Begin Object Name=SkeletalMeshComponent0
                               SkeletalMesh=SkeletalMesh'WP_LinkGun.Mesh.SK_WP_LinkGun_3P'
                               bOwnerNoSee=false
                               bOverrideAttachmentOwnerVisibility=true
                               bOnlyOwnerSee=false
                               bIgnoreOwnerHidden=true
                        End Object
                        //MuzzleFlashSocket=MuzzleFlashSocket
                        Mesh=SkeletalMeshComponent0
                        
                        WeaponClass=class'MyWeapon_Gun'
                        }
                        Code:
                        class MyWeapon_Gun extends UTWeapon;
                        
                        defaultproperties
                        {
                        AttachmentClass=class'MyWeapon_Attachment'  //reference the attachment class
                        // Pickup staticmesh
                        Begin Object Name=PickupMesh
                        	   SkeletalMesh=SkeletalMesh'WP_LinkGun.Mesh.SK_WP_LinkGun_3P'
                               bOverrideAttachmentOwnerVisibility=true
                               bOnlyOwnerSee=false
                               bIgnoreOwnerHidden=true
                        End Object
                        }
                        Code:
                        class MyGame extends UTGame;
                        
                        static event class<GameInfo> SetGameType(string MapName, string Options, string Portal)
                        {
                        	return default.class;
                        }
                        
                        function AddDefaultInventory( pawn PlayerPawn )
                        {
                        	if( PlayerPawn.IsHumanControlled() )
                        	{
                        		PlayerPawn.CreateInventory(class'MyWeapon_Gun',true); //here we give our weapon to pawn
                        	}
                        
                        }
                        Of course there are multiple ways to do this. And you can also have other code in these classes, this just the minimum that i believe is required for weapon to appear in 3rd person! Let me know if it helped.

                        Comment


                        • This camera is amazing, thank you for making it, and it works perfectly for me in the default UDK. However I am encountering this issue with it in the blank UDK:

                          http://imgur.com/HAPzX4F

                          Does anyone know a solution to add SetBehindView back into the blank UDK?

                          Its a requirement I work within the blank one and not the default one by my games course so just using the default version of UDK isnt an option sadly

                          Thanks to anyone who can help me with this Really happy to finally have a working character in the blank UDK, just need to get the camera fixed ^_^

                          Comment


                          • I just discovered this camera, and it's fantastic! I love how the camera and the player can move separately,
                            Its far superior to the attached cameras that I've found until now for a 3D platformer I'm working on.
                            However, I've run into a predicament. When I use this camera with custom meshes, It works fine 90% of the
                            time, but depending on the angle of the camera, the mesh blanks itself out and disappears.
                            Does anyone know of any fixes for this?

                            Comment


                            • Hey everyone, This has seriously been bugging me for the past two days, but has anyone gotten this working in multiplayer? I believe I am having replication issues with the "Pawn.Acceleration = tempAccel;" line in the PlayerController class. I'm not entirely sure if the problem is centred around here because moving the character on the non-hosting client currently does nothing, although I can tell that replication is working because the AimOffset, shooting, jumping and Animslot animations are being displayed on the other client (Who is hosting a listen server). The non-hosting client shows animation and movement but resets to it's current position serverside every tick. If anyone at all can help me I would be so grateful.

                              Cheers
                              ~Lancer_Specialist

                              Comment


                              • my skeleton mesh isn't showing neither the weapon

                                Comment

                                Working...
                                X