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.
Landing autopilot? trigger the AI's action, i have never tryied this before though so im not sure
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">plane1 action ["landing autopilot"][/QUOTE]
not sure if you would need to tell AI to put gear down or not?
also setvelocity goes by [x,y,z]
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'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.
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?
[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'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 ["landing autopilot off"][/QUOTE]
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'll keep ya informed
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".
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'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
try <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">plane1 setvelocity [x,y,z][/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.
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)
Hey I think I finally found out how that works...
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'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'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. ^_^
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 ["engine off"][/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.
I still got huge problems with that command. >_< My AI controlled plane will not decrease 20 if I write it the WP'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't touch ground so it doesn'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'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'll take a look there. Problem is I want that stupid plane to land and I'm frustrated that it can't! >_< 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?