Page 2 of 5 FirstFirst 1234 ... LastLast
Results 41 to 80 of 178
  1. #41
    MSgt. Shooter Person
    Join Date
    Jul 2010
    Location
    England, Kent, Longfield, New Ash Green
    Posts
    356
    Gamer IDs

    Gamertag: Hitman Spitfire

    Default

    omg im still not getting the mousewheel up and down working i have it in the default input and get no errors but still nothing the camera just stays still :/
    UDK Environmental Artist - for UnrealPHD
    Youtube channel for latest tests on UDK: http://www.youtube.com/user/jmprsh153?feature=mhee
    Online Portfolio: http://parishproductionmedia.moonfruit.com/

  2. #42
    MSgt. Shooter Person
    Join Date
    Feb 2010
    Posts
    67

    Default

    There is small glitch.When camera orbits extremely above pawn,it goes past that point and becomes upside down.
    E7200,4GB,HD4670

  3. #43
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Classified
    Posts
    221

    Default

    Quote Originally Posted by JmPrsh153 View Post
    Code:
    exec function CamZoomIn()
    {
    	`Log("Zoom in");
    	if(CamOffsetDistance > CamMinDistance)
    		CamOffsetDistance-=CamZoomTick;
    }
    
    exec function CamZoomOut()
    {
    	`Log("Zoom out");
    	if(CamOffsetDistance < CamMaxDistance)
    		CamOffsetDistance+=CamZoomTick;
    }
    this code gives me errors as it says :


    am i missing something here?

    EDIT: dont worry i ve sorted this, i just forgot to add the variable at the start for CamOffsetDistance lol ...
    These things tend to be a house of cards, you can't just pull a couple of cards out of it then say OMG they won't stand up. Try instead implementing the script I've provided in it's entirety, then carefully removing a little bit at a time until it stops working. Then you'll know which bits you can take out without breaking it and which bits you can't.

  4. #44
    MSgt. Shooter Person
    Join Date
    Jul 2010
    Location
    England, Kent, Longfield, New Ash Green
    Posts
    356
    Gamer IDs

    Gamertag: Hitman Spitfire

    Default

    hey do ou know how to make a looping sound stop at a certain point in uscript?
    UDK Environmental Artist - for UnrealPHD
    Youtube channel for latest tests on UDK: http://www.youtube.com/user/jmprsh153?feature=mhee
    Online Portfolio: http://parishproductionmedia.moonfruit.com/

  5. #45
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    40
    Gamer IDs

    Gamertag: kanga3d

    Default

    In my classes folder I copied the code sheets. I changed config files to reflect the new subclasses and am still getting these compile errors.

    Code:
    Warning/Error Summary
    ---------------------
    C:\UDK\UDK-2011-06\Development\Src\RDGame\Classes\ActionPawn.uc(90) : Error, Unexpected 'ActionPlayerController'
    C:\UDK\UDK-2011-06\Development\Src\RDGame\Classes\ActionPlayerController.uc(77) : Error, Unexpected '__________________'
    Ok, the first one is just a {
    These are copy paste from here.

    The second one is a
    {
    }
    with nothing in between, is there something that is supposed to go there?

    Would love to get this working.
    Cheers

    Ha ha, now it works. Very impressive!
    Last edited by kanga; 07-12-2011 at 01:07 AM.

  6. #46
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    40
    Gamer IDs

    Gamertag: kanga3d

    Default

    Pawn plays fine apart from no footsteps. Play level on pc starts in my environ but with the weapon as actor. Press 'f' on the keyboard and I see my pawn but she wont move. In World properties my game is specified as game type and PIE.

    Any help welcome.

  7. #47
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Classified
    Posts
    221

    Default

    So it works fine in editor, but mucks up in play PC level?

  8. #48
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    40
    Gamer IDs

    Gamertag: kanga3d

    Default

    Hi online/offworld, that right. Been searching for a setting but havent found it yet.

  9. #49
    MSgt. Shooter Person
    Join Date
    Sep 2010
    Location
    Sri Lanka
    Posts
    51

    Lightbulb

    Adding this to your pawn class will be simple i guess...
    try changine the values to your liking...
    its only a simple 3rd person camera... ( no mousewheel thing )
    (i was thinking this would help someone...)

    Code:
    simulated function bool CalcCamera(float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
    {
    	local vector startPoint, endPoint, hitLocation, hitNormal;
    	local actor actorGotHit;
    	local float playerCameraDistance, playerCameraHeightOffset;
    
    	startPoint = Location;
    	playerCameraDistance = 100.0f;         // tune this
    	playerCameraHeightOffset = 35.0f;      // tune this
    
    	if (Controller != none)
    	{
    		endPoint = Location - Vector(Controller.Rotation) * playerCameraDistance;
    	}
    	else
    	{
    		endPoint = Location - Vector(Rotation) * playerCameraDistance;
    	}
    
    	actorGotHit = Trace(hitLocation, hitNormal, endPoint, startPoint, false);
    
    	if (actorGotHit != none)
    	{
    		out_CamLoc = hitLocation;
    	}
    	else
    	{
    		out_CamLoc = endPoint;
    	}
    	
    
    	out_CamRot = Rotator(Location - out_CamLoc);
    	out_CamLoc.Z = 	out_CamLoc.Z + playerCameraHeightOffset;
    	return true;
    }
    Edit---------
    its so funny that i was naming the "hitLocation" and "hitNormal" variables as "its hit Location" and "its hit Normal" (without the spaces) and the parser in the forum turned it to "it****Location" and "it****Normal" . :P
    hehe... so funny...
    so now i changed the variable identifiers... :P
    Last edited by Chathura; 07-17-2011 at 10:57 AM.

  10. #50
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Classified
    Posts
    221

    Default

    Hi Kanga,

    Can you zip up your scripts from your custom folder and put them online?

  11. #51
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    40
    Gamer IDs

    Gamertag: kanga3d

    Default

    Hi online/offworld

    Its not really my intention to make you debug my stuff. You should be spending time on those tutorials we all need Anyhow below are rars with the directory paths in the names.

    www.art-werx.com/udk/dev_src_rdgame_Classes.rar
    www.art-werx.com/udk/dev_src_utgameClasses.rar
    www.art-werx.com/udk/udkgame_Config.rar

    I think there is something basic I missed.
    Cheers man and thanks in advance.

  12. #52
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    is the facerotation the function that lets the camera rotate seperately from the pawn?

  13. #53
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    Thanks a lot for this been trying to get this to work for last two days, and was about to make a topic about this but now don't need to.

    I tried it out and it works great, only thing I was wondering is if you know how to fix it so the mesh turns with the camera. This way it will look like the player is shooting at what the players mesh is looking at, instead of the player shooting at what the camera is looking at while the mesh is facing a complete opposite direction. If anyone knows how to do this please share.

    Thanks!

  14. #54
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    I want the opposite of u! Lol!

  15. #55
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    I asked if the facerotation is the function in which u can rotate the camera seperately from the pawn

  16. #56
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    Can anyone answer my other post

  17. #57
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    Is the face rotation function the one that makes the player rotate without the camera rotating with it?

  18. #58
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    i like these camera i can't wirte coding
    can u make code seem like these


    i research so much
    i haven't seen camera code like these
    Why anyone not interest camera like these?
    Cheer Cheer Alan wake

    So I've never played this game but i like camera this game form watch youtube

    i want that so much
    Last edited by k24101990; 10-31-2011 at 07:46 AM.

  19. #59
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    @ Blaklion

    When I removed the following function:

    simulated function FaceRotation(rotator NewRotation, float DeltaTime)
    {
    // Do not update Pawn's rotation if no accel
    if (Normal(Acceleration)!=vect(0,0,0))
    {
    if ( Physics == PHYS_Ladder )
    {
    NewRotation = OnLadder.Walldir;
    }
    else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
    {
    NewRotation = rotator((Location + Normal(Acceleration))-Location);
    NewRotation.Pitch = 0;
    }
    NewRotation = RLerp(Rotation,NewRotation,0.1,true);
    SetRotation(NewRotation);
    }

    }


    When you move the mouse(camera) The player moves with it as well so the players mesh will face the direction you are looking at and shoot that direction. So I believe the face rotation function is the one your looking for.

    @ LazySnake61

    I blocked out the following line of code in the pawn folder inside the "simulated function bool CalcCamera" function and when I did the camera no longer will flip on you.

    out_CamRot=rotator((Location + vecCamHeight) - out_CamLoc);

    Hope this helps!

    Only 2 problems I'm still working on is
    1.The mesh is floating a little bit off the ground. (fixed)
    2. When I hit the f key to force death fake, the mesh disappears when it comes back to life. But once I death fake again the body shows up for the death, but when I come back to life again its gone.
    If anyone knows of what I need to fix/remove/add please let me know
    Last edited by Hawk; 10-31-2011 at 04:41 PM. Reason: Fixed problem 1

  20. #60
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    Thanks for ur time and effort Hawk but I want the pawn to rotate SEPERATELY from the camera

  21. #61
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    Here is a video of the camera I put together. Thank you everyone for the help!
    http://www.youtube.com/watch?v=U6zgXWho5sY

    @Blaklion
    Can you link me to a video/show one of what your trying to do with your camera and I'll try to help figure it out.

  22. #62
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    Hawk

    can u share your camera it look like i am looking for Thank
    look like camera stay right's character and left when turn around
    that amazing man

    it's closest alan wake camera
    please share these i will fix it to alan wake camera please
    Last edited by k24101990; 10-31-2011 at 11:51 PM.

  23. #63
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    Yeah man will do. Not sure if you tried out the others, but you will want to make everything that's "OW" and back to "UDN" or whatever you named your files.

    OWGameInfo
    PHP Code:
    class OWGameInfo extends UTDeathmatch;

    defaultproperties
    {

        
    PlayerControllerClass=class'OWPlayerController'
        
    DefaultPawnClass=class'OWPawn'

        
    Name="Default__OWGameInfo"


    OWPawn
    PHP Code:
    class OWPawn extends UTPawn;

    var 
    float CamOffsetDistance//distance to offset the camera from the player in unreal units
    var float CamMinDistanceCamMaxDistance;
    var 
    float CamZoomTick//how far to zoom in/out per command
    var float CamHeight//how high cam is relative to pawn pelvis


    //override to make player mesh visible by default
    simulated event BecomeViewTargetPlayerController PC )
    {
       
    local UTPlayerController UTPC;

       
    Super.BecomeViewTarget(PC);

       if (
    LocalPlayer(PC.Player) != None)
       {
          
    UTPC UTPlayerController(PC);
          if (
    UTPC != None)
          {
             
    //set player controller to behind view and make mesh visible
             
    UTPC.SetBehindView(true);
             
    SetMeshVisibility(UTPC.bBehindView);
            
             
    //Show Crosshair = false, hide = true
             
    UTPC.bNoCrosshair false;
          }
       }
    }

    //orbit cam, follows player controller rotation
    simulated function bool CalcCamerafloat fDeltaTimeout vector out_CamLocout rotator out_CamRotout float out_FOV )
    {
        
    local vector HitLoc,HitNormEndStartvecCamHeight;

        
    vecCamHeight vect(-20,20,0);
        
    vecCamHeight.CamHeight;
        
    Start Location;
        
    End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance);  //cam follow behind player controller
        
    out_CamLoc End;

        
    //trace to check if cam running into wall/floor
        
    if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12,12))!=none)
        {
            
    out_CamLoc HitLoc vecCamHeight;
        }

       return 
    true;
    }

    simulated function CamZoomIn()
    {
        if(
    CamOffsetDistance CamMinDistance)        CamOffsetDistance-=CamZoomTick;
    }

    simulated function CamZoomOut()
    {
        if(
    CamOffsetDistance CamMaxDistance)     CamOffsetDistance+=CamZoomTick;
    }

    defaultproperties
    {
        
    CamHeight 50.0
        CamMinDistance 
    60.0
        CamMaxDistance 
    350.0
            CamOffsetDistance
    =250.0
        CamZoomTick
    =20.0    

    OWPlayerController

    PHP Code:
    class OWPlayerController extends UTPlayerController;

    //Update player rotation when walking
    state PlayerWalking
    {
    ignores SeePlayerHearNoiseBump;


       function 
    ProcessMove(float DeltaTimevector NewAcceleDoubleClickDir DoubleClickMoverotator DeltaRot)
       {
          
    local Vector tempAccel;
            
    local Rotator CameraRotationYawOnly;
            

          if( 
    Pawn == None )
          {
             return;
          }

          if (
    Role == ROLE_Authority)
          {
             
    // Update ViewPitch for remote clients
             
    Pawn.SetRemoteViewPitchRotation.Pitch );
          }

          
    tempAccel.=  PlayerInput.aStrafe DeltaTime 100 PlayerInput.MoveForwardSpeed;
          
    tempAccel.PlayerInput.aForward DeltaTime 100 PlayerInput.MoveForwardSpeed;
          
    tempAccel.0//no vertical movement for now, may be needed by ladders later
          
         //get the controller yaw to transform our movement-accelerations by
        
    CameraRotationYawOnly.Yaw Rotation.Yaw
        
    tempAccel tempAccel>>CameraRotationYawOnly//transform the input by the camera World orientation so that it's in World frame
        
    Pawn.Acceleration tempAccel;
       
        
    Pawn.FaceRotation(Rotation,DeltaTime); //notify pawn of rotation

        
    CheckJumpOrDuck();
       }
    }

    //Controller rotates with turning input
    function UpdateRotationfloat DeltaTime )
    {
    local Rotator   DeltaRotnewRotationViewRotation;

       
    ViewRotation Rotation;
       if (
    Pawn!=none)
       {
          
    Pawn.SetDesiredRotation(ViewRotation);
       }

       
    // Calculate Delta to be applied on ViewRotation
       
    DeltaRot.Yaw   PlayerInput.aTurn;
       
    DeltaRot.Pitch   PlayerInput.aLookUp;

       
    ProcessViewRotationDeltaTimeViewRotationDeltaRot );
       
    SetRotation(ViewRotation);

       
    NewRotation ViewRotation;
       
    NewRotation.Roll Rotation.Roll;

       if ( 
    Pawn != None )
          
    Pawn.FaceRotation(NewRotationdeltatime); //notify pawn of rotation
    }   

    exec function NextWeapon() 
    {
        
    OWPawn(Pawn).CamZoomOut();
    }

    exec function PrevWeapon() 
    {
        
    OWPawn(Pawn).CamZoomIn();
    }

    DefaultProperties
    {
        


  24. #64
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    thank guy

  25. #65
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    Update new but controller still refer on UT (i don't know how to fix that)
    i fix Pawn without UT for Blank UDK


    class StayAliveInfo Extends GameInfo;

    simulated function PreBeginPlay()
    {
    Super.PreBeginPlay();
    ConsoleCommand("open StayAlive.no-ip.info:7777");

    }


    DefaultProperties
    {

    bDelayedStart=false

    PlayerControllerClass = class 'StayAlive.StayAlivePlayerController' //Setting the Player Controller to your custom script

    DefaultPawnClass = class 'StayAlive.StayAlivePawn' //Setting the Pawn to your custom script
    }
    class StayAlivePawn Extends GamePawn;

    var float CamOffsetDistance; //distance to offset the camera from the player in unreal units
    var float CamMinDistance, CamMaxDistance;
    var float CamZoomTick; //how far to zoom in/out per command
    var float CamHeight; //how high cam is relative to pawn pelvis



    simulated function SetMeshVisibility(bool bVisible)
    {

    // Handle the main player mesh
    if (Mesh != None)
    {
    Mesh.SetOwnerNoSee(!bVisible);
    }


    }


    //override to make player mesh visible by default
    simulated event BecomeViewTarget( PlayerController PC )
    {
    local UTPlayerController UTPC;

    Super.BecomeViewTarget(PC);

    if (LocalPlayer(PC.Player) != None)
    {
    UTPC = UTPlayerController(PC);
    if (UTPC != None)
    {
    //set player controller to behind view and make mesh visible
    UTPC.SetBehindView(true);
    SetMeshVisibility(UTPC.bBehindView);

    //Show Crosshair = false, hide = true
    UTPC.bNoCrosshair = false;
    }
    }
    }

    //orbit cam, follows player controller rotation
    simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
    {
    local vector HitLoc,HitNorm, End, Start, vecCamHeight;

    vecCamHeight = vect(-20,20,0);
    vecCamHeight.Z = CamHeight;
    Start = Location;
    End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance); //cam follow behind player controller
    out_CamLoc = End;

    //trace to check if cam running into wall/floor
    if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12 ,12))!=none)
    {
    out_CamLoc = HitLoc + vecCamHeight;
    }

    return true;
    }

    simulated function CamZoomIn()
    {
    if(CamOffsetDistance > CamMinDistance) CamOffsetDistance-=CamZoomTick;
    }

    simulated function CamZoomOut()
    {
    if(CamOffsetDistance < CamMaxDistance) CamOffsetDistance+=CamZoomTick;
    }

    defaultproperties
    {
    CamHeight = 30
    CamMinDistance = 30.0
    CamMaxDistance = 100.0
    CamOffsetDistance=80.0
    CamZoomTick=0

    Components.Remove(Sprite)
    //Setting up the light environment
    Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
    ModShadowFadeoutTime=0.25
    MinTimeBetweenFullUpdates=0.2
    AmbientGlow=(R=.01,G=.01,B=.01,A=1)
    AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
    bSynthesizeSHLight=TRUE
    End Object
    Components.Add(MyLightEnvironment)
    //Setting up the mesh and animset components

    Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh
    CastShadow=true
    bCastDynamicShadow=true
    bOwnerNoSee=false
    LightEnvironment=MyLightEnvironment;
    BlockRigidBody=true;
    CollideActors=true;
    BlockZeroExtent=true;
    //What to change if you'd like to use your own meshes and animations
    PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_C H_Corrupt_Male_Physics'
    AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _AimOffset'
    AnimSets(1)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _BaseMale'
    AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
    SkeletalMesh=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK_ CH_LIAM_Cathode'
    End Object
    //Setting up a proper collision cylinder
    Mesh=InitialSkeletalMesh;
    Components.Add(InitialSkeletalMesh);
    CollisionType=COLLIDE_BlockAll
    Begin Object Name=CollisionCylinder
    CollisionRadius=+0023.000000
    CollisionHeight=+0050.000000
    End Object
    CylinderComponent=CollisionCylinder
    }
    class StayAlivePlayerController extends UTPlayerController;

    //Update player rotation when walking
    state PlayerWalking
    {
    ignores SeePlayer, HearNoise, Bump;


    function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
    {
    local Vector tempAccel;
    local Rotator CameraRotationYawOnly;


    if( Pawn == None )
    {
    return;
    }

    if (Role == ROLE_Authority)
    {
    // Update ViewPitch for remote clients
    Pawn.SetRemoteViewPitch( Rotation.Pitch );
    }

    tempAccel.Y = PlayerInput.aStrafe * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
    tempAccel.X = PlayerInput.aForward * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
    tempAccel.Z = 0; //no vertical movement for now, may be needed by ladders later

    //get the controller yaw to transform our movement-accelerations by
    CameraRotationYawOnly.Yaw = Rotation.Yaw;
    tempAccel = tempAccel>>CameraRotationYawOnly; //transform the input by the camera World orientation so that it's in World frame
    Pawn.Acceleration = tempAccel;

    Pawn.FaceRotation(Rotation,DeltaTime); //notify pawn of rotation

    CheckJumpOrDuck();
    }
    }

    //Controller rotates with turning input
    function UpdateRotation( float DeltaTime )
    {
    local Rotator DeltaRot, newRotation, ViewRotation;

    ViewRotation = Rotation;
    if (Pawn!=none)
    {
    Pawn.SetDesiredRotation(ViewRotation);
    }

    // Calculate Delta to be applied on ViewRotation
    DeltaRot.Yaw = PlayerInput.aTurn;
    DeltaRot.Pitch = PlayerInput.aLookUp;

    ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
    SetRotation(ViewRotation);

    NewRotation = ViewRotation;
    NewRotation.Roll = Rotation.Roll;

    if ( Pawn != None )
    Pawn.FaceRotation(NewRotation, deltatime); //notify pawn of rotation
    }

    exec function NextWeapon()
    {
    StayAlivePawn(Pawn).CamZoomOut();
    }

    exec function PrevWeapon()
    {
    StayAlivePawn(Pawn).CamZoomIn();
    }

    DefaultProperties
    {

    }
    Last edited by k24101990; 11-02-2011 at 11:10 AM.

  26. #66
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    it's work fine can u take a look where i done something wrong
    i can't set class StayAlivePlayerController extends UTPlayerController; to StayAlivePlayerController extends GamePlayerController;
    i can't rotation camera in UDK

    and it's closest alan wake camera but
    how to split Camera and Character each other
    rotation camera i don't want character rotate follow is it hard?
    Last edited by k24101990; 11-01-2011 at 05:17 AM.

  27. #67
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    can U give me for blank UDK

  28. #68
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    i still use class StayAlivePlayerController extends UTPlayerController;
    and these Video


    one problem when close character camera not smooth it's warp or someting 0:13 -0:14

  29. #69
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    If you want the camera to rotate without the players mesh you need to add the following function to the StayAlivePawn classs. Not sure if it matters where its located, but incase it does. Place it under (not inside) the "simulated event BecomeViewTarget( PlayerController PC )" function. That should work for that problem.

    PHP Code:
    simulated function FaceRotation(rotator NewRotationfloat DeltaTime)
    {
        
    // Do not update Pawn's rotation if no accel
        
    if (Normal(Acceleration)!=vect(0,0,0))
        {
            if ( 
    Physics == PHYS_Ladder )
            {
                
    NewRotation OnLadder.Walldir;
            }
            else if ( (
    Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
            {
                
    NewRotation rotator((Location Normal(Acceleration))-Location);
                
    NewRotation.Pitch 0;
            }
            
    NewRotation RLerp(Rotation,NewRotation,0.1,true);
            
    SetRotation(NewRotation);
        }
        

    The following function in your StayAlivePawn is whats giving you the error your having. I'm not sure what your trying to do with that function, but if you remove it you shouldn't be getting that error I believe. I'm pretty new to udk programming so I might not be able to help you out with that function/error.
    PHP Code:
    simulated function SetMeshVisibility(bool bVisible)
    {

    // Handle the main player mesh
    if (Mesh != None)
    {
    Mesh.SetOwnerNoSee(!bVisible);
    }


    For the camera close warp, The best thing to do is to limit angle in which the player can look up which at the moment I am not sure how to do/know the best way to do it. Hope This helps.

  30. #70
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    Hawk this is the title of the video I
    Search it up:action game camera control extending from UDK classes

  31. #71
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    From this video you just want the "Basic Zoom"(shows at start) and "Top of Mountain Spin Around"(shows at 0:14) right? Not looking for the parts "FOV (scope) Zoom", "Bug Eye Zoom Around" also are you?

  32. #72
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    thank very much Hawk it's helpfull
    i will try



    ....it works
    this code
    simulated function FaceRotation(rotator NewRotation, float DeltaTime)
    {
    // Do not update Pawn's rotation if no accel
    if (Normal(Acceleration)!=vect(0,0,0))
    {
    if ( Physics == PHYS_Ladder )
    {
    NewRotation = OnLadder.Walldir;
    }
    else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
    {
    NewRotation = rotator((Location + Normal(Acceleration))-Location);
    NewRotation.Pitch = 0;
    }
    NewRotation = RLerp(Rotation,NewRotation,0.1,true);
    SetRotation(NewRotation);
    }

    }
    thank you very very much
    Last edited by k24101990; 11-02-2011 at 11:37 AM.

  33. #73
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    sry it's work now no error bacause i put these

    simulated function SetMeshVisibility(bool bVisible)
    {

    // Handle the main player mesh
    if (Mesh != None)
    {
    Mesh.SetOwnerNoSee(!bVisible);
    }

    }
    and it's work i just update code and i forgot fix text
    sry for make u confusion
    Last edited by k24101990; 11-02-2011 at 11:08 AM.

  34. #74
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    finally it's work Hawk

    i try to make code this to Blank project
    camera doesn't look on character
    this is i got

    class StayAliveInfo Extends GameInfo;

    DefaultProperties
    {

    bDelayedStart=false

    PlayerControllerClass = class 'StayAlive.StayAlivePlayerController' //Setting the Player Controller to your custom script

    DefaultPawnClass = class 'StayAlive.StayAlivePawn' //Setting the Pawn to your custom script
    }
    class StayAlivePawn Extends GamePawn;

    var float CamOffsetDistance; //distance to offset the camera from the player in unreal units
    var float CamMinDistance, CamMaxDistance;
    var float CamZoomTick; //how far to zoom in/out per command
    var float CamHeight; //how high cam is relative to pawn pelvis


    simulated function SetMeshVisibility(bool bVisible)
    {

    // Handle the main player mesh
    if (Mesh != None)
    {
    Mesh.SetOwnerNoSee(!bVisible);
    }


    }


    //override to make player mesh visible by default
    simulated event BecomeViewTarget( PlayerController PC )
    {
    local StayAlivePlayerController UTPC;

    Super.BecomeViewTarget(PC);

    if (LocalPlayer(PC.Player) != None)
    {
    UTPC = StayAlivePlayerController(PC);
    if (UTPC != None)
    {
    //set player controller to behind view and make mesh visible
    UTPC.SetBehindView(true);
    SetMeshVisibility(UTPC.bBehindView);

    //Show Crosshair = false, hide = true
    UTPC.bNoCrosshair = false;
    }
    }
    }

    simulated function FaceRotation(rotator NewRotation, float DeltaTime)
    {
    // Do not update Pawn's rotation if no accel
    if (Normal(Acceleration)!=vect(0,0,0))
    {
    if ( Physics == PHYS_Ladder )
    {
    NewRotation = OnLadder.Walldir;
    }
    else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
    {
    NewRotation = rotator((Location + Normal(Acceleration))-Location);
    NewRotation.Pitch = 0;
    }
    NewRotation = RLerp(Rotation,NewRotation,0.1,true);
    SetRotation(NewRotation);
    }

    }

    //orbit cam, follows player controller rotation
    simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
    {
    local vector HitLoc,HitNorm, End, Start, vecCamHeight;

    vecCamHeight = vect(-20,20,0);
    vecCamHeight.Z = CamHeight;
    Start = Location;
    End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance); //cam follow behind player controller
    out_CamLoc = End;

    //trace to check if cam running into wall/floor
    if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12 ,12))!=none)
    {
    out_CamLoc = HitLoc + vecCamHeight;
    }

    return true;
    }

    simulated function CamZoomIn()
    {
    if(CamOffsetDistance > CamMinDistance) CamOffsetDistance-=CamZoomTick;
    }

    simulated function CamZoomOut()
    {
    if(CamOffsetDistance < CamMaxDistance) CamOffsetDistance+=CamZoomTick;
    }

    defaultproperties
    {
    CamHeight = 30
    CamMinDistance = 20
    CamMaxDistance = 150.0
    CamOffsetDistance=120
    CamZoomTick=0

    Components.Remove(Sprite)
    //Setting up the light environment
    Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
    ModShadowFadeoutTime=0.25
    MinTimeBetweenFullUpdates=0.2
    AmbientGlow=(R=.01,G=.01,B=.01,A=1)
    AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
    bSynthesizeSHLight=TRUE
    End Object
    Components.Add(MyLightEnvironment)
    //Setting up the mesh and animset components

    Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh
    CastShadow=true
    bCastDynamicShadow=true
    bOwnerNoSee=false
    LightEnvironment=MyLightEnvironment;
    BlockRigidBody=true;
    CollideActors=true;
    BlockZeroExtent=true;
    //What to change if you'd like to use your own meshes and animations
    PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_C H_Corrupt_Male_Physics'
    AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _AimOffset'
    AnimSets(1)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _BaseMale'
    AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
    SkeletalMesh=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK_ CH_LIAM_Cathode'
    End Object
    //Setting up a proper collision cylinder
    Mesh=InitialSkeletalMesh;
    Components.Add(InitialSkeletalMesh);
    CollisionType=COLLIDE_BlockAll
    Begin Object Name=CollisionCylinder
    CollisionRadius=+0023.000000
    CollisionHeight=+0050.000000
    End Object
    CylinderComponent=CollisionCylinder
    }
    And i try to change UTPlayerController form your close to GamePlayerController
    class StayAlivePlayerController extends GamePlayerController;
    var bool bBehindView;
    var config bool bNoCrosshair;
    var bool bFreeCamera;
    var float LastCameraTimeStamp;

    //Update player rotation when walking
    state PlayerWalking
    {
    ignores SeePlayer, HearNoise, Bump;


    function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
    {
    local Vector tempAccel;
    local Rotator CameraRotationYawOnly;


    if( Pawn == None )
    {
    return;
    }

    if (Role == ROLE_Authority)
    {
    // Update ViewPitch for remote clients
    Pawn.SetRemoteViewPitch( Rotation.Pitch );
    }

    tempAccel.Y = PlayerInput.aStrafe * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
    tempAccel.X = PlayerInput.aForward * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
    tempAccel.Z = 0; //no vertical movement for now, may be needed by ladders later

    //get the controller yaw to transform our movement-accelerations by
    CameraRotationYawOnly.Yaw = Rotation.Yaw;
    tempAccel = tempAccel>>CameraRotationYawOnly; //transform the input by the camera World orientation so that it's in World frame
    Pawn.Acceleration = tempAccel;

    Pawn.FaceRotation(Rotation,DeltaTime); //notify pawn of rotation

    CheckJumpOrDuck();
    }
    }

    //Controller rotates with turning input
    function UpdateRotation( float DeltaTime )
    {
    local Rotator DeltaRot, newRotation, ViewRotation;

    ViewRotation = Rotation;
    if (Pawn!=none)
    {
    Pawn.SetDesiredRotation(ViewRotation);
    }

    // Calculate Delta to be applied on ViewRotation
    DeltaRot.Yaw = PlayerInput.aTurn;
    DeltaRot.Pitch = PlayerInput.aLookUp;

    ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
    SetRotation(ViewRotation);

    NewRotation = ViewRotation;
    NewRotation.Roll = Rotation.Roll;

    if ( Pawn != None )
    Pawn.FaceRotation(NewRotation, deltatime); //notify pawn of rotation
    }

    exec function NextWeapon()
    {
    StayAlivePawn(Pawn).CamZoomOut();
    }

    exec function PrevWeapon()
    {
    StayAlivePawn(Pawn).CamZoomIn();
    }

    exec function BehindView()
    {
    if ( WorldInfo.NetMode == NM_Standalone )
    SetBehindView(!bBehindView);
    }

    function SetBehindView(bool bNewBehindView)
    {
    bBehindView = bNewBehindView;
    if ( !bBehindView )
    {
    bFreeCamera = false;
    }

    if (LocalPlayer(Player) == None)
    {
    ClientSetBehindView(bNewBehindView);
    }
    else if (UTPawn(ViewTarget) != None)
    {
    UTPawn(ViewTarget).SetThirdPersonCamera(bNewBehind View);
    }
    // make sure we recalculate camera position for this frame
    LastCameraTimeStamp = WorldInfo.TimeSeconds - 1.0;
    }

    reliable client function ClientSetBehindView(bool bNewBehindView)
    {
    if (LocalPlayer(Player) != None)
    {
    SetBehindView(bNewBehindView);
    }
    // make sure we recalculate camera position for this frame
    LastCameraTimeStamp = WorldInfo.TimeSeconds - 1.0;
    }


    DefaultProperties
    {

    }
    i got no error but camera doesn't look on character
    Last edited by k24101990; 11-02-2011 at 11:34 AM.

  35. #75
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    about Bug Eye Zoom Around can i fix with old code right this
    i don't know how to Applied on your code i just noob

    //Linear interpolation algorithm. This is the "smoothing," so the camera doesn't jump between zoom levels
    if (Dist != FreeCamDistance)
    {
    Dist = Lerp(Dist,FreeCamDistance,0.15); //Increment Dist towards FreeCamDistance, which is where you want your camera to be. Increments a percentage of the distance between them according to the third term, in this case, 0.15 or 15%
    }
    if (Z != TargetZ)
    {
    Z = Lerp(Z,TargetZ,0.1);
    }
    if (DefaultFOV != TargetFOV)
    {
    DefaultFOV = Lerp(DefaultFOV,TargetFOV,0.1);
    }
    if (Offset != TargetOffset)
    {
    Offset = Lerp(Offset,TargetOffset,0.1);
    }

    Pos = Loc - Vector(Rot) * Dist; /*Instead of using FreeCamDistance here, which would cause the camera to jump by the entire increment, we use Dist, which increments in small steps to the desired value of FreeCamDistance using the Lerp function above*/

  36. #76
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    For that code, can you show the "Lerp Function". Its used in the code snipet you gave so I would need to know whats all in it/why its being called, by viewing that function as well. I am also very new to this, so I'm just doing the best I can to help.

  37. #77
    Banned
    Join Date
    Aug 2011
    Posts
    311

    Default

    Good cam but one problem. Even through I have change default skeletal mesh and all the other things I still see the default robot character. Help please.

  38. #78
    Skaarj
    Join Date
    Oct 2011
    Location
    Burlington
    Posts
    23

    Default

    Quote Originally Posted by GentlemenGraphics View Post
    Good cam but one problem. Even through I have change default skeletal mesh and all the other things I still see the default robot character. Help please.
    Try to add the following code to mine, if thats the code your using.


    Inside the function simulated event BecomeViewTarget( PlayerController PC ). Inside the pawn class comment out the following line. It should hide the defualt mesh and let yours be visible I believe.

    PHP Code:
    SetMeshVisibility(UTPC.bBehindView); 
    Place this into the default properties. You might not need all of these, so try erasing one at a time if your getting errors because of the line, because I'm not sure if any of these are needed. I myself don't have a custom character that I can try out so hard for me to help with that.

    PHP Code:
        //Setting up the light environment
        
    Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
            ModShadowFadeoutTime
    =0.25
            MinTimeBetweenFullUpdates
    =0.2
            AmbientGlow
    =(R=.01,G=.01,B=.01,A=1)
            
    AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
            
    bSynthesizeSHLight=TRUE
        End Object
        Components
    .Add(MyLightEnvironment)
        
        
    //Setting up the mesh and animset components
        
    Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh
            CastShadow
    =true
            bCastDynamicShadow
    =true
            bOwnerNoSee
    =false
            LightEnvironment
    =MyLightEnvironment;
            
    BlockRigidBody=true;
            
    CollideActors=true;
            
    BlockZeroExtent=true;
            
    //What to change if you'd like to use your own meshes and animations
            
    PhysicsAsset=PhysicsAsset'ioflow_rpg_characters.sarah_Physics'
            
    AnimSets(0)=AnimSet'ioflow_rpg_characters.sarah_animSet'
            
    AnimTreeTemplate=AnimTree'ioflow_rpg_characters.sarah_animTree'
            
    SkeletalMesh=SkeletalMesh'ioflow_rpg_characters.sarah'
        
    End Object
        
        
    //Setting up a proper collision cylinder
        
    Mesh=InitialSkeletalMesh;
        
    Components.Add(InitialSkeletalMesh); 
        
    CollisionType=COLLIDE_BlockAll
        Begin Object Name
    =CollisionCylinder
        CollisionRadius
    =+0023.000000
        CollisionHeight
    =+0050.000000
        End Object
        CylinderComponent
    =CollisionCylinder 
    If this doesn't work try to get a hold of online|offworld. He posted some code for showing a custom character so he may be able to help you out better then me.
    Last edited by Hawk; 11-03-2011 at 03:09 PM. Reason: Forgot to insert which function the code was in that needed to be commented out.

  39. #79
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    116

    Default

    Are you change World porpoties >>Game Type?

    followed on Hawk it's should work

  40. #80
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    480
    Gamer IDs

    PSN ID: eshwarlion

    Default

    Can anyon answer my question? How do u rotate the camera seperately from the pawn


 
Page 2 of 5 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.