Home   Help Search Login Register  

Author Topic: Small problems  (Read 1011 times)

0 Members and 1 Guest are viewing this topic.

Kaolin

  • Guest
Small problems
« on: 14 Nov 2004, 17:08:28 »
ok, hello to you all;

my first question is if i have a transport heli with a large cargo, how do i fit more than one group in there? or is that not possible?  ???
Also if i want them to dissembark will they operate as seperate groups? as an example: i want four groups of 5 soldiers to get in a superstallion, the heli will take them to the LZ i then want the groups to dissembark and go their seperate ways via waypoints, the superstallion will then fly off and and not circle above the groups, is this possible?  :-\

thanking in advance    
 
  Kaolin
« Last Edit: 14 Nov 2004, 17:09:46 by Kaolin »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Small problems
« Reply #1 on: 14 Nov 2004, 19:01:11 »
Yes, it's very possible. Is it something you have problems with?

:beat: *Gets Shot* :beat:

EDIT: And why do you post it in OFPEC Comments?
« Last Edit: 14 Nov 2004, 19:01:43 by dmakatra »

Offline KTottE

  • Former Staff
  • ****
Re:Small problems
« Reply #2 on: 14 Nov 2004, 19:50:54 »
Topic has been moved here instead.

If the superstallion has 20 cargo seats it should be possible to transport all the guys in the back, and it doesn't matter what groups they are in if you use the get in waypoints or the moveInCargo scripting command. They will be in the same groups when they exit the helicopter.

To get the helicopter to circle above one of the groups, you could do the following:

1) Create a waypoint for your helicopter after the waypoint where it unloads the soldiers, make it a move waypoint if you want it to just hover, make it a seek and destroy waypoint if you want it to move around and engage targets.

2) In the activation field of the waypoint where the soldiers are unloaded, put this: [helicoptername,unitname] exec "helicopterFollow.sqs"

helicoptername is the name of the helicopter you want to control, unitname is a name of a unit in the group you want the helicopter to follow.

3) Open notepad and type in the following:
Code: [Select]
_helicopter = _this select 0
_unit = _this select 1

_helogroup = group _helicopter
_unitgroup = group _unit


; This makes sure the helo won't leave the waypoint over the group
_helogroup lockWP true

; Set a boolean to false so we can end the loop if we want
endHeloLoop = false

#loop
_unitleader = leader _unitgroup

[_helogroup,2] setWPPos (getPos _unitleader)

?!(alive _helicopter): exit
?!(alive _unitleader): goto "exit"
?(endHeloLoop): goto "exit"
~10
goto "loop"

#exit
; This let's the helicopter resume it's waypoints if none of the groupmembers are alive or if you end it manually.
_helogroup lockWP false
exit

Save the above as helicopterFollow.sqs in the mission folder.

3) Try the mission and see if it works as you wanted it to.

Some notes:
In this line: [_helogroup,2] setWPPos (getPos _unitleader)
you will need to edit the number 2 so it's the same number as the waypoint following the one where you drop your soldiers off. It's easy to do this, simply press F4 and double-click on the waypoint you want, it says "#: Waypoint type" in a dropdown list at the top, add one to that number and it's the one you want. So if it says: 0: Move, change the script so it says 1 instead of 2, if it says 4: Move, make it so that the script says 5 and so forth.

This script works so that the helicopters waypoint is positioned at the position of the leader of the unit you passed into the script. If you make it a seek and destroy waypoint, the helicopter will constantly fly around and search for targets, and engage them if it finds any (if the helicopter is armed that is)

If the leader of the group dies, the script will continue to work as the next unit in line becomes the new leader, and if the last person dies, the script exits and lets the helicopter continue along it's waypoints (if it has any).

If you want to end the helicopters patrol before all the members of the group have been killed, simply type the following in a trigger or a waypoints on activation field:
endHeloLoop = true

This is completely untested, so let me know if it works, it could be a neat trick :)

edit

I just tested it quickly myself, the best approach to get it to work is to do this:

Place a move or seek and destroy waypoint a ways off from the point where you drop off your ground forces.

Make a trigger activated by west, east or resistance (depends on which side your guys are on) and in it, place the code to execute the script, the [helicoptername,unitname] exec "helicopterFollow.sqs" bit, this will make the helicopter come out of the area to escape ground fire, then turn around and come in over the group(s) to cover them. It looks very good when you do it on Ia Drang with the SEB Nampack units, nothing like a Huey that swoops out low over the trees and then comes back in and hovers above, covering you :)
« Last Edit: 14 Nov 2004, 20:02:38 by KTottE »
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Small problems
« Reply #3 on: 14 Nov 2004, 20:57:46 »
KTottE's script is to get the helicopter to follow your troops, which is what I think you're trying to avoid.

The short answer - yes, it's all possible.  Most of the problems you have are because the chopper and its passengers are all part of the same group.  You need to split them up at some point.  There are many things you can't do in OFP, but a few things have many solutions - this is one of the latter.  I'd probably script a solution; but that's probably not what you want to hear.

The script-free approach (as best I can remember) is to start-off with your chopper not flying.  Add a LOAD waypoint (WP) on it or close next to it.  Then add MOVE WPs along its planned route except for a TRANSPORT UNLOAD WP at the LZ.

Up to the cargo limit of your chopper, create as many groups of infantry you want near the chopper.  Each group should have a GET IN WP near the chopper's LOAD WP.  Subsequent WPs will be the route/actions you wish them to take from the LZ.

The trick is to hit the Synchronize button and drag a blue line from each infantry group's GET IN WP with the chopper's LOAD WP.

What should happen is the chopper will sit at the LOAD WP, the infantry will move to the chopper and GET IN. Now the chopper will take off and move alongs its WPs to the LZ.  There it will [TRANSPORT] UNLOAD the infantry.  The chopper should then take off and go its way while the infantry go theirs.

If any of that is wrong, don't worry - somebody will tell us.

You may need to tweak it quite a lot as choppers don't always do what they're told.

If you want to start with infantry groups already in a flying chopper you'll need a scripted solution.

I (and others will) recommend you look at the tutorials available in the Editor's Depot.  There's a lot to take in but it is the least frustrating way to start!


Kaolin

  • Guest
Re:Small problems
« Reply #4 on: 14 Nov 2004, 22:46:53 »
Thank you all!!!  ;D

Both soultions have provided help! though the latter is what i was looking for  :D dont worry bout scripting a solution i've tested the other solution and it works fine (expect for the odd glitch) and KTottE's  script works a treat, though it did take a while before i could get it to work, nevertheless it worked!

Thank you all once again!
and i'll remember where to post topics like this in the future  :P

Kaolin
« Last Edit: 14 Nov 2004, 22:52:15 by Kaolin »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Small problems
« Reply #5 on: 14 Nov 2004, 23:49:33 »
well KTottE's script was somthing i was looking for to solve a different problem. thankyou KTottE
« Last Edit: 14 Nov 2004, 23:50:23 by penguinman »

Offline KTottE

  • Former Staff
  • ****
Re:Small problems
« Reply #6 on: 15 Nov 2004, 09:27:42 »
Good thing it was good for something, I completely misread the first post  ::)

It's not tested, but it should work with vehicles as well as infantry groups, so you could get helicopter cover for a convoy or something.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"