View Full Version : Mouse Controlled Vehicles
legacy-tGazza
11-08-2003, 09:58 PM
Is there any way to control a vehicle by using the mouse
eg: push the mouse forward the vehicle goes down, like a plane?
legacy-Chunky
11-09-2003, 11:50 AM
You mean like the redeemer...
legacy-tGazza
11-09-2003, 12:33 PM
oh yea i fogot about that ,
ill have a look at the way epic does the guided shell. :)
heres some pics of what im working on:
http://homepage.ntlworld.com/tgazza/Other/Image5.jpg
its the dropship from unreal II ;)
legacy-tGazza
11-10-2003, 12:06 AM
no luck yet,
can any one show me an example on how to control the pitch and yaw by moving the mouse?
Shambler
11-10-2003, 02:47 PM
Originally posted by tGazza
no luck yet,
can any one show me an example on how to control the pitch and yaw by moving the mouse?
In PlayerController.uc a few lines down:
var input float
aBaseX, aBaseY, aBaseZ, >>> aMouseX, aMouseY, <<<
aForward, aTurn, aStrafe, aUp, aLookUp;
In User.ini:
MouseX=Count bXAxis | Axis aMouseX Speed=2.0
MouseY=Count bYAxis | Axis aMouseY Speed=2.0
So, aMouseX and aMouseY control the mouse-movement for the player :) and the PlayerInput variable of PlayerController.uc handles and processes all the input, look in PlayerInput.uc....and the PlayerInput function does most of the work :) I'm not so sure about replication tho but that should get you started!
legacy-tGazza
11-11-2003, 01:25 AM
Thanks [6pk]Shambler but i found a better way :)
simulated function ClientKDriverEnter(PlayerController pc)
{
local vector X,Y,Z;
local Rotator ViewRotation;
//log("Enter: "$pc.Pawn);
pc.myHUD.bCrosshairShow = false;
pc.myHUD.bShowWeaponInfo = false;
//pc.myHUD.bShowPersonalInfo = false;
pc.myHUD.bShowPoints = false;
pc.bBehindView = true;
>> pc.bFixedCamera = true; <<here
pc.bFreeCamera = False;
GetAxes(Rotation,X,Y,Z);
ViewRotation = Rotation;
SetRotation(ViewRotation);
}
i have another Question:
how can i make a KeyBind class talk to my vehicle eg:
player presses a key the vehicle moves forward?
legacy-Chunky
11-11-2003, 03:00 AM
You mean like the bulldog... :P
legacy-tGazza
11-11-2003, 05:12 PM
I've got my craft to yaw and pitch only by changing the values in the script and i want a way to control them without deleting my class then changing the values then recomplying the whole script again, some sort of key control, i don't know how to do that can anyone help?
sorry about my bad english :)
legacy-wahid
11-18-2003, 01:19 PM
Hi,
I like to bind keys to an object that moves in a loop in the map. I like to control its speed through up and down arrow keys. What would be the best way to make it?
Thanks
legacy-Chunky
11-18-2003, 09:40 PM
If you're making a karma based vehicle, look at the bulldog code, if you're not, well there's not much difference between your vehicle and a normal player pawn, so look at the player movement code. The code is spread across both the pawn and controller classes in either case.
legacy-wahid
11-19-2003, 06:18 PM
Hi,
I am kind of novish game programmer!
Is there any tutorial for making controller and pawn?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.