Home   Help Search Login Register  

Author Topic: Simple troops with parachutes  (Read 1749 times)

0 Members and 1 Guest are viewing this topic.

JPSelter

  • Guest
Simple troops with parachutes
« on: 02 Sep 2005, 18:07:17 »
How can I add a parachute to soldiers? Right now I have a bunch of soldiers as "In Cargo" with a chopper. Then I have some waypoints for the routes the chooper has to fly. The last waypoint is a "GET OUT" waypoint. But now the chopper is going down and the troops jump out. But I want the chopper to stay in the air and the troops to eject with parachutes. Do I have to script or is it easier than that? Thanks for any help :)

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple troops with parachutes
« Reply #1 on: 02 Sep 2005, 18:11:15 »
You need these commands for each unit.  Best to put them in a script:

Code: [Select]
_unit action ["eject",vehicle _unit]
unAssignVehicle _unit

JPSelter

  • Guest
Re:Simple troops with parachutes
« Reply #2 on: 02 Sep 2005, 19:30:16 »
As a complete script-n00b I request a full script example please :)

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple troops with parachutes
« Reply #3 on: 02 Sep 2005, 19:51:26 »
Try something like this:

Save this code as a file in the same directory as the mission.sqm file for this mission and call it EjectGroup.sqs

Code: [Select]
;EjectGroup.sqs
;called by [groupname] exec "EjectGroup.sqs"

_grp = _this select 0

_i = 0
#loop
_unit = (units _grp) select _i

_unit action ["eject",vehicle _unit]
unAssignVehicle _unit
~1
_i = _i + 1
if (_i < count units _grp) then {goto"loop"}
exit

In the init field of one of the members of the group put:

alphaGrp = group this

then you call the script by:
[alphaGrp] exec "EjectGroup.sqs"

Clearly you can use the same script for other groups , just give them a group name and then run the script for them.

By the way I have not tested it.

JPSelter

  • Guest
Re:Simple troops with parachutes
« Reply #4 on: 03 Sep 2005, 00:02:24 »
Great, itÂ's working :) Thanks! But one little problem :D The chopper is flying too low, the troops are dead when they jump :D IÂ'll try to find out how to fly it higher but maybe someone else here is quicker :)

Dagon

  • Guest
Re:Simple troops with parachutes
« Reply #5 on: 03 Sep 2005, 00:21:10 »
set this as a waypoint for your helo, or in the initialisation of your helo:

(heloname) flyinheight (X)

X is the height in metres you want it to fly; experiment till you find the right height. TMK, it's about 80 metres off the ground for a 100% safe jump.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple troops with parachutes
« Reply #6 on: 03 Sep 2005, 00:28:31 »
I use 100 to 200 but if 80 works then that could look good.

JPSelter:  I think you would do well to have a look through this:
http://www.ofpec.com/editors/comref.php
« Last Edit: 03 Sep 2005, 00:28:45 by THobson »

JPSelter

  • Guest
Re:Simple troops with parachutes
« Reply #7 on: 03 Sep 2005, 01:29:54 »
This should work, I will try this tomorrow, now IÂ'm too tired ;) I have another problem: How can I pick up troops? Right now the chopper is initially flying above the group. This group of soldiers have a waypoint attached to the helo typed "GET IN". The chopper lands to pick them up, but strangly at random places, sometimes some hundred meters away from the group.

I wish I had this: The chooper sits on the ground, a trigger makes him start and fly to the group. There he waits for all soldiers to be onboard and then flies on to the eject zone. Sitting on the ground and triggering is no problem, but how can I make the chooper land and wait to be boarded? I canÂ't attach a (groupÂ's) waypoint to another (the heloÂ's) waypoint, can I?

Thanks for the link :)

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple troops with parachutes
« Reply #8 on: 03 Sep 2005, 04:35:27 »
To make a chopper land and wait for units to get in:  Give the infantry a get in waypoint.  Give the chopper a load waypoint.  Synchronise these two waypoints.

To get the chopper to land where you want it to while this happens could be the subject of several PhD theses.  The first step is to use an 'H' object.  If that would look odd use an 'invisible H' object.  Think of these objects as an invitation to the chopper to land there.  If you place this inviatation on flat ground, it might well do that, or it might find a more desirable place to land some distance away, if it is placed on sloping ground then it depends on the slope as to whether the chopper will ever accept the invitation.  To make it land on the H, what I have done in the past is to give the chopper a series of waypoints, all limited speed, all close together, the first has choppername flyinHeight 50, the next has  choppername flyinHeight 45, then next choppername flyinHeight 40... until choppername flyinHeight 5 then the next is the Load waypoint.  At a height of 5 the chopper is then unlikely to be able to find a place to land that it prefers to the H object you have placed on the map.  Probably.

You need to experiment with this - sometimes a lot.

JPSelter

  • Guest
Re:Simple troops with parachutes
« Reply #9 on: 03 Sep 2005, 13:21:55 »
Working :) ... but only with 2 out of 3 choppers. My third chopper is just circling around the eject-waypoint doing nothing. I have 8 speznatz onboard but they donÂ't jump. I have all scripts working. Is the EjectGroup script limited to only 2 instances?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple troops with parachutes
« Reply #10 on: 03 Sep 2005, 14:27:34 »
Choppers will often circle a waypoint.    Use a trigger to cause them to eject, not a waypoint.  Make sure the trigger area is wide enough that the chopper can't cross it in less than about 1/2 second.  To make a trigger work for only one chopper, group it with that chopper.

EDIT:
Quote
Is the EjectGroup script limited to only 2 instances?
There is no practical limit.
« Last Edit: 03 Sep 2005, 14:28:22 by THobson »

JPSelter

  • Guest
Re:Simple troops with parachutes
« Reply #11 on: 03 Sep 2005, 15:48:21 »
ItÂ's working finally :) I lowered the altitude from 140 to 90 and increased the waypoint-radius to 100m. Now the choppers correctly reach the waypoint, eject their soldiers and fly home :) Thanks for your help!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple troops with parachutes
« Reply #12 on: 03 Sep 2005, 15:50:36 »
You haven't increased the waypoint radius.  You have increased the radius of the circle in which the waypoint is randomly placed.  To be reliable you should use triggers for the eject not waypoints.

JPSelter

  • Guest
Re:Simple troops with parachutes
« Reply #13 on: 03 Sep 2005, 17:01:59 »
ahhh hmmm... IÂ'm just happ the way it is now... but how can I add a trigger to a chopper? I know I can make triggers act to "west" and "east" with "present" or "not present", but how can I specify one single unit to trigger the trigger? I could make a chopper1_coming=true when it reaches an earlier waypoint but I guess you mean a different way.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Simple troops with parachutes
« Reply #14 on: 03 Sep 2005, 17:11:32 »
Select Group at the top of the screen.  Click and hold on the trigger and drag it to the chopper.  You will the have a green line connecting them.  
« Last Edit: 03 Sep 2005, 17:12:10 by THobson »