View Full Version : Switching to Third person camera and gameplay
yahadi
11-06-2009, 12:54 AM
With this UDK, Is it possible to steer away from the first person camera and gameplay by adding:
1- Third Person Camera (Like the one in X-Men origins where the camera orbits around the player and player movement is screen relative)
2- Cover System (Gears of War)
3- Agility system (Ledge climbing and traversal like in X-Men origins)
ambershee
11-06-2009, 12:54 AM
It's all possible, you've just got to program it ;)
yahadi
11-06-2009, 12:57 AM
So even without source code access?
I mean with Gears of War on PC you already get a pre-made cover system where you just place the cover nodes. Will Unreal Script be enough to do all of the above?
ambershee
11-06-2009, 12:58 AM
Yes, you can do it with the UnrealScript - you can extend the player controller / camera to suit your needs, and create actors to define points of cover. It'll be an awful lot of work, but it's doable.
Lunazure
11-06-2009, 01:25 AM
You can easily implement it in Kismet as well, which is great if you're looking to have different camera perspectives in different situations. I'll post a tutorial on that if you want. :)
As I am a total newbie I would love to see the tutorial :)
majkel
11-06-2009, 06:20 AM
A tutorial how to setup 3rd person mode would be great!
Brexer
11-06-2009, 07:55 AM
A tutorial how to setup 3rd person mode would be great!
+1 on that, will save me some time too :)
Lunazure
11-06-2009, 06:17 PM
I'll be working on this tutorial tonight, so keep an eye out for it!
SublimeO12
11-06-2009, 11:47 PM
so far I've been able to get it to default to the third person camera by calling SetBehindView(true) inside the AcknowledgePossession function in a custom player controller. haven't quite figured out yet where to start messing with the camera properties though.
Angel_Mapper
11-06-2009, 11:54 PM
You'd use the GetPlayerViewPoint function in your PlayerController:
simulated event GetPlayerViewPoint(out vector POVLocation, out Rotator POVRotation)
{
super.GetPlayerViewPoint(POVLocation, POVRotation);
// Do stuff here with POVLocation and POVRotation
}
You'd use the GetPlayerViewPoint function in your PlayerController:
simulated event GetPlayerViewPoint(out vector POVLocation, out Rotator POVRotation)
{
super.GetPlayerViewPoint(POVLocation, POVRotation);
// Do stuff here with POVLocation and POVRotation
}
may a noob Qeustion but where can i find Playercontroller
A_Bloke_101
11-08-2009, 12:11 AM
Oh a 3rd person camera tutorial would be great, Im working on a platformer atm and would love something like that =D.
danimal'
11-08-2009, 02:15 AM
Here's a dirty tutorial:
Make your own player (in this example it would be YourPlayer.uc):
class YourPlayer extends UTPlayerController;
function SetBehindView( bool bBehindView )
{
YourPawn(ViewTarget).SetThirdPersonCamera(true);
}
defaultproperties
{
bBehindView=True
}
Then make a pawn (in this example it would be YourPawn.uc):
class YourPawn extends UTPawn;
simulated function SetThirdPersonCamera( bool bBehindView )
{
CameraZOffset = GetCollisionRadius() * 0.50;
}
defaultproperties
{
CameraScale=4.000000
}
Alter the CameraScale to set it farther back or closer. I excerpted this from what I'm doing, I haven't tested it but it's the barebones of what I use, it should work.
danimal
MadGrenadier
11-08-2009, 04:56 AM
is it possible to have the camerascale altered by user input in game? I know you could make mutator menu config to change these values before starting a map, but I'm curious if you could make say mousewheelup->lower scale and mousewheeldown->raise scale
NightRyder
11-08-2009, 05:23 AM
Sure you could. I just have no idea how. Probably would have to write some code since none of the Kismet stuff I have seen deals with user input directly.
danimal'
11-08-2009, 03:59 PM
Yes you can, super big hint: check UT3 mods that have third party cameras (go to UT3 forums, unrealscript, and search), several include their source. Look at what they did, but of course give them credit.
danimal
SpartanDonut
11-08-2009, 04:39 PM
Could you explain how to set my games PlayerController and Pawn to the custom ones created? This is the only part I don't understand.
Thanks!
Lunazure
11-08-2009, 07:14 PM
SpartanDonut: Put your custom script files in the MyMod folder, then open UTEngine.ini (located in UDK > UDK-2009-11 > UTGame > Config) and look for the line that reads "ModEditPackages=MyMod", remove the ';' in front of it if it's still there, then run Make to recompile your code. Hope I understood you right and this helps out! :)
SpartanDonut
11-08-2009, 07:18 PM
Definately have that part accomplished! Lol. It just seems nothing has changed and I would assume that this is because I have not specified the game to use the customer pawn and player controller classes. Where do I set this?
Another item of note, when I try to Make that code, I get the following error:
C:\UDK\UDK-Test01\Development\Src\MyMod\Classes\My_PlayerCont roller.uc(3) : Warning, Function parameter: 'bBehindView' conflicts with previously defined field in 'UTPlayerController'
Bifuu
11-08-2009, 09:23 PM
Yea i get the same issues as Donut, just cant figure it out lol
Edit: ok i got it,
you have to add a call to the new player controller in your defaultproperties in your game type class
If you are using the superfungame game type you would just add this at the bottom:
DefaultProperties
{
PlayerControllerClass=class'MyMod.PlayerController '
}
replacing PlayerController with what ever your class name it for it
Also in DefaultGame.ini replace the 3 lines of code with this
DefaultGame=MyMod.superfungame
DefaultServerGame=MyMod.superfungame
PlayerControllerClassName=MyMod.PlayerController
(note on the ini, its read only so change that before trying to save haha)
Now time for me to figure out how to move the camera and fix the aim ahead of the player =/ lol
danimal'
11-08-2009, 10:04 PM
Yea i get the same issues as Donut, just cant figure it out lol
Edit: ok i got it,
you have to add a call to the new player controller in your defaultproperties in your game type class
If you are using the superfungame game type you would just add this at the bottom:
DefaultProperties
{
PlayerControllerClass=class'MyMod.PlayerController '
}
replacing PlayerController with what ever your class name it for it
You guessed it, you need to have a gametype that defines that. When you don't know, go check the existing script files and see what they do. I'm not even very good with Unrealscript but I can do basic stuff simply by seeing how UT did it (gametypes, weapons, etc).
danimal
Bifuu
11-08-2009, 10:07 PM
Yeah, im still adjusting to working with an engine i didnt write so its all a bit confusing for me to look up code i didnt write and figure out where its all hidden
SpartanDonut
11-09-2009, 02:37 AM
Excellent work! But yeah, the camera definitley has to be adjusted a bit... I won't have much time over the next few days, but If I DO figure it out (fixing the aim and whatnot) I will be sure to post. Hopefully you shall do the same! =D
danimal'
11-09-2009, 03:09 AM
Checkout Fact3 (UT3 mod) and Action Cam for UT3. They both address the 3rd person camera "aim" issue pretty well. I've found though that it still fails for pulling off shock combos. For basic projectiles and instant hit weapons though, it works well. I'm not going to post their code even though they made it public out of respect for the authors, and its good training when you're getting into this. Learn to search for what others have done before and like I said, give 'em credit. I certainly didn't figure out 3rd person cameras myself, I just searched around and read through threads and public source released by mod authors.
danimal
revility
11-09-2009, 12:49 PM
With the thirdperson aim, would how its done for vehicles be of use?
Yngow
11-16-2009, 10:22 AM
Can't you just use the console comand "setbehindview"? There should be a way to just set it as default
Powered by vBulletin® Version 4.1.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.