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

Thread: Landing a plane

  1. #1

    Unhappy

    I've tried searching for answers already but none of the few I found was satisfactory. I actually succeeded in ladning a plane with AI flying it with that "get out" WP, but only after the plane circled around once. Now I don't want that, I need he plane to go straight from the point that I created it (in the air flying) and then it should land directly straight ahead. The runway is the west one in the desert on Nogova, bot the island one cause I saw that it was a huge problem doing landing/taking off's from there. But anyway, if there is no way of using "get out" WP I got the idea when reading another post to "setvelocity" but I have no idea how to do it cause I have only been scripting for 3 days so... :P Could anyone help me with this?
    The command I have in the WP just before the runway for the plane (named plane1) is:

    plane1 flyinheight 15
    If I want a setvelocity there how do I add it and what should I add, before or after that command to make it work?
    I tried writing ; setvelocity [number] but then I get error messages. If anyone could please help, I'd be really grateful.

  2. #2
    Landing autopilot? trigger the AI's action, i have never tryied this before though so im not sure

    im guessing

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">plane1 action &#91;&#34;landing autopilot&#34;&#93;[/QUOTE]

    not sure if you would need to tell AI to put gear down or not?

    also setvelocity goes by [x,y,z]




  3. #3

    Unhappy

    Ok, first, where do I put this code

    unit action ["landing auto-pilot"] ?
    Should it be in the planes init or in on activation at a WP. I don&#39;t know where to pt specific codes so it would be a big plus to mention that to me. ^^ For the moment of course, trying to learn all I can.

    Two:
    setvelocity goes by x,y,z... And those are...? Is x,y,z cordinates or is it three steps of decreasing speed or something? If it is cordinates, then a follow-up question: How can I find out the cordinates?

  4. #4
    [x,y,z] X & Y are the side controls and Z is up and down

    The way i learned to get used to the xyz is to play around with it for ages untill you know which ways which (well the X & Y bit)

    The code can go anywhere, in script or trigger, waypoint, init line ect

    If in init line or an init.sqs then it will start when mission start

    The code could be activated by waypoint, but i think you will need to activate quite a distance in front of airport so there&#39;s enough room for it all to happen in, and im not sure but i dont think the AI can land on the airport in the island north of nogova

    Also to put the autopilot off i think the code would look like

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">plane1 action &#91;&#34;landing autopilot off&#34;&#93;[/QUOTE]




  5. #5
    Hmm i tried landing auto pilot in a radio trigger but i couldent get the plane to do it but if your the commander you can activate it by selecting the plane, pressing 6 (action) and then autopilot?

    If i come up with a result i&#39;ll keep ya informed




  6. #6

    Unhappy

    I get problems with this setvelocity. And I also have another question.

    First, when I type

    setvelocity [0,0,0] in the on activation in a WP for the plane I get an error saying "unknown operator".

    Second:
    What do you mean by side controls and up/down? Is the Z, up/down the one controling speed? But what about those sides. What should I write in those?

    ... hmm, I alt-tabbed while writing this message into ofp.
    I figured out how to write the command without getting error. I added before setvelocity "plane1" and named the plane plane1. Now it worked. But I&#39;m beginning to have my doubts about this command. Should it really set the speed of the aircraft? Or have I misunderstood quite a lot here? :P

  7. #7
    try <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">plane1 setvelocity &#91;x,y,z&#93;[/QUOTE]

    Looking at the editor map
    ------------------------------

    X - This will send the plane left (if "-" used) or right on editor view

    Y - From editor screen view this is up or down (down if "-" used)

    Z - (vertical) This is up and down in 3D view (3D view i mean when testing mission)

    you can use the "-" symbol to send the numeric value the***opposite way.


    e.g.

    plane1 setvelocity [-50,0,50]


    This will send the plane upward at 50 KPH and make it fly left at 50 kph

    (i think OFP is all metric so Kilometers Per Hour will probibly be the speed messurement)




  8. #8

    Unhappy

    Hey I think I finally found out how that works...

    [x,y,z] right?

    Then x is left/right wether you put - or not in front.
    y is up/down if you got - or not
    and z is the speed in kmph that this is executed in, right?

    Then I have found out that this surely wasn&#39;t the command for me. I tried to put in [0,20,200] in a waypoint thinking that the plane would rise 20 whatever, meters perhaps, and maintain the speed 200 while doing this. Instead, when reading the WP the plane sets off vertical in 200 kmph upwards and then crashes into the sea. >_< Great enjoyment until you realize that the command didn&#39;t work.

    So now I must ask if there is a command that makes the plane smoothly decrease in speed between two WP instead of at a specific point. WP1 and WP2 lies 200 m from each other and while flying that distance, the plane goes from 50 to 30 in level above the sea (I know this command luckily) and then decreases speed from 200 kmph to 150.

    How do I do that? Grateful for answers. ^_^

  9. #9
    if z = 200 it will fly upwarad at 200 KPH

    Try something along the lines of -20
    (this will force it fly downward at 20 KPS and AI should stabilies it)

    Also when landing it i suggest putting the engine off

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">plane1 action &#91;&#34;engine off&#34;&#93;[/QUOTE]

    If your going to control the velocity of the plane to land it it would be easier to do in an external script i reckon.




  10. #10
    I still got huge problems with that command. >_< My AI controlled plane will not decrease 20 if I write it the WP&#39;s on activation field: plane1 setvelocity [0,0,-20]

    My plane crashed into an invisible wall turning downwards and goes down into the sea, and the same thing happens if I got [0,0,20]. It does not level out in a smooth motion, it goes straight, and then turns 90 degrees and straight down into the sea. :P
    That other command:
    plane1 flyinheight xx worked much better but it won&#39;t touch ground so it doesn&#39;t work either as I want it to.
    I checked that Unofficial Operation Flashpoint Reference Manual on the net and thought I had found a good command called SetSpeedMode but that command does not exist in my ofp game. Same thing with the two commands Speed and SpeedMode.

    I&#39;m goign crazy. Btw, I have one other question. Is it difficult to script in those external scripts you mentioned? Or what those were called. Is it the .sqs files? Oh well, I have a scripting guide for ewbies so I&#39;ll take a look there. Problem is I want that stupid plane to land and I&#39;m frustrated that it can&#39;t&#33; >_< Those tips you give to me, are they working for your AI controlled plane? I mean do they level out on those speeds you give them, or do they also crash into an invisible wall?

Page 1 of 2 12 LastLast

Posting Permissions

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