Home   Help Search Login Register  

Author Topic: Helicopter flying without AI  (Read 1130 times)

0 Members and 1 Guest are viewing this topic.

Homefry31464

  • Guest
Helicopter flying without AI
« 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?? ???  
« Last Edit: 14 Feb 2004, 04:33:21 by Homefry »

OrangeLeader

  • Guest
Re:Helicopter fly without AI
« Reply #1 on: 14 Feb 2004, 04:33:09 »
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.

Homefry31464

  • Guest
Re:Helicopter flying without AI
« Reply #2 on: 14 Feb 2004, 04:41:09 »
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.

Fishion

  • Guest
Re:Helicopter flying without AI
« Reply #3 on: 14 Feb 2004, 20:11:49 »
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)
Quote
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
« Last Edit: 14 Feb 2004, 20:13:52 by Fishion »

Homefry31464

  • Guest
Re:Helicopter flying without AI
« Reply #4 on: 14 Feb 2004, 23:24:59 »
Fishion, long time no see!  Yeah, I figured that was the biggest problem, Maybe there is some way to?

Dubieman

  • Guest
Re:Helicopter flying without AI
« Reply #5 on: 15 Feb 2004, 04:15:33 »
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:


Fishion

  • Guest
Re:Helicopter flying without AI
« Reply #6 on: 15 Feb 2004, 11:02:40 »
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

vektorboson

  • Guest
Re:Helicopter flying without AI
« Reply #7 on: 15 Feb 2004, 19:53:49 »
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!

DBR_ONIX

  • Guest
Re:Helicopter flying without AI
« Reply #8 on: 15 Feb 2004, 20:28:07 »
Why not just shove an AI in the helo, make him put the helo engine on, and make him take of(?)
Maybe
- Ben

Homefry31464

  • Guest
Re:Helicopter flying without AI
« Reply #9 on: 16 Feb 2004, 02:12:29 »
vektorboson:

Would that work for this proposed script, so the mission maker could actually do this?

vektorboson

  • Guest
Re:Helicopter flying without AI
« Reply #10 on: 16 Feb 2004, 13:48:11 »
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.
« Last Edit: 16 Feb 2004, 15:04:08 by vektorboson »

Fishion

  • Guest
Re:Helicopter flying without AI
« Reply #11 on: 19 Feb 2004, 22:13:57 »
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

Homefry31464

  • Guest
Re:Helicopter flying without AI
« Reply #12 on: 19 Feb 2004, 22:24:30 »
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??

Fishion

  • Guest
Re:Helicopter flying without AI
« Reply #13 on: 21 Feb 2004, 19:00:39 »
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

-Fishion