Announcement

Collapse
No announcement yet.

Relative Physics Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    I suggest that you use the mouse for turning to free keys. The following code will ONLY work in single player.

    Code:
    // Roll
    PZ_ForceRotationVectX *= 800 * Rise; // PZ_NewRise is between -1 and 1
    
    // Pitch
    PZ_ForceRotationVectY *= 30 * -PlayerController(Controller).PlayerInput.aMouseY / 100;
    
    // Yaw
    PZ_ForceRotationVectZ *= 30 * PlayerController(Controller).PlayerInput.aMouseX / 100;
    
    // The magic happens here ---- Forward
    PZ_ForceApplication = PZ_ForwardsNormal * Throttle * 6000;
    This plane will turn with the mouse.
    You will have to keep W pressed to move forward.

    You might try instead:
    Code:
    PZ_ForceApplication = PZ_ForwardsNormal * (Throttle+1) * 6000;
    This should result in a default forward movement, W acts as an afterbruner, A as brakes. Similiar to Ubisoft's HAWX.

    Since Steering is unused now, you might want to add strafing.

    Leave a comment:


  • replied
    I won't to add a extra key.

    now I have Throttle(keys"W"-"S), Steering(left and right arrows) and Rise(space and Ctrl) ---- Default keys

    // Roll
    // No rolling for now, I will use q and e for the forward movement for the time being
    PZ_ForceRotationVectX *= 800 * Rise; // PZ_NewRise is between -1 and 1

    // Pitch
    PZ_ForceRotationVectY *= 30 * Throttle; // Throttle is between -1 and 1

    // Yaw
    PZ_ForceRotationVectZ *= 30 * -Steering; // Steering is between -1 and 1

    // The magic happens here ---- Forward
    PZ_ForceApplication = PZ_ForwardsNormal * 6000; I need a key here to control move forward and stop

    hope you can help me. I have tried many things to get it to work


    I have make me own spaceship In blender. 15 minutes of work. I will share the work, when it finished.
    If you have a cool concept or design of a spaceship, I can great it.
    some pictures


    Leave a comment:


  • replied
    @KongWeezY: Do you want to use existing controls for your vehicle, e.g. "Feign Death" should act as boost for your vehicle. Or do you want to define new key functions that don't have an effect outside of the vehicle?

    Leave a comment:


  • replied
    have you tried this?

    Pitch = PlayerController(Controller).PlayerInput.Jump;

    or
    PlayerController(Controller).PlayerInput.bXAxis
    PlayerController(Controller).PlayerInput.bYAxis

    or PlayerController(Controller).PlayerInput. any one of these
    aBaseX;
    aBaseY;
    aBaseZ;
    aMouseX;
    aMouseY;
    aForward;
    aTurn;
    aStrafe;
    bStrafe
    aUp;
    aLookUp;
    aRightAnalogTrigger;
    aLeftAnalogTrigger;

    Leave a comment:


  • replied
    I had my fun with adding additional controls for vehicles as well. Getting them to work in single player only is very simple, tegleg qutlined how to.
    If you want the controls in multiplayer, it is possible, but not easy. Or I missed something.^^

    [EDIT]:
    Pitch = InJump;
    That won't work, because there is no parameter named InJump. The input for jumping and crouching is already stored in InUp. There is no point in modifying SetInput.

    Leave a comment:


  • replied
    just been playing around with this, you can use these to get the player input.

    PlayerController(Controller).PlayerInput.RawJoyLoo kUp
    PlayerController(Controller).PlayerInput.RawJoyLoo kRight
    PlayerController(Controller).PlayerInput.RawJoyRig ht
    PlayerController(Controller).PlayerInput.RawJoyUp

    vehicle controlls have been spazzed in PlayerController - state PlayerDriving - ProcessDrive()

    Leave a comment:


  • replied
    PZ_ForceApplication = PZ_UpwardsNormal * 0 + 1500 * Throttle * PZ_ForwardsNormal;
    this is now controll by "W" and "S"


    Forward:
    Throttle by default settings is "W" and "S"

    Yaw:
    Steering by default settings is "right" and "left" I have change it to A and D

    Roll:
    Rise by default settings is "space" and "c" I have change it to Q and E

    Pitch, where is non. - how do I add it.


    I missed one controll... how do I add it.



    In UTVehicle
    simulated function SetInputs(float InForward, float InStrafe, float InUp)
    {
    local bool bReverseThrottle;
    local UTConsolePlayerController ConsolePC;
    local rotator SteerRot, VehicleRot;
    local vector SteerDir, VehicleDir, AngVel;
    local float VehicleHeading, SteerHeading, DeltaTargetHeading, Deflection;

    Throttle = InForward;
    Steering = InStrafe;
    Rise = InUp;
    Pitch = InJump;


    ConsolePC = UTConsolePlayerController(Controller);
    if (ConsolePC != None)
    ......

    I have tried to add it here, but it does not work....

    Leave a comment:


  • replied
    still trying to tame the controlls myself.

    it moves forward all the time because of the '50' in this line
    Code:
     // The magic happens here
    AR_ForceApplication = AR_UpwardsNormal * 0 + 50 * AR_ForwardsNormal;
    you would have to change this value by pressing a buton.

    PlayerInput and its various extensions along with the PlayerController is where controlls are handled.
    DefaulInput.ini has the key bindings.

    Leave a comment:


  • replied
    Hallo

    I've used your code and I got this out of it. I have tried for months on/off to get it to work, but finally I got it working. thanks.

    Some questions:
    controls Steering, Throttle and Rise are set by the controller - but Where. I missing a Pitch and boost. ?
    Throttle, I can not control it is on all the time - how do I control it. ?
    Gravity is very poor - how can I change it. ?

    A little movie I made of my process:
    UDK spaceship test controlls

    Leave a comment:


  • replied
    ah yes delete that bit about jetcontrol and it should be good to go.

    Leave a comment:


  • replied
    Originally posted by tegleg View Post
    yes just in default gravity.
    it would take quite a bit of work to get it flying like an aeroplane but its fun to fly as it is. some kind of anti-gravity vehicle

    @GentlemenGraphics
    you need to start reading what people say and not just blindly copy/paste
    again, change this line to make it move forwards. '50' is the speed it will go
    Code:
    // The magic happens here
    AR_ForceApplication = AR_UpwardsNormal * 0 + 50 * AR_ForwardsNormal;
    all i did was copy cicada_content and made it extend AR_Aircraft so theres no point in posting my code, you already have it.
    When I copied and pasted the Cicada_Content.uc code and after extending it to AR_Aircraft I tried to compile it but it gave me errors such as "jetcontrol" unrecognizable or something similar. So I removed alot of the Cidcada_Content.uc code which leads me to think it is that which is at fault.

    What do you think could it be the content code?

    Leave a comment:


  • replied
    ive got no plans to make a plane with this, i just stumbled upon the thread and tried it out, and its good. ill probably mess around with it and make a few aircraft with it though.
    ive got another plane that has a very arcade feel but it wont loop so maybe ill merge the 2 somehow. no i wont give you it GentlemenGraphics as its a wip and would take too much explaining, sorry.

    Leave a comment:


  • replied
    @GentlemenGraphics:

    The things I could thing of appear to be not be source of your problem. As tegleg and myself got it working right away, there must a problem on your end. Since the code is fine, there are only two options left.
    1. Debuging with logging. It will be take a lot of time and I can't promise you it will work in the end, but it has alwayas helped me.
    2. Backup your work, reinstall UDK and add the code again. If it doesn't work after a clean install with no other changes, I have absolutly no idea what's going on on your end. This measure is extreme, but if you have changed litte until now, it might be worth a try.

    I recommend option 1, but it is up to you.

    @tegleg: Do you intend to make a plane? As far as I see it, a plane in an arcade game should be very simple, just like hawx. You must NOT think the way physics work in reality, but how you need to apply forces to get what you want. Basicly fake and cheat all the way.^^
    If you want to realize a simple plane, I will tell you my ideas on the physics concept I have in mind. I am just not into realizing it myself right now.

    Leave a comment:


  • replied
    yes just in default gravity.
    it would take quite a bit of work to get it flying like an aeroplane but its fun to fly as it is. some kind of anti-gravity vehicle

    @GentlemenGraphics
    you need to start reading what people say and not just blindly copy/paste
    again, change this line to make it move forwards. '50' is the speed it will go
    Code:
    // The magic happens here
    AR_ForceApplication = AR_UpwardsNormal * 0 + 50 * AR_ForwardsNormal;
    all i did was copy cicada_content and made it extend AR_Aircraft so theres no point in posting my code, you already have it.

    Leave a comment:


  • replied
    Originally posted by Hiredicespecter View Post
    @GentlemenGraphics: You seem to misunderstand the function of the content class. Its sole purpose is to customise the appereance of the vehicle, nothing else.
    The problem appears to be related to your level or your global settings. So what gravity is set in your level?

    @tegleg: Thanks, glad to know that it works for others as well. Did you fly the vehicle in UDK's default gravity?
    I have gravity set to default in my level and I have used a gravity volume set to 0 but still no luck.

    More help needed.

    Leave a comment:

Working...
X