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.
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.
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
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?
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.
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.
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.
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?
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
Here this should be it:
I really need the double jumping bug fixed. Thanks!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' }
And by the way this is Angel Mappers code in the WCPlayer code.
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