Home   Help Search Login Register  

Author Topic: Vietnam Style Chopper Landings  (Read 1766 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Vietnam Style Chopper Landings
« on: 10 Dec 2002, 01:25:59 »
ive got a chopper mission and i have choppers landing in a Hot LZ

what they do currently is come in, flare out to slow down and then land backwards - really annoying...

what i want is for them to come in hard and fast, stay facing the direction of travel and hit the ground as hard/fast as is possible without the chopper crashing.... then for them to remain on the ground without the chopper moving at all untill the squad gets out, and then they can bugger off...

im trying to make this for 4 choppers at a time - and i only want them on the ground for a few seconds...

any help?
Proud Member of the Volunteer Commando Battalion

d2pvoodoo

  • Guest
Re:Vietnam Style Chopper Landings
« Reply #1 on: 10 Dec 2002, 02:14:57 »
what speed do you have them set at?  id use full and  combat behavior. if you havent already

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re:Vietnam Style Chopper Landings
« Reply #2 on: 10 Dec 2002, 02:44:37 »
You need to make the pilot careless in order to have him land at will.

in the init field of the pilot
this setBehaviour "careless"

and yes speed can play a factor lots of times if the chopper is coming in fast it will over shoot the landing pad and have to manuver over it.

Hoz


« Last Edit: 10 Dec 2002, 02:45:07 by hoz »
Xbox Rocks

vectordude

  • Guest
Re:Vietnam Style Chopper Landings
« Reply #3 on: 10 Dec 2002, 08:16:54 »
gonna need a script for this.....im pretty doubtful that its possible without one...

i already tried landing normally.....ur helicopter is jus gonna get gunned down while its taking its time slowing down...i used a script someone here made for me that quickly drops the guys off.....but its still kinda screwy, helicopters act all funny especially when they're coming in (i got like 6 of them and they keep crashing...move the waypoints a lil and they swerve around each other likes nuts). landing zones are pretty darned small too so that doesnt help muchl ol

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Vietnam Style Chopper Landings
« Reply #4 on: 10 Dec 2002, 20:25:07 »
deff needs a script - ive tried all possible combinations of waypoints, and none of them work, they just end up crashing or flying backwards etc...

im guessin it must be able to be done with setvelocity and setdir etc.
Proud Member of the Volunteer Commando Battalion

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Vietnam Style Chopper Landings
« Reply #5 on: 10 Dec 2002, 22:52:13 »
On my list of thiungs to do is a general template for these landings.
In the meantime, I've got it working in a mission I'm betatesting (2 waves of 4 helos come in and dump a platoon in 30 seconds on Xray), and I'd be happy to send you a copy of the source (it's 52.1 kb, so I can't post it here).

The keys:

1. Behaviour Careless and CombatMode Blue
2. Altitude separation.  Helos turn to slow down. I know it looks stupid. Keep the helos on different altitude bands, and they won't collide when they slow down.  Even if they don't collide, they go into evasive maneuvers, which puts them off line for the final.
3. Limited speed on approach.  I know, you want it to be hot.  Limited looks pretty good though.
4. Use SetFlyInHeight 2 to "land" the helos.
5. Clear any obstructions (trees, etc) from the LZ.  My favorite is a gamelogic with "bomb = "LaserGuidedBomb" camcreate getpos this"  in the init field.
 
6. test, test, test.

This uses gamelogics: "OuterMarker" (1-8), "LZ" (1-4), and "Depart" (1-8)
slicks are 1-8. Odd slicks are in first wave, and even ar ein second.

_counter = _this select 0
_slick= call format ["slick_%1", _Counter]
_slick setbehaviour "CARELESS"
_slick setcombatmode "BLUE"
_origPos = getpos _slick
_outermarker = call format ["outermarker_%1", _Counter]
_mypax = crew _slick - (units group driver _slick)
_depart = call format ["depart_%1", _Counter]

_Zoffset = [0, 1, 3, 0, 2] select (((_counter+1)/2)-(((_counter+1)/2) mod 1))
_LZ = call format ["LZ_%1", (((_counter+1)/2)-(((_counter+1)/2) mod 1)) mod 4]
_slick flyinheight 25 + (10 * _Zoffset)
_landslot = call format ["Landslot_%1", _counter]
~22
?_counter mod 2 == 0: goto "WaitAwhile"
#back
_slick domove [getpos _outermarker select 0, getpos _outermarker select 1]
@!unitready _slick
@_Slick distance _outermarker < 100
_slick setspeedmode "limited"
@unitready _slick
_slick flyinheight 15 + (10 * _Zoffset)
_slick domove [getpos _LZ select 0, getpos _LZ select 1]
@!unitready _slick
@unitready _slick
_slick flyinheight 2
#FireLoop
_Slick fire "SEBMG50"
~.01
?getpos _slick select 2 > 4:goto "FireLoop"

#Wait2
~1.5
?getpos _slick select 2 > 4:goto "Wait2"
"if (!(_x in units group (driver _slick))) then {unassignvehicle _x}" foreach crew _slick

@("alive _x" count (crew _slick))<= "alive _x" count [driver _slick, gunner _slick]
ReadyCounter = ReadyCounter + 1
#FireLoop2
_Slick fire "SEBMG50"
~.01
?ReadyCounter mod 4>0:goto "FireLoop2"
@slicklist select slickcleared == _Counter
_slick domove [getpos _depart select 0, getpos _depart select 1]
_slick setspeedmode "normal"
_slick flyinheight 25 + (10 * _Zoffset)
~1
slickcleared = slickcleared + 1
{if (getdammage _x >= 1) then {_x setdammage 0}} foreach _mypax
?_counter == 1:RadioChatterMode = 31; PublicVariable "RadioChatterMode"
?_counter == 2:RadioChatterMode = 0; PublicVariable "RadioChatterMode"
?getdammage _slick > .9:goto "trashed"
@!unitready _slick
@unitready _slick
...
exit
#WaitAwhile
~15
goto "Back"
Dinger/Cfit

vectordude

  • Guest
Re:Vietnam Style Chopper Landings
« Reply #6 on: 10 Dec 2002, 23:13:09 »
hey can u send me a copy of that mission, i'd like to see how u did it because im also trying to get my stupid helicopters to line up correctly and land right....never want to do it correctly for some darned reason lol

vector1043x@hotmail.com

vectordude

  • Guest
Re:Vietnam Style Chopper Landings
« Reply #7 on: 10 Dec 2002, 23:15:24 »
hey can u send me a copy of that mission, i'd like to see how u did it because im also trying to get my stupid helicopters to line up correctly and land right....never want to do it correctly for some darned reason lol

vector1043x@hotmail.com

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Vietnam Style Chopper Landings
« Reply #8 on: 11 Dec 2002, 00:08:33 »
hmmm, that script confuses the hell outa me - and i know a fair bit about them...

if u cud send me the mission that wud be cool....

ddavis@custard-computers.co.uk
Proud Member of the Volunteer Commando Battalion

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re:Vietnam Style Chopper Landings
« Reply #9 on: 11 Dec 2002, 02:06:44 »

I'll attach one I am working on, it needs the little birds addons and Keygetys editor addons.

Basically i have 8 choppers 2 waves of 4 bringing in 3 dudes in each chopper. Then the chopper goes back and picks up 3 more dudes.

Mission is not very polished and if the choppers get out of hand it will lag your PC.

Hoz
Xbox Rocks

Azraell

  • Guest
Re:Vietnam Style Chopper Landings
« Reply #10 on: 13 Dec 2002, 20:09:47 »
i gotta evac script going in script beta testing....just need some testers so i can tweak it up, its an action menu activated....huey comes in and requests smoke for a LZ.... pretty pinpoint, even in heavy vegatation... check it out, maybe its what ur looking for...made it with Sebsnampack and 1.90 res ....currently only 1 helo is in it, but it can be modified for more. i also made it so it can be easily modified for use without smoke marker for a LZ.

Lone-Fox

  • Guest
Re:Vietnam Style Chopper Landings
« Reply #11 on: 13 Dec 2002, 20:10:56 »
I got this ALONG time ago (before resistance) but it works fine with 1.46 and 1.90. Works fine for me. dont know who made it though, so sorry to who did. I give you credit.

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Vietnam Style Chopper Landings
« Reply #12 on: 16 Dec 2002, 10:49:40 »
Here is a simple (probaly the simplest) way to do it, for a single chopper.

This script will make the chopper decrease it's height at a steady rate until it reaches a given point (expected to be a waypoint).

Decrease the size of the trigger if you are in more dense areas and want a steeper approach (the chopper will commence descent once it activates the trigger).

The script is as follows:

Code: [Select]
; force a chopper to land
; by snYpir

; this is the unit we want to force to land
_unit = _this select 0

; this is a position where the chopper will land (expected to be the chopper's waypoint)
_landingpos = _this select 1

; this is the distance away from _landingpos to make the chopper drop to earth
_mindis = 20

; this is the height the chopper will hover once landed (expected to be between 1 and 5)
_minheight = 1



; ----------- edit beyond here at own risk ------------



; get initial height of chopper
_hgt = getpos _unit select 2

; get distance chopper to landing pos at start
_x1 = _landingpos select 0
_y1 = _landingpos select 1
_x2 = getPos _unit select 0
_y2 = getPos _unit select 1
_dis = sqrt( (_x1-_x2)^2 + (_y1-_y2)^2 )

; determine ratio
_ratio = _dis / _hgt

#loop

_x1 = _landingpos select 0
_y1 = _landingpos select 1
_x2 = getPos _unit select 0
_y2 = getPos _unit select 1
_dis = sqrt( (_x1-_x2)^2 + (_y1-_y2)^2 )

_unit flyinheight (_dis / _ratio)

~0.1

? _dis < _mindis : goto "end"

goto "loop"

#end

; drop the chopper to the ground
_unit flyinheight _minheight

exit

I have included two example missions. One is for people with nampack 2 and the other is for people without it (on the desert island).

They are both exactly the same except the nampack one uses nampack addons.

Enjoy!
Bohemia Interactive Simulations

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Vietnam Style Chopper Landings
« Reply #13 on: 16 Dec 2002, 13:26:41 »
Ok, so what if you want to land heaps of choppers rather than just one at a time. Here is a 'wrapper' script that can be used with the previous script.

No triggers required this time, only choppers and waypoints and a single call to 'detect_choppers.sqs'.

All it does is check each chopper's proximity to the specified land waypoint, and lands each independantly as required.

I have modified land_chopper.sqs also (the one above is obselete now). The new version is in the attached zip. There are a few settings in land_chopper.sqs that you might want to check out.

The land_chopper.sqs script now monitors the velocity of a chopper to determine when it has slowed sufficently to actually make it touch down. You can now have perfectly smooth landings for choppers. You can set the velocity to high for flare landings also (good for hueys and kiowas, bad for blackhawks and chinooks).

Note the the waypoints passed into detect_choppers.sqs should be set to 'careless' and 'never fire'.

Here is the wrapper script (that calls land_chopper.sqs for every chopper):

Code: [Select]

; force a number of choppers to land
; by snYpir

;[[array of chopper names],[array of corresponding chopper waypoints that are going to be 'land here' waypoints],distance to commence descent] exec "detect_choppers.sqs"
; eg
;[[chopper1,chopper2],[[group chopper1,1],[group chopper2,1]],200] exec "detect_choppers.sqs"

; array of choppers that will be landed
_aR_units = _this select 0

; array of waypoints that will be used to slow the choppers down
_aR_landing_wps = _this select 1

; distance from landing waypoint to commence descent
_dis_descent = _this select 2

; ----------- edit beyond here at own risk ------------

; when choppers are within _dis_descent start dropping them with land_chopper.sqs

_c = 0

; convert waypoints to positions
_aR_landing_posns = []
#loop1
_aR_landing_posns = _aR_landing_posns + [getwppos (_aR_landing_wps select _c)]
_c = _c + 1
? _c < count _aR_landing_wps : goto "loop1"

; this will store the names of choppers that have been detected
_aR_done = []

_c = 0
#loop2

; get distance from this chopper to the landing waypoint

_x1 = (_aR_landing_posns select _c) select 0
_y1 = (_aR_landing_posns select _c) select 1
_x2 = getPos (_aR_units select _c) select 0
_y2 = getPos (_aR_units select _c) select 1
_dis = sqrt( (_x1-_x2)^2 + (_y1-_y2)^2 )

? _dis < _dis_descent && !((_aR_units select _c) in _aR_done) : _aR_done = _aR_done + [_aR_units select _c]; [_aR_units select _c,_aR_landing_posns select _c] exec "land_chopper.sqs"

~0.1

_c = _c + 1
? _c == count _aR_units : _c = 0
? count _aR_done == count _aR_units : goto "end"

goto "loop2"

#end

exit

The example mission (on desert island only this time) is attached.
Bohemia Interactive Simulations