OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Homefry31464 on 13 Feb 2004, 23:01:40
-
Alright, heres the problem, the AI stinks at flying helicopters. So, I came up with an idea, one which I have no idea if its even feasible.
Script One: The player flies a helicopter, and the script records all the turns, speed changes he makes, and altitude. It saves this to a file that another script can read.
Script Two: An AI helo flies the path you designated, using setvelocity.
The only problems I see are moving rotor and the saving and reading velocity values.
So, I have to ask, is this possible?? ???
-
There is another problem: What if the Helo is fired at and is bumped of course. It would probably just hover. Plus it would keep landing at the set point. Even if it is right ontop of a tank. I know this is negative but I think you need to consider if this is really good for a dynamic system like OFP.
-
Of course it has it's limitations, but used correctly it would work... The mission designer would have to make sure the helo lands in the correct spot, in a tank free enviroment. If its fired at, it would incur damage. As if it were piloted, but thats why the mission designer has to make sure the helo doesn't get struck by a RPG, as machine gun fire wouldn't change direction.
-
I would say reading the velocity and setting the velocity shouldn't be hard
to do, and making it look like the chopper is flying should also work.
Okay the rotor is a problem.
Maybe you should setpos too...
However I would say there are 2 Problems, both quite big.
1)
You will also need to set attitude of the Chopper and direction.
Direction isn't a problem, but the attitude is. So far I don't know no
command which can do it. However I'm a bit out of date, so it might
be possible...
2)
It saves this to a file that another script can read.
As far as I know it is not possible to save anything to a file.
Reading might be possible (or you could edit it right, and use it directly as
a script). But for the saving there you will need some trick that I don't know
of since the write to Debug.log doesn't work...
-Fishion
-
Fishion, long time no see! Yeah, I figured that was the biggest problem, Maybe there is some way to?
-
One problem is if someone was watching it, the helicopter would fly to one spot like a rocket and not tilted forward and make turns look weird. Be cool if you could make it bank and swoop, but that's a lot of setvelocity commands.
Make it look like it was moving through space... :P
I think you need some invisible pilots. :toocool:
-
Unfortunatly we cannot pipe anything to a file.
What you can do however is record that stuff in a large
array an use it later in the mission.
If anybody has ever found out how to hack savegames that would
probably be a way to get to the data in an automated way.
The other way would be to display each value and write it down and hack it
into a txt file. However this is clearly no workable solution.
And as long as you cannot set Bank and Pitch, it would as Roach pointed
out look somehow quite strange.
But this seems to be a nice method to get a Helo to land.
Then you probably only need a function that is interpolated through a few
points, better than a whole lot of points each second... no?
So the idea is usefull just not in the proposed way 8)
-Fishion
-
The other way would be to display each value and write it down and hack it
into a txt file. However this is clearly no workable solution.
Hi Fishion,
there is a very simple way: Put everything out to a RscText, then mark it, then you can Copy&Paste it (within Windows). :D
Though, an automated way would be nice!
-
Why not just shove an AI in the helo, make him put the helo engine on, and make him take of(?)
Maybe
- Ben
-
vektorboson:
Would that work for this proposed script, so the mission maker could actually do this?
-
vektorboson:
Would that work for this proposed script, so the mission maker could actually do this?
Well, you can save your flight-data into an array and this array can be put out to a text-control. I hope I wrote it in my Dialog-Tutorial, it was a CT_EDIT. You just have to do
ctrlSetText [ IDC_OF_YOUR_EDIT, format["%1", YOUR_ARRAY] ]
Then you can mark the output with either the Mouse or Shift+Arrow Keys; then CTRL+C and you can Paste it wherever you want
EDIT:
You can use for this my console which you may find either in Editors Depot or in ECP. Just make your array a global Variable and then you get it with Show Var.
-
Hiho VB
wie gehts an der Uni voran?
This idea is actually workable.
However we still cannot tilt and bank and pitch the Airframe, so this
is probably only usable as a way to get a decent (controlled) landing
-Fishion
-
Right, maybe I didn't clarify what it was really for. It was intended to allow Littlebird helo's to insert people into a city, or even on a roof, without the AI messing up. I suppose longer flights would be possible, but not entirely. As for I suppose that is a problem, but having that problem is better than having a pilot crash repeatedly into a building.
I'm no good, whatsoever, at scripting, although I am trying to learn, can anyone try it??
-
Hiho tous le monde,
take a look at the Script Beta Forum
I've coded an little script though it has lot (and lots) of problems
http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=16004 (http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=16004)
-Fishion