Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Mouse Controlled Vehicles

  1. #1
    legacy-tGazza
    Guest

    Mouse Controlled Vehicles

    Is there any way to control a vehicle by using the mouse
    eg: push the mouse forward the vehicle goes down, like a plane?

  2. #2
    legacy-Chunky
    Guest
    You mean like the redeemer...

  3. #3
    legacy-tGazza
    Guest
    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:



    its the dropship from unreal II

  4. #4
    legacy-tGazza
    Guest

    Talking

    no luck yet,
    can any one show me an example on how to control the pitch and yaw by moving the mouse?

  5. #5
    Shambler
    Guest
    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:

    Code:
    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!

  6. #6
    legacy-tGazza
    Guest
    Thanks [6pk]Shambler but i found a better way

    Code:
    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?

  7. #7
    legacy-Chunky
    Guest
    You mean like the bulldog... :P

  8. #8
    legacy-tGazza
    Guest
    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

  9. #9
    legacy-wahid
    Guest

    Key binding to loop move objects

    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

  10. #10
    legacy-Chunky
    Guest
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •