Home   Help Search Login Register  

Author Topic: Chopper insertion on buildings  (Read 2363 times)

0 Members and 1 Guest are viewing this topic.

Swatdog

  • Guest
Chopper insertion on buildings
« on: 09 Sep 2005, 06:20:03 »
Is there a script somewhere that will enable an AI chopper to land on top of a building? The pilots don't have to get out, just possibly fly low enough over the building, and then eject the units in transport.

Thanks a lot.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Chopper insertion on buildings
« Reply #1 on: 09 Sep 2005, 10:24:28 »
the architect achieved something similar in "deep water", where he landed a chopper on what appeared to be one of the LST ships, but which was actually a block of flats.

i suspect it was done by setposing a helicopter H in midair above the object and having the chopper head for it as usual. not sure if this works though as from memory the H tends to appear on the ground no matter what...

worth a try though ;)

EDIT - just had a wee play around with this - see attached missionette - needs some adjustment i think...

(requires general barron's editor addon for the buildings...)
« Last Edit: 09 Sep 2005, 10:39:36 by bedges »

Offline Blanco

  • Former Staff
  • ****
Re:Chopper insertion on buildings
« Reply #2 on: 09 Sep 2005, 15:06:33 »
There also the precise rappelscript from Snypir
With that you can rappel on the roof of a building.

http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=6981;start=60

Second post on the page. ;)

PS : It requires SNYSptPack

Maybe you alter the code to make the chopper land on the roof.





« Last Edit: 09 Sep 2005, 15:09:05 by Blanco »
Search or search or search before you ask.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Chopper insertion on buildings
« Reply #3 on: 09 Sep 2005, 19:31:56 »
BAS Blackhawks and Bas Pavelows have rappeling scripts that allow you to insert troops on roof tops. I have seen it done, but it takes a little fiddling around in the editor to find the right position of the waypoint. Check the readme of the blackhawks or the pavelow

Here's the addons...
BAS Blackhawks(MH60/SOAR) 1.00: http://www.gotf.net/download.asp?dl=78
BAS Pavelows 1.10: http://www.gotf.net/download.asp?dl=32

The helo's also requires...
BAS Air Weapons 1.00: http://www.gotf.net/download.asp?dl=19
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Kyle Sarnik

  • Guest
Re:Chopper insertion on buildings
« Reply #4 on: 09 Sep 2005, 21:05:22 »
Hehe, you don't need all of those fancy addons to get an AI helocopter to land on a building.

Code: [Select]
_helo = _this select 0
_building = _this select 1
_zpos = _this select 2

_height = (getpos _helo select 2)
_speedmode = speedmode _helo
dostop _helo
_helo flyinheight (_zpos + 10)
#MoveToBuilding
~1
_distance = _helo distance _building
? (_distance < 250) && (speedmode _helo != "Limited") : _helo setspeedmode "Limited"
_helo domove (getpos _building)
_speed = speed _helo
? (_distance > (_zpos + 15)) && ((abs  _speed )> 2) : goto "MoveToBuilding"
_helo flyinheight (_zpos - 2)
@ (getpos _helo select 2 < 1)
#EjectCargo
~1
? count (crew _helo) <= 2 : goto "TakeOff"
_crew = crew _helo - [driver _helo,gunner _helo]
_troop = _crew select 0
_troop action ["GETOUT",_helo]
unassignvehicle _troop
goto "EjectCargo"
#TakeOff
? _height < (_zpos + 5) : _height = _zpos + 10
_helo flyinheight _height
_helo setspeedmode _speedmode
_helo dofollow (leader group driver _helo)
exit

That should do it, _zpos is the height of the roof that the helo is supposed to land on.
« Last Edit: 09 Sep 2005, 21:09:59 by Kyle Sarnik »

Swatdog

  • Guest
Re:Chopper insertion on buildings
« Reply #5 on: 09 Sep 2005, 22:41:12 »
Thanks for all of your suggestions. I will try them all.

BTW, sorry bedges for posting it into the wrong section. It was "Advanced" to me.  :P
« Last Edit: 09 Sep 2005, 22:42:50 by Swatdog »

Kyle Sarnik

  • Guest
Re:Chopper insertion on buildings
« Reply #6 on: 09 Sep 2005, 23:06:28 »
Ok, before you go saying "it doesn't work", I know, thats why I worked on it some more and thoroughly tested it.

Ill attach the .sqs file and you can download it by clicking on it at the bottom there.

But first, I need to explain how to use it. Whenever you are ready to make the helicopter start its insertion run, execute the command like this:

Code: [Select]
[heloname,building,zpos,direction] exec "RoofInsertion.sqs"
Heloname is obvious, building can either be the name of one placed in an editor or one on the island (object ID#), direction is a number (0-360) that will tell the helicopter what direction to face before landing (0 = N, 90 = E, 180 = S, 270 = W), and zpos. Now, zpos is very important here, zpos is a number representing the height of the building, and you will need to figure it out depending on the building type (through trial and error), you will know if zpos is to small a number if the helicopter (when it reaches the building) doesn't attempt to land and just sits there, and if it is too large a number, the helicopter will attempt to land, but will stop short of the building and will hover higher than the roof, so then you know you need to decrease the number. Now, I have no idea what any other building's zpos should be, but for the small, 2 story nogova building with the green roof, its exactly 20, and I can assure you that the 4 story one is NOT 40 and the 8 story one is definatly NOT 80. If I were you I would start at 20 and if thats too low, go up by 1 each time, and you may (not sure) have to use a decimal.

Ok, hope it helps.

Swatdog

  • Guest
Re:Chopper insertion on buildings
« Reply #7 on: 09 Sep 2005, 23:14:07 »
Thanks a lot Kyle. I will be using this script for my mission on the CAT_Afghanistan island, so I will need to determine the height a little differently being that it's not a Nogovan building. I will surely try this right now.

Thanks again, if it works.  ;)

Kyle Sarnik

  • Guest
Re:Chopper insertion on buildings
« Reply #8 on: 09 Sep 2005, 23:26:54 »
Ah, in that case, make sure the building has a Roadway LOD on its roof, or, in other words, if you try to walk/drive/land on the roof, it will "feel" like normal ground (unlike the original CWC buildings, where you'd get stuck and everything). Also, I am pretty sure most of the afgan buildings are either about the same height or lower than the 2 story apartment building, but like I said, its a whole lotta trial and error (don't worry, we all have to deal with that  :-\).

Swatdog

  • Guest
Re:Chopper insertion on buildings
« Reply #9 on: 09 Sep 2005, 23:30:05 »
Oh yea, I've done much trial and error. I have a pretty good sense of judement when it comes to how far or high things are, so it shouldn't be too bad.

The only thing I'm worried about is that the chopper that will be landing on the roof will be the new CH-53E Super Stallion released by Semper Fidelis just recently. That is a huge chopper and I don't know if it will conflict with anything. Also the fact that Semper Fidelis made the chopper very hard to maneuver, even the "Auto Hover" has a hard time stabilizing it. So I'm wondering if the AI will have the same difficulty maneuvering that thing around like I have.

Anyway, I will give this a go and get back to you.
« Last Edit: 09 Sep 2005, 23:34:04 by Swatdog »

Kyle Sarnik

  • Guest
Re:Chopper insertion on buildings
« Reply #10 on: 09 Sep 2005, 23:40:59 »
Oh yea, I've done much trial and error. I have a pretty good sense of judement when it comes to how far or high things are, so it shouldn't be too bad.

The only thing I'm worried about is that the chopper that will be landing on the roof will be the new CH-53E Super Stallion released by Semper Fidelis just recently. That is a huge chopper and I don't know if it will conflict with anything. Also the fact that Semper Fidelis made the chopper very hard to maneuver, even the "Auto Hover" has a hard time stabilizing it. So I'm wondering if the AI will have the same difficulty maneuvering that thing around like I have.

Anyway, I will give this a go and get back to you.

Well considering the afgan buildings have alot more surface area on the roofs, and I was able to get an AI blackhawk to land on that tiny apartment building barely big enough to fit the chopper, then I would say your OK. The only potential problem I see is if the CH-53s have roadway LODs in the cargo bay that will cause the Zpos of the helicopter to be wrong, in which case, the script won't be able to detect when the helicopter has touched down...   :-\ If that is the case, I can fix it, but it wouldn't be a great idea to use the modified one on other helicopters, so kind if like a special version just for the CH-53 and some other helicopters with the same problems (BAS MH-47E, etc..).

Swatdog

  • Guest
Re:Chopper insertion on buildings
« Reply #11 on: 09 Sep 2005, 23:57:14 »
Well, the building can definately hold the chopper and the units just fine, and the height of it is exactly 7m. Now, when do I execute the script? I know that you said when I start the insertion run, but the insertion run will be initiated in the beginning. I guess my question is do I still have to set waypoints, and if so, in which waypoint do I execute the script in?

Also, is your script MP compatible? I don't see why it wouldn't be, but I just thought I'd ask just to make sure.

UPDATE:
Well, I tried giving it a "Move" waypoint to the building, but the stupid AI flies into the city extremely fast, regardless of the speedmode I assign it, and it goes WELL over where I want it to land (other side of the dumb city). I had the script executed when the waypoint was reached, and when it flew over the building, the script got activated and then the chopper lowered it's flyinheight command to I would imagine 17m (since the building is 7m and you had the command _helo flyinheight (_zpos + 10)) which was way too low and when the AI tried to fly itself over to the waypoint, it crashed into other buildings because it was flying too low. Is there a way to make the chopper have a precise landing sequence? Maybe using the script by SnYpir that Blanco refered me too, and possibly combining it with this (minus the rappel part of course)?
« Last Edit: 10 Sep 2005, 00:15:50 by Swatdog »

Kyle Sarnik

  • Guest
Re:Chopper insertion on buildings
« Reply #12 on: 10 Sep 2005, 03:24:36 »
You don't have to assign any waypoints to the helicopter, simply run the script at the init and it will head to the building, but 7 seems kind of low, why don't you try something like 15? Im not sure if I mentioned this before but zpos is not the exact hight in meters that the roof is from the ground. Anyways try 15 or something and see how that works out, and if you still can't get it to work, take a screenshot of the building and I will try and figure out something.

Swatdog

  • Guest
Re:Chopper insertion on buildings
« Reply #13 on: 10 Sep 2005, 07:58:05 »
Having executed your script at the beginning and not assigning any waypoints, it won't move at all, which is odd because you said you tested it out? The only thing it does is lower it's altitude.

Kyle Sarnik

  • Guest
Re:Chopper insertion on buildings
« Reply #14 on: 10 Sep 2005, 14:41:10 »
Having executed your script at the beginning and not assigning any waypoints, it won't move at all, which is odd because you said you tested it out? The only thing it does is lower it's altitude.

What are the parameters you used? Can you copy/paste the line where you executed it?