Announcement

Collapse
No announcement yet.

Help with kApplyForce.

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

    Help with kApplyForce.

    I'm a noobie trying to do stuff. Please help me out.

    Made my own class extending from ONSHoverBike. Yah, a Manta.

    It includes:


    exec function MegaDrop(out vector Force, out vector Torque)
    {
    super.KApplyForce( Force, Torque);
    Force += vect(0,0,-1) * MegaForceMag;
    }

    MegaForceMag is defined as 1000 in defaultproperties and up above as var() float MegaForceMag.

    However, this doesn't work. If I bind the command MegaDrop to a button it doesn't give me any error messages or do anything. If I manually type it in the console, it says "bad or missing Force value".

    Ok--- how can I make this work? The idea is it's gonna be like the Manta's right click just like, incredibly stronger.

    Also, that exec function deal IS bindable to a button? No reason you cant bind a console command to a button when it's made in this fashoin or something?

    Help appreciated. Thanks

    edit: I know someone is gonna look at this and laugh their *** off. But keep in mind, I'm a noob. Any explainations of the whole deal and what I did wrong is highly appreciated and will be rewarded with a bag of cyber chips, large size

    #2
    I'm not the best myself, but... KApplyForce has to be called within your own KApplyForce(out vector Force, out vector Torque) function I believe. So you could put your code in there and surround it with an if (bMegaDrop) so then when megadrop was set it would force the manta downwards. So when your key is pressed you set bMegaDrop to true and when it is released you set bMegaDrop to false.

    I can't help you with the rest as I only started doing unrealscript a day or two ago.

    Comment


      #3
      Now I tried this and it still dont work:

      exec function MegaDrop(out vector Force, out vector Torque)
      {
      Super.KApplyForce(Force, Torque);

      if (bDriving)
      Force += vect(0,0,-1) * 10000;
      }


      Anyone tell me what I'm doing wrong? Just want to make it so console command MegaDrop makes the Manta slam down super fast.

      I keep getting "bad or missing variable Force"

      Comment


        #4
        you don't CALL KApplyForce..


        function KApplyForce(out vector Force, out vector Torque) {
        Super.KApplyForce(Force, Torque);
        if (bMegaDrop) {
        Force += vect(0,0,-1) * 10000;
        }
        }


        the function is called automatically by the game.

        So while bMegaDrop is true the manta drops.

        Comment

        Working...
        X