|
|
|
#1 |
|
Member
Join Date: Nov 2009
Location: Rennes, France
Posts: 40
|
Hello,
Like many, I tried to create to create a Rpg Camera ! The problem ? I'm a noob, and I only partially succeeded with taking inspiration from different sources ... ![]() The only problem is shooting which continues to be in the direction of the camera (as you can see on the screen). Someone has an idea? ![]() Source : Code:
class RPGController extends UTPlayerController;
//Camera Calculations
var vector LastViewLoc;
var vector CameraOffset;
var vector CameraOffset2;
//Force third-person
function SetBehindView(bool bNewBehindView)
{
super.SetBehindView(true);
}
// RPG Camera (based on Third-Person Camera)
simulated event GetPlayerViewPoint(out vector POVLocation, out Rotator POVRotation)
{
if(ViewTarget != none)
{
LastViewLoc = ViewTarget.Location;
bCollideWorld = true;
}
POVLocation = LastViewLoc + CameraOffset2;
POVRotation = rotator(-CameraOffset);
StopViewShaking();
if(CameraEffect != none)
CameraEffect.UpdateLocation(POVLocation, POVRotation, GetFOVAngle());
}
defaultproperties
{
//Camera
bBehindView=true;
CameraOffset=(X=1,Y=1,Z=1)
CameraOffset2=(X=200,Y=200,Z=300)
}
(Sorry for my bad english ... u_u) |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Apr 2009
Posts: 102
|
You need to change the weapon and have it use the player rotation. I've posted about this in another thread.
|
|
|
|
|
|
#3 |
|
Senior Member
|
how u make it use player rotation? is it in the weapon code? O_O
__________________
My Website This is a revolution... ITE Trash Bot Game HyberiasFinal TheMovingFinal CTF-GRD-17Beta |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Apr 2009
Posts: 102
|
Yes, it is in the weapon code.
|
|
|
|
|
|
#5 |
|
Member
Join Date: Nov 2009
Location: Uk, south England
Posts: 75
|
Did you fix the problem? if not, try this in your PlayerController Class.
Code:
function rotator GetAdjustedAimFor(Weapon W, vector StartFireLoc)
{
return Pawn.Rotation;
}
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Nov 2009
Posts: 9
|
Is there an option to adjust the aim so that it follows rotation and vertical movement? as in up\down.
|
|
|
|
|
|
#7 |
|
Member
Join Date: Nov 2009
Location: Rennes, France
Posts: 40
|
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Nov 2009
Location: Wellington , New Zealand
Posts: 105
|
Hi S ha D
I want to do very similar to this too, and am also a noob. IVe done it for UNity3d but IM finding UDK a little tricky to work out how every thing connects. If you are able to provide steps on what youve done from UDK install to setting up a new player (camera view) that would be much appreciated and would help me get the first start point. I often find the first 2 weeks of an engine a mind melt...but once in with first thing its easy. Thanks muchly! -LW |
|
|
|
|
|
#9 | |
|
Junior Member
Join Date: Nov 2009
Posts: 7
|
Quote:
1. After installing the UDK, create a new folder in Developer\Src named RPGCam. Inside that folder make a folder named Classes. 2. Create a new file named RPGController.uc inside the newly created Classes folder containing the fallowing code: Code:
class RPGController extends UTPlayerController;
//Camera Calculations
var vector LastViewLoc;
var vector CameraOffset;
var vector CameraOffset2;
//Force third-person
function SetBehindView( bool bNewBehindView )
{
super.SetBehindView( true );
}
// RPG Camera (based on Third-Person Camera)
simulated event GetPlayerViewPoint( out vector POVLocation, out Rotator POVRotation )
{
if ( ViewTarget != none )
{
LastViewLoc = ViewTarget.Location;
bCollideWorld = true;
}
POVLocation = LastViewLoc + CameraOffset2;
POVRotation = rotator( -CameraOffset );
StopViewShaking();
if ( CameraEffect != none )
CameraEffect.UpdateLocation( POVLocation, POVRotation, GetFOVAngle( ) );
}
// Allows the mouse to still aim weapons
function rotator GetAdjustedAimFor(Weapon W, vector StartFireLoc)
{
return Pawn.Rotation;
}
defaultproperties
{
//Camera
bBehindView=true;
CameraOffset=(X=1,Y=1,Z=1)
CameraOffset2=(X=200,Y=200,Z=300)
}
Code:
class RPGCamInfo extends UTDeathmatch;
static event class<GameInfo> SetGameType(string MapName, string Options, string Portal)
{
return default.class;
}
defaultproperties
{
PlayerControllerClass=class'RPGController'
}
4. Make the file DefaultEngine.ini inside UTGame\Config not Read Only. 5. Inside UTGame\Config open up DefaultEngine.ini. In the section "[UnrealEd.EditorEngine]" add the fallowing line *after* "+EditPackages=UTGameContent": Code:
+EditPackages=RPGCam 7. Go to the Binaries folder and run UnrealFrontend.exe. 8. Click the arrow next to "Make" and hit Full Recompile. 9. Open up Command Prompt (go to Run... and type "cmd" and press Enter) and browse to the Binaries\Win32 folder (by typing something like "cd C:\UDK\UDK-2009-11\Binaries\Win32") and type the fallowing to test your new script: Code:
udk dm-deck?game=rpgcam.rpgcaminfo This is by no means how you would release your content to the public, but it's the easiest way I know to test Unrealscript in the UDK. Although I'm sure there are actually better ways to test script. |
|
|
|
|
|
|
#10 | ||
|
Junior Member
Join Date: Nov 2009
Posts: 28
|
did you get it to work?
Quote:
Idk if you realize it, but many people are attempting to get past the pain to change ut3 aiming system, I've spent the last 3 hours attempting to change it. I only use kismet and property edits though =p If you found a way to properly do it, please share. I'll give you a cherry pie? Edit: I just want to know how to do the fixed aiming thing, I already have kismet v.s. of the cameras, wich all have the aiming as the problem, so whats Quote:
pray tell?
__________________
Step by weary step... I trudge along a path I force out of the static-lifeless-emissent crowd of metaphorical npc's that dot the landscape. Last edited by Effregy; 11-16-2009 at 04:37 AM. |
||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
![]() |
All times are GMT -4. The time now is 10:18 PM.
|
![]() |