@Dvoyles
What is this supposed to mean?
Also, missing your input bindings.PHP Code:Rot = PCOwner.Owner.Rotation;
@Dvoyles
What is this supposed to mean?
Also, missing your input bindings.PHP Code:Rot = PCOwner.Owner.Rotation;
Lead Programmer
It's the Only NEET Thing to Do
Programming for non-fiction.
I'm the function of my code. Conditions are my body and calls are my blood. I have input over a thousand lines. Unknown of bugs, nor known to work. Have withstand coffee to create many programs. Yet, those hands will never code anything again. So, as I pray, Unlimited Code Works.
Great tutorial,but i get one trouble
no error , no warning but can not start UDK game please anyone help me![]()
When that happens is either an error in some .ini files or some asset.
I would bet on the .ini file.
Lead Programmer
It's the Only NEET Thing to Do
Programming for non-fiction.
I'm the function of my code. Conditions are my body and calls are my blood. I have input over a thousand lines. Unknown of bugs, nor known to work. Have withstand coffee to create many programs. Yet, those hands will never code anything again. So, as I pray, Unlimited Code Works.
Hey guys,
First of all thank you so much to Psilocybe for putting such a great tutorial together. So intuative and easy to follow.
For those asking about the weapons I think I figured it... to an extent. I've not managed to be able to extend the deathmatch stuff so that you can pick up items and weapons but you can give the player a weapon to start off with. I tried the default inventary property but that didnt work for me.
Instead I added a weapon class and a inventory management class. Here you can assign a weapon to your player.
To set up these classes there is a brilliant and in-depth tutorial from Mougli which you can find here
http://www.moug-portfolio.info/index...apons---basics
I also extended my Pawn from UDKPawn and PlayerController from UDKPlayerController, hope this helps some people out. Couldnt have done it without Mougli and Psilocybe, thanks for the great help guys!
Pete
Hey guys, first off great tutorial. I had originally been using the quick kismet approach but this one suits my game needs far more.
I have a few problems, or moreso questions I was wondering about.
Like an above poster I seem to have 0 sound when running in this game mode. I tried finding where sounds are referenced but was unable. If anyone has a way to fix this or a link on how sounds work in UDK that would be great.
Secondly based on the following line -
I assume that scrolling in should bring it into first person. Yet my camera just moved to the back of the pawn. Wondering if this needs to be flushed out further to go seamlessly into first person.Code:case 'FirstPerson' : // Simple first person, view through viewtarget's 'eyes' default : OutVT.Target.GetActorEyesViewPoint(OutVT.POV.Location, OutVT.POV.Rotation); break;
Also I am wondering if it is possible to make it so that the camera can be moved independently of the character by holding down the right mouse button (similar to how you do a camera rotate in an MMO)
Pretty new to scripting and am looking to learn more than just be told how to do it so if anyone knows of tutorials I can combine with this one to increase what it can do it would be appreciated and also how to fix the sound issue.
Dvolyles, you must have an exec function related to that isometric cam so it would look something like this in your camera: (look for anything with Isometric in it)
and you MUST put this in your player controllerCode:case 'ThirdPerson' : //Enters here as long as CameraStyle is still set to ThirdPerson case 'FreeCam' : case 'ShoulderCam' : // Over the shoulder view case 'IsometricCam' : //iso mode Loc = OutVT.Target.Location; // Setting the camera location and rotation to the viewtarget's Rot = OutVT.Target.Rotation; if (CameraStyle == 'ThirdPerson') { Rot = PCOwner.Rotation; //setting the rotation of the camera to the rotation of the pawn TargetZ = 0; TargetFOV = 90; TargetOffset = 0; } if (CameraStyle == 'ShoulderCam') { Rot = PCOwner.Rotation; FreeCamDistance = 64; TargetFOV = 60.f; TargetZ = 32; TargetOffset = 32; } if (CameraStyle == 'IsometricCam') { 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 }
Let me know how your codes go!Code:exec function CommandCam() //This is called on release of left shift { `Log("Command Mode"); PlayerCamera.FreeCamDistance = PreDist; // Restoring the previous camera distance PRCamera(PlayerCamera).CameraStyle = 'IsometricCam'; // Restoring the previous camera style }
Then your key binding will be able to work. Thank you for the script OP it was an incredible help for my camera troubles!
Works so far with a couple of warnings considering envirnoment something and what not.Now I'll try the over the shoulder type. After I get some sleep. I dont know how to start with weapons tho. :P
Thedoesnt do anything for me. :PCode:DefaultInventory(0)=class'UTGame.UTWeap_LinkGun'
Does anyone here have Custom Gametypes working with the August 2011 version of Frontend?
For some reason I can't get it to work the way I did before (I recently updated from the December 2010 version.)
Has this been tested with the newer version of UDK such as the Aug or July versions
This still works even in the August build! I know because I currently use this perfect code! But I was wondering if anyone has figured out how to rotate the pawn, I've been trying different methods but I cannot seem to get it right so that when you right click the "camera" follows you and not the pawn (but the camera is restricted to the pawn) so basically the camera can go in a circle around the pawn!
If anyone has any idea that would help alot!
hey guys
I got the august build, have copy and pasted this tutorial (except i haven't created a game content folder... just the YOURGAME folder and the 4 .uc class files in the classes folder)
....but I cant find this "UDK launcher" thats mentioned.
so i try to jump into the UDK Game and it says "scripts outdated... build now?"
I hit okay and it builds with a few small yellow warnings but otherwise okay.
i then jump back into UDK game again, hit instant action and start a game but i dont have a 3rd person camera. Can anyone advise me what i'm doing wrong please? Its really butchering my head :/
ta
ant
edit - I used the unreal frontend exe then cloned DM-Deck, renamed it to ANT_COMPILE then replaced the "map to cook" with my ant_test_level.udk level (which basically spawns a deathmatch bot that tries to kill me and plonks us both on the top of a box with a tree for reference!). That seemed to cook successfully and load up in the udk game as a selectable level.
I wasn't seeing my character that i control in 3rd person camera though even when i pressed the shift key
unexpected bonus of seeing my character run around too (altho it crashed a moment or two later) as i pointed the UTpawn to my character earlier on today![]()
Good tutorial! I am having a problem though, I followed the whole thing to the letter, and when I press shift to go o the over the shoulder mode, nothing happens. It seems that after editing both defaultinput.ini and UDKinput.ini the shift button is still used for the walk/run control. Any ideas? I am using the September beta btw![]()
Nvm, I got it :P works perfectly btw! One question though, is there a way to have the camera be able to rotate the pawn when the "aim" key is not being pressed?
I am not actually what was keeping the gow camera from working. I just created fresh .uc files and copied the provided code again, and had no problems... Sorry to not be of much help, I would post my code, but it is exactly the same as what was originally posted. The only bit I changed was in the Pawn.uc. Everything for the "MyLightClass" was being rejected when I compiled the code.
I've run through this to the letter again and i still cant get the GOW camera to work.
the only things different are my skeletal mesh, my animSet and my animTree which point to my own package file with my assets.
hey guys
please please please help with this - i've completely redone the scripts from scratch. When i recook and play my level i can see i'm spawning a default UDKgame robot pawn so i'm assuming i am also one of those. BUT that CAMERA simply WILL NOT switch to over the shoulder - pressing left shift key does nothing - even pressing TAB for command line entry and entering the words ShoulderCam and ThirdPerson do nothing. The strange thing is if i type those commands they should appear (auto-complete) but they dont?
Please please help I really am at my wits end now with this - i thought it might have been down to me using my own custom character, animset and animtree but those all seem to have worked fine clearly as this issue is still the same with the default UDK pawn robot.![]()
When working with third person cameras, there are different approaches to build them, depending on whether you inherit from UTPawn or UDKPawn. This is likely your problem.
I have this problem and not exactly sure what to do with the new scripts:
[0001.71] Init: Version: 9140
[0001.71] Init: Epic Internal: 0
[0001.71] Init: Compiled (64-bit): Nov 22 2011 17:03:01
[0001.71] Init: Command line:
[0001.71] Init: Base directory: C:\UDK\UDK-2011-11\Binaries\Win64\
[0001.71] Init: Character set: Unicode
[0001.71] Log: Executing Class UnrealEd.MakeCommandlet
[0001.85] --------------------Core - Release--------------------
[0001.89] --------------------Engine - Release--------------------
[0003.37] --------------------GFxUI - Release--------------------
[0003.44] --------------------GameFramework - Release--------------------
[0003.73] --------------------UnrealEd - Release--------------------
[0003.87] --------------------GFxUIEditor - Release--------------------
[0003.88] --------------------IpDrv - Release--------------------
[0004.06] --------------------OnlineSubsystemPC - Release--------------------
[0004.16] --------------------OnlineSubsystemSteamworks - Release--------------------
[0004.32] --------------------OnlineSubsystemGameCenter - Release--------------------
[0004.51] --------------------UDKBase - Release--------------------
[0004.86] --------------------UTEditor - Release--------------------
[0004.87] --------------------UTGame - Release--------------------
[0008.21] --------------------UTGameContent - Release--------------------
[0008.45] --------------------YourGame - Release--------------------
[0008.45] Warning, Can't find files matching C:\UDK\UDK-2011-11\Binaries\Win64\..\..\Development\Src\YourGame\C lasses\*.uc
[0008.52]
[0008.52] Warning/Error Summary
[0008.52] ---------------------
[0008.53] Warning, Can't find files matching C:\UDK\UDK-2011-11\Binaries\Win64\..\..\Development\Src\YourGame\C lasses\*.uc
[0008.53]
[0008.53] Success - 0 error(s), 1 warning(s)
[0008.53]
Execution of commandlet took: 6.82 seconds
mind givin a little more help? TY 4 posting this tutorial![]()
Where can find tutorial about create Lens Effects for blood (like GeOW), water or dirt?
• Darkness... ...You afraid? I'm not. The Dark is afraid of me.
• Our private millitary is renowned for its courage, not only to fight the good fight, but to win it.
• All those... moments will be lost in time, like tears... in rain.
• In the meantime... this is where I get off.
• I've come too far. Too far. I'm too close.
Where do I go to compile the script?
Hello. is there anyway to get the pawn to follow the camera vertically?
can you make an RPG (orbit camera) style tutorial?? please![]()
Youll need to add this to player controller
state PlayerWalking
{
ignores SeePlayer, HearNoise, Bump;
event NotifyPhysicsVolumeChange( PhysicsVolume NewVolume )
{
if ( NewVolume.bWaterVolume && Pawn.bCollideWorld )
{
GotoState(Pawn.WaterMovementState);
}
}
function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
{
if( Pawn == None )
{
return;
}
if (Role == ROLE_Authority)
{
// Update ViewPitch for remote clients
Pawn.SetRemoteViewPitch( Rotation.Pitch );
}
Pawn.Acceleration = NewAccel;
CheckJumpOrDuck();
}
function PlayerMove( float DeltaTime )
{
local vector X,Y,Z, NewAccel;
local eDoubleClickDir DoubleClickMove;
local bool bSaveJump;
local Rotator DeltaRot, ViewRotation, OldRot, NewRot;;
if( Pawn == None )
{
GotoState('Dead');
}
else
{
GetAxes(Rotation,X,Y,Z);
//update viewrotation
ViewRotation = Rotation;
// Calculate Delta to be applied on ViewRotation
DeltaRot.Yaw = PlayerInput.aTurn;
DeltaRot.Pitch = PlayerInput.aLookUp;
ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
SetRotation(ViewRotation);
// Update acceleration.
NewAccel = PlayerInput.aForward*X + PlayerInput.aStrafe*Y;
NewAccel.Z = 0;
// pawn face newaccel direction //
//===
OldRot = Pawn.Rotation;
if( Pawn != None )
{
if( NewAccel.X > 0.0 || NewAccel.X < 0.0 || NewAccel.Y > 0.0 || NewAccel.Y < 0.0 )
NewRot = Rotator(NewAccel);
else
NewRot = Pawn.Rotation;
}
Pawn.FaceRotation(RInterpTo(OldRot,NewRot,Deltatim e,90000,true),Deltatime);
//===
NewAccel = Pawn.AccelRate * Normal(NewAccel);
DoubleClickMove = PlayerInput.CheckForDoubleClickMove( DeltaTime/WorldInfo.TimeDilation );
bDoubleJump = false;
if( bPressedJump && Pawn.CannotJumpNow() )
{
bSaveJump = true;
bPressedJump = false;
}
else
{
bSaveJump = false;
}
ProcessMove(DeltaTime, NewAccel, DoubleClickMove,Rotation);
bPressedJump = bSaveJump;
}
}
event BeginState(Name PreviousStateName)
{
DoubleClickDir = DCLICK_None;
bPressedJump = false;
GroundPitch = 0;
if ( Pawn != None )
{
Pawn.ShouldCrouch(false);
if (Pawn.Physics != PHYS_Falling && Pawn.Physics != PHYS_RigidBody) // FIXME HACK!!!
Pawn.SetPhysics(PHYS_Walking);
}
}
event EndState(Name NextStateName)
{
GroundPitch = 0;
if ( Pawn != None )
{
Pawn.SetRemoteViewPitch( 0 );
if ( bDuck == 0 )
{
Pawn.ShouldCrouch(false);
}
}
}
Begin:
}
Thank's a lot ;D, and good tutorial it helped me to understand something!
i have another question, what is the difference between extend the camera, playercontroller camera function or Pawn calccamera??
i know that extending the camera function i can use more stuff, but in a lot of example i see the camera is calculated in all the three class at the same time. i can't really understand it!
Just came across this thread today and was very excited to see the results on my own machine. I was curious on something related to the Pawn's aiming: does anyone know how to take this tutorial and have the pawn aim towards the center of the camera? Or maybe just a nudge in the right direction on doing that? I actually have the "RPG orbit" style camera described above working fine and have the shoulder camera working as a regular shoulder camera should when LeftShift is held down (except having the pawn aim up or down depending on the angle of the camera).
Does anybody knows why this Scripts have NO sounds at all? all kind of sounds are disabled.
I followed this and it's working nicely, thanks!
One issue though is that I can't figure out how to get the player to hold a weapon? I have the sockets set up on my player mesh, but running over a weaponpickup factory does nothing at all (somewhat understandably, given the classes this derives from) but even manually giving the player inventory though kismet doesn't work. :S Any ideas?
excellent article!
I suggest beginner read this at least 3 times. what different between this article and others is that pawn extends from game pawn, not UTPawn.
thanks!It is working perfectly!Is it possible that when i am in Freecam i can rotate my aim?( i extend weapon from udkweapon)
so i'm trying to get a cam that does firstperson, thirdperson, and shouldercam. but i want the thirdperson camera to be freespining and the character to turn seperate based on direction input while the firstperson and shoulder cams or set to have the character turn with the camera
i have tried to combine the thirdperson/shouldercam from Psilocybe and the rfeespin cam from McTune and i got the thirdperson cam working right but the first and shoulder cams also freespin and i was hoping someone might tell me how i can add the command behindview into the scripts without breaking the thirdperson cam
i have tried to figure out how to add it into the camera.uc and the playercontroller.uc but idk how to tell the engine what it does
there is a line in my playercontroller.uc the allows me to tell the game to hide or unhide the player mesh when i press a button
function HideMesh(bool meshVisible)
{
Pawn.Mesh.SetOwnerNoSee(meshVisible);
}
and i thought maybe i could that for behindview as well, but like i said idk how to write the same thing for behindview to work
any help would be appreciated thanks
I have a question on using scripted camera ingame:
I want to change the camera from the ones i've used in a cinematic(to show different perpectives + effects and such) to the default one (which can only be found in the Pawn.uc script)
A snippet
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;
}
Thank you so much for this tutorial, after tons of googling I have found a 3rd person camera that does everything that I need.
I do have one problem though.
I have replaced the skeletal mesh with my own mesh and it appears to be floating several feet in the air.
I know that he has been zeroed out but floats, he is about half the size of the skeletalmesh default or the characters in udk as My game needs to be very very big so I am going to use small characters on a large map.
thnk you in advance for helping me.
the problem is the size of your collision cyllinder, you can reduce it's height or you can modify the location.z origin of the skeletal mesh in the skeletal mesh editor, in the properties windows.
http://vincenzoravo.vrs.com.ve http://www.slaughtermaze.com
please don't fill my inbox with questions, ask in the forum, the answers will help you and others !!!
I like the camera and thanks a lot. I wanted to know though how you can modify the pawn's rotation such that on ThirdPerson the pawn rotates based on the acceleration(e.g. pressing a makes the pawn rotate left) and on ShoulderCam it rotates with the camera. and also how are you supposed to assign a weapon as the class does not extend from UT
Last edited by blaklion; 11-24-2012 at 04:43 PM.
Hey there sorry to bother you. I just wanted to know, could this code be used for a four legged character (quadraped) or is it made such that it will only work on a two legged character.
Bookmarks