Results 1 to 10 of 10
  1. #1
    MSgt. Shooter Person
    Join Date
    Feb 2012
    Posts
    72

    Default use my own player controller

    Is it possible to use my own Player Controller in my mod? I want to replace a couple of settings and functions in it. Thank you.

  2. #2
    Redeemer
    Join Date
    Jan 2004
    Location
    The great Pacific Northwest
    Posts
    1,435

    Default

    Yes it is possible. Are you making a mutator or a new gametype? And which functions are you trying to overwrite (the reason I ask is that there are often numerous ways to accomplish the same thing often without having to butcher too many classes)

    [EDIT] The 'PlayerControllerClassName' variable in the GameInfo (DeathMatch, xCTFGame, etc.) lists the player controller type as a string value. This can be set in the default properties or modified at gametime by a mutator (that sets the variable to your cusotm PlayerContoller, this is my YARM mod mutators work).
    Last edited by meowcat; 05-21-2012 at 09:01 PM.
    "What do you mean it doesn't exist clientside?"
    YARM: where player's Lean, Prone, Mantle, Dash, Crouch Jump, 'Parkour' and slide around all with generic realistic weapons!
    My Generic Mods for UT2K4:
    Yet Another Real-life Mod: Realistic weapons, unoriginal gameplay, w/ cheap CODMW knockoff mutator
    TD Vehicles: HUMV, MI4Hound, Motorcycle, IFAV Jeep, UH-60, MH-53 & AH-6 Helicopters, Abrams Tank

  3. #3
    MSgt. Shooter Person
    Join Date
    Feb 2012
    Posts
    72

    Default

    Specifically I'm making a 3rd person single player campaign for it unlike the tournament structured campaign in UT2004. I tried using Angel Mappers code for the camera positioning but it doesn't seem to recognize it. If I put the code as an expansion to Player Controller, then what piece of code defines this one to make my own Player Controller recognized?

  4. #4
    MSgt. Shooter Person
    Join Date
    Mar 2009
    Posts
    317

    Default

    Not really sure it that would help, but just in case, there are two mutators that offer the possiblity to play in 3rd person view in "regular" UT2004 and be able to aim. Perhaps having look at them could help you (at least give some trails to follow).

    AerialView:
    http://www.shaungoeppinger.com/mutaerial.html

    And Outsider (first link in the post should work):
    http://forum.omnipotents.com/showthread.php?p=162640


    Were discussed in this thread:
    http://forums.epicgames.com/threads/...tsider-Mutator
    Quite busy at the moment. If you need to contact me for whatever reason, feel free to PM/email me, that will be the quickest solution.

  5. #5
    MSgt. Shooter Person
    Join Date
    Feb 2012
    Posts
    72

    Default

    Good thanks! It's now in the game working.

    I am also using Angel Mappers code for the camera system but my player keeps floating away!!!

    Here's the post:
    http://forums.epicgames.com/threads/...hlight=ocarina

    Is there some sort of fix?
    Last edited by gruntkiller4000; 05-22-2012 at 07:40 PM.

  6. #6
    MSgt. Shooter Person
    Join Date
    Mar 2009
    Location
    .no
    Posts
    155

    Default

    You have to fix the GameInfo.GetDefaultPlayerClass () function as well.
    - The reason being that the original GameInfo.GetDefaultPlayerClass () function will attempt to spawn the class set in the user.ini file, which is usually Engine.Pawn, which is an abstract class and thus won't get spawned (and the player can't get a pawn).

    Have a look at the ASGameInfo implementation for inspiration.
    - It references the Controller.Default.PawnClass value for what pawn to spawn.
    -- That is, in your PlayerController, you set the PawnClass.
    --- This is useful if you have many different PlayerController classes.

    If not, always return the DefaultPlayerClassName from the function:

    Code:
    // In your game type class.
    
    event class<Pawn> GetDefaultPlayerClass (Controller Other)
    {
      return class<Pawn> (DynamicLoadObject (DefaultPlayerClassName, class'Class'));
    }
    Last edited by rejecht; 05-22-2012 at 08:16 PM.
    "Those are tears, Jefferson!"
    @ModDB | @Twitter | @UnrealWiki

  7. #7
    MSgt. Shooter Person
    Join Date
    Feb 2012
    Posts
    72

    Default

    When the player double jumps it's fine, then when I jump again I start floating off! I forgot to mention it before, sorry! I checked through the code several times, deleted lines, etc. I can't seem to fix it. Any ideas?

  8. #8
    Redeemer
    Join Date
    Jan 2004
    Location
    The great Pacific Northwest
    Posts
    1,435

    Default

    Paste in/post some the pertinent code.
    "What do you mean it doesn't exist clientside?"
    YARM: where player's Lean, Prone, Mantle, Dash, Crouch Jump, 'Parkour' and slide around all with generic realistic weapons!
    My Generic Mods for UT2K4:
    Yet Another Real-life Mod: Realistic weapons, unoriginal gameplay, w/ cheap CODMW knockoff mutator
    TD Vehicles: HUMV, MI4Hound, Motorcycle, IFAV Jeep, UH-60, MH-53 & AH-6 Helicopters, Abrams Tank

  9. #9
    MSgt. Shooter Person
    Join Date
    Feb 2012
    Posts
    72

    Default

    Quote Originally Posted by meowcat View Post
    Paste in/post some the pertinent code.
    Here this should be it:

    Code:
    class WCPlayer extends xPlayer config(WCGame);
    
    var int Money;
    var int WCEXP, WCEXPMax, WCEXPINC, WCLevel;
    
    var bool bHasMovedFromStart;
    var rotator NewPawnRot;
    
    function PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator CameraRotation)
    {
        Super.PlayerCalcView(ViewActor,CameraLocation,CameraRotation);
        bBehindView = True;
        bFreeCamera = true;
    
        if(Pawn != none)
        {
            if(VSize(Pawn.Acceleration) != 0 && bHasMovedFromStart)
                Pawn.SetRotation(NewPawnRot);
        }
        SetRotation(CameraRotation);
    }
    
    state PlayerWalking
    {
        function PlayerMove(float DeltaTime)
        {
            local vector A,B,C, TheAccel, HorizontalAccel;
            local eDoubleClickDir DoubleClickMove;
    	local rotator OldRotation;
            local bool  bSaveJump;
    
            GetAxes(Rotation,A,B,C);
    
            TheAccel = aForward*A + aStrafe*B + aUp*vect(0,0,1);
            HorizontalAccel = TheAccel;
            HorizontalAccel.Z = 0;
    
            OldRotation = Rotation;
    	UpdateRotation(DeltaTime, 1);
    
            if (bPressedJump && Pawn.CannotJumpNow())
            {
                bSaveJump = true;
                bPressedJump = false;
            }
            else
                bSaveJump = false;
    
            ProcessMove(DeltaTime, TheAccel, DoubleClickMove, OldRotation - Rotation);
    
            bPressedJump = bSaveJump;
    
            if(VSize(HorizontalAccel) > 0.0)
                bHasMovedFromStart = true;
    
            if(VSize(HorizontalAccel) > 0.0 && bHasMovedFromStart)
            {
                NewPawnRot = rotator(Normal(TheAccel));
                NewPawnRot.Pitch = 0;
                if(Pawn != none)
                    Pawn.SetRotation(NewPawnRot);
            }
        }
    }
    
    function rotator AdjustAim(FireProperties FiredAmmunition, vector projStart, int aimerror){
    	local rotator AimRot;
    	if (bBehindView && Pawn!=None) {
    		AimRot.Pitch = Rotation.Pitch;
    		AimRot.Yaw = Pawn.Rotation.Yaw;
    		AimRot.Roll = Pawn.Rotation.Roll;
    		return AimRot;
    	}
    	return Super.AdjustAim(FiredAmmunition,projStart,aimerror);
    }
    
    defaultproperties
    {
         WCLevel=1
         Money=500
         WCEXPMax=500
         WCEXPInc=500
         PawnClass=Class'WCGame.WCPlayerPawn'
         CheatClass=Class'WCGame.WCCheatManager'
    }
    I really need the double jumping bug fixed. Thanks!
    And by the way this is Angel Mappers code in the WCPlayer code.

  10. #10
    MSgt. Shooter Person
    Join Date
    Feb 2012
    Posts
    72

    Default

    anyone know the solution for the double jumping glitch where the player floats away after jumping again?
    Please! I really want it to work!!


 

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.