Home   Help Search Login Register  

Author Topic: Chopper hover  (Read 1331 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Chopper hover
« on: 01 Apr 2005, 17:01:33 »
Hi all,

What i'm trying to do is have a chopper start off hovering at 200m over a city, and to stay there. Not even move at all. So in my choppers init box I have this:
Code: [Select]
this flyinheight 200; this setpos [(GetPos this select 0), (GetPos this select 1), 200]; this disableAI "MOVE";
The chopper starts off where its ment to, but then nose dives down to about 50m and slowly moves falward at 20kmph until I get pi**ed off and click abort.

I'm doing so the player starts the mission standing in the back of the chopper. It should work, if I position the man right. But I have to get the chopper to hover first.

Any ideas  :-\
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Pilot

  • Contributing Member
  • **
Re:Chopper hover
« Reply #1 on: 01 Apr 2005, 17:18:03 »
Also put this in the unit's init field:
Quote
this action ["HOVER", this]

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Chopper hover
« Reply #2 on: 01 Apr 2005, 18:42:36 »
Thanks, i'll try that now  ;D
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Chopper hover
« Reply #3 on: 01 Apr 2005, 19:19:24 »
There is a problem with the flyInHeight command. It takes a few seconds before it is executed. The time it takes seems to be different to different planes/vehicles. My intuition (but absolutely no scientific testing whatsoever) tells me that the faster the plane/choper the longer it takes for it to change altitude.

The choppers default flyInHeight is somewhere around 50-75 meters.

When you setPos your chopper to 200m above ground with a flyInHeight at it's current altitude, it will start to seek out it's default flyInHeight (i.e 50 meters). I think that's why it points it nose to the ground and moves forward. When it starts to react to the flyInHeight 200 meters it has already started moving.

Another idea is to setPos an empty chopper in midair with a setPos loop and add the rotor/engine sound with a sound file. The player is mostly going to see the inside of the chopper anyway, so the rotor movement shouldnt be too much of a problem (unless it's possible to see the outside of the chopper using 3rd person view when you are standing inside it's cargo hold).

Second alternative is to setPos the chopper at it's default flyInHeight, but then it will be much closer to the ground. And since I suspect you want to do a parajump from the chopper this isn't really an option, right?
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Chopper hover
« Reply #4 on: 01 Apr 2005, 19:35:25 »
Aha, that makes sense.  ;)

The player probably will be able to see the outside of the chopper, as he has to jump out after a while.

What i'm trying to do is have the player start in the chopper, which is hovering level with a room at the top of a skyscraper. His objective is to snipe a person in the room from the chopper. Then other stuff happens  ;)

Oh, and StudentPilot, your method didn't work for me. It had the same effect as before, except the chopper hovered after the nosedive to about 50m  :-[
« Last Edit: 01 Apr 2005, 19:36:58 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Pilot

  • Contributing Member
  • **
Re:Chopper hover
« Reply #5 on: 01 Apr 2005, 19:42:52 »
Yeah, I just found that out after I did some testing.  Do you have waypoints given to the chopper?

Also, try putting the chopper in careless mode, maybe the pilot is seeing a bag guy and responding:
Code: [Select]
this setcombatmode "CARELESS"

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Chopper hover
« Reply #6 on: 01 Apr 2005, 21:12:51 »
The chopper has no waypoints, and there are no enemies on the map yet.  :-[

I think mostly its to do with the height of the chopper  :P
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Chopper hover
« Reply #7 on: 01 Apr 2005, 21:20:28 »
Well, if your really annoyed at this and ready to try anything do this:

Code: [Select]
_x = getpos chopper select 0
_y = getpos chopper select 1
_z = 200

#loop
Chopper setpos [_x,_y,_z]
~0.1
goto"loop"
Its important to make sure you dont put the definition of _x and _y in the loop or they will change, making it move.
Also if it still jerks make the time less.
« Last Edit: 01 Apr 2005, 21:20:40 by RujiK »
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Chopper hover
« Reply #8 on: 01 Apr 2005, 21:29:06 »
Thanks.  :thumbsup:

So I just put that into a script and activate it?
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Chopper hover
« Reply #9 on: 01 Apr 2005, 21:49:51 »
OK, it works. The chopper hovers fine.  ;D

Well, almost. Its very jumpy. Is there a way to avoid this?  :-[
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Chopper hover
« Reply #10 on: 01 Apr 2005, 22:56:24 »
change the dalay "~0.1" to something like "~.01" and that will reduce the jumpiness

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Chopper hover
« Reply #11 on: 01 Apr 2005, 23:09:59 »
hell!! that is a very nasti way to solve it!!! sorry about the worrd... :P
U tried to put a "move" waypoint over the same chopper, and set it to careless\flyinheight 200?? or maybe change the copper setpos whit chopper setvelocity [0,0,0] on the script... I think setpossing is a bad idea... however maye it is your only choise...

or at lest try these:
Code: [Select]
;chopper standyng by "stand.sqs"
;execs like these: [choppername,height] exec "stand.sqs"
_chop = _this select 0
_x = getpos _chop select 0
_y = getpos _chop select 1
_z = _this select 1

#loop
;delete the chop setpos if U want to try only whit setvelocity

_Chop setpos [_x,_y,_z]

? ! alvie _chop : exit
? ! alive (driver _chop) : exit

_chop setvelocity [0,0,0]

~0.01
goto"loop"

based on RujikÂ's Script...

cheers

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Chopper hover
« Reply #12 on: 08 Apr 2005, 23:34:42 »
so...?

StonedSoldier

  • Guest
Re:Chopper hover
« Reply #13 on: 09 Apr 2005, 00:17:40 »
hows about giving heli action ["Auto hover",this] a whirl

lol, would help if i spelt it correctly
« Last Edit: 09 Apr 2005, 11:23:05 by StonedSoldier »

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Chopper hover
« Reply #14 on: 09 Apr 2005, 08:22:39 »
Right OK, I'll try some of the ideas on it now.  ;)

Sorry I didn't post here before, I was really annoyed with it at the time   ::)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB