Home   Help Search Login Register  

Author Topic: paradrops  (Read 1352 times)

0 Members and 3 Guests are viewing this topic.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
paradrops
« on: 09 Oct 2004, 01:24:03 »
I know how to parachute troops, but i am having difficulty with dropping equipment....can someone please explain how to do this correctly....thanks


Trash Can Man

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:paradrops
« Reply #1 on: 09 Oct 2004, 01:41:53 »
camCreate your parachute in mid air; camCreate your cargo below it; use a setPos loop to keep the cargo in the right place as the chute falls.

I presume.   ::)    Never tried it.
« Last Edit: 09 Oct 2004, 01:42:19 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:paradrops
« Reply #2 on: 09 Oct 2004, 03:22:57 »
It is best to initially use setpos to get the equipment in the right position relative to the chute, but then use:

_equip setVelocity [velocity _chute select 0,velocity _chute select 1,velocity _chute select 2]

.... in a loop.  This looks less "jumpy" then using setPos, but the loop should have a very small delay (~.000001) or so, depending on the CPU and other mission factors that effect lag.

Some equipment seems to not respond to the Velocity command, so in such cases you have to use the setPos command in a loop thusly:

_equip setPos [getPos _chute select 0, getPos _chute select 1, (getPos _chute select 2)- 5]

The "-5" above will have to be adjusted, as I do not remember the nominal number to get the stuff positioned at the end of the parachute cords.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:paradrops
« Reply #3 on: 09 Oct 2004, 04:51:38 »
Quote
camCreate your parachute in mid air; camCreate your cargo below it; use a setPos loop to keep the cargo in the right place as the chute falls.

I presume.      Never tried it.


Not only have I never tried it, I'm not sure that is what I am looking for. I came across a tutorial for making troops parachute from a C130. What I am trying to do now is make Vehicles parachute from planes as well. This is the script that came with the tutorial:

;by Sterling Silver.
;


_grp = _this select 0

_vehicle = _this select 1

_aunits = units _grp
_i = 0
_j = count _aunits


#Here
_chute = "parachute" createvehicle getpos (_aunits select _i)
(_aunits select _i) moveindriver _chute
_drp=getpos _vehicle;
_chute setpos _drp;
_i=_i+1
~0.2
?_j>_i:goto "Here"

exit

Now, my thinking was do the same for vehicles as I did for the troops. when I did that, All I saw was the Parachute with no vehicle below it. In the Vehicle (Jeep) Init line I had: para1=group this.  I know this is wrong and I think it's here where my problem is.....your thoughts...


Trash Can Man

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:paradrops
« Reply #4 on: 09 Oct 2004, 11:34:17 »
Soldiers, objects (like jeeps or ammo crates) and groups are profoundly different in OFP, in the same way that triggers and waypoints are profoundly different.     They share a few characteristics just to confuse you.  

Could a jeep drive a jeep?   No.  So why do you think it can drive a parachute?   ;D     Similarly, I suppose you can assign a group name to an empty jeep, but I don't suppose it does anything useful.

Go with Raptorsaurus' suggestion.    By all means use an existing paradrop script as a starting point, but when you're finished I'll be surprised if you have any of the original script left.

Combine the hint and format commands to help debug your script.    For example

hint format ["_i= %1\n\n_aunits select _i=%2", _i,  _aunits select _i]
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:paradrops
« Reply #5 on: 09 Oct 2004, 11:39:50 »
Here is a script I have used to do exactly what you are looking for.

You can see it in action in:
Establish Bridgehead

I use it to paradrop ammo crates, Jeeps with machine guns - complete with crew etc.  

I use a modified version to drop ridiculous things like Repair trucks, M113 (full of infantry) and even Abrams!
« Last Edit: 09 Oct 2004, 11:50:43 by THobson »

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:paradrops
« Reply #6 on: 09 Oct 2004, 22:58:50 »
AARRGGHH!!!!!  this is so confusing!!! I tried using the script, and I got a helicopter with an Abrams underneath, but it wouldn't parachute in!! dammit!!   ??? It must be something what I'm writing in the Init. fields. For the Chopper, I had:

this setbehaviour "CARELESS"; this flyinheight 50;[this,tank1,chute_1,chute_2,chute_3,chute_4] exec "heli4drop1.sqs"

I use two scripts from Thobson, one to drop the tank:

                                                                                                                                                                                                        ; script by David Berka (David.Berka@nmi.at)
;Put [this,cargo,chute1,chute2,chute3,chute4] exec "heli4drop.sqs" in the init field of the helicopter
;create a trigger that will set release4_1 = true

_heli = _this select 0
_car = _this select 1
_chute1 = _this select 2
_chute2 = _this select 3
_chute3 = _this select 4
_chute4 = _this select 5

#Update

_heliPos = getPos _heli
_heliPosX = _heliPos select 0
_heliPosY = _heliPos select 1
_heliPosZ = _heliPos select 2

_chute1Pos = getPos _chute1
_chute1PosX = _chute1Pos select 0
_chute1PosY = _chute1Pos select 1
_chute1PosZ = _chute1Pos select 2
_chute1 setPos [_chute1PosX, _chute1PosY, 300]

_chute2Pos = getPos _chute2
_chute2PosX = _chute2Pos select 0
_chute2PosY = _chute2Pos select 1
_chute2PosZ = _chute2Pos select 2
_chute2 setPos [_chute2PosX, _chute2PosY, 300]

_chute3Pos = getPos _chute3
_chute3PosX = _chute3Pos select 0
_chute3PosY = _chute3Pos select 1
_chute3PosZ = _chute3Pos select 2
_chute3 setPos [_chute3PosX, _chute3PosY, 300]

_chute4Pos = getPos _chute4
_chute4PosX = _chute4Pos select 0
_chute4PosY = _chute4Pos select 1
_chute4PosZ = _chute4Pos select 2
_chute4 setPos [_chute4PosX, _chute4PosY, 300]


_car setPos [_heliPosX, _heliPosY, _heliPosZ - 3]
_heading = getDir _heli
_car setDir _heading
~0.01
? (release4_1) : goto "Drop"
goto "Update"


#Drop

_chute1 setDir _heading
_chute2 setDir _heading
_chute3 setDir _heading
_chute4 setDir _heading

~0.01

_carPos = getPos _car
_carPosX = _carPos select 0
_carPosY = _carPos select 1
_carPosZ = _carPos select 2

_chute1 setPos [_carPosX + 1.5, _carPosY - 1.5, _heliPosZ - 18]
_chute2 setPos [_carPosX + 1.5, _carPosY + 1.5, _heliPosZ - 18]
_chute3 setPos [_carPosX - 1.5, _carPosY + 1.5, _heliPosZ - 18]
_chute4 setPos [_carPosX - 1.5, _carPosY - 1.5, _heliPosZ - 18]

#DropUpdate

_chute1Pos = getPos _chute1
_chute1PosX = _chute1Pos select 0
_chute1PosY = _chute1Pos select 1
_chute1PosZ = _chute1Pos select 2

_car setPos [_chute1PosX, _chute1PosY, _chute1PosZ - 3]

_chute2 setPos [_chute1PosX, _chute1PosY + 3, _chute1PosZ]
_chute3 setPos [_chute1PosX - 3, _chute1PosY + 3, _chute1PosZ]
_chute4 setPos [_chute1PosX - 3, _chute1PosY, _chute1PosZ]

~0.01
? (_chute1PosZ > 3) : goto "DropUpdate"

exit


And one for dropping cargo:


; script by Trevor Hobson
;Put [delay] exec "dropcargo.sqs" in the Activate field of a trigger

_delay = _this select 0

releasecargo1_6 = true

~ _delay

releasecargo1_5 = true

~ _delay

releasecargo1_3 = true

~ _delay

releasecargo1_4 = true

~ _delay

releasecargo1_1 = true

~ _delay

releasecargo1_2 = true

exit

Now, someplace in here lies my mistake, but I can't seem to see it.  Your thoughts....



Thanks to everyone thus far.....I'm definitely making progress!! ;D



Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:paradrops
« Reply #7 on: 10 Oct 2004, 11:18:53 »
I made this mission ages ago and would do quite a bit of it differently now.  

One thing you should note is that each item being dropped has its own script and its own release trigger.  In each script there is a line like this one:
Code: [Select]
? (release4_1) : goto "Drop"You will see that each script uses a different variable here.  release4_1 is for the first object that needs 4 chutes, release4_2 is for the second object that needs 4 chutes etc.  Similarly release1_1 is for the first item to be dropped that needs 1 chute.  You need a trigger synchronised with the correct chopper to set these variables = true when you want them to execute the drop.

The second script you show is activated by a particular chopper entering the area of a trigger.  It then runs the script which sets the release variable = true for several items after a delay between each.  What you see in the mission is a chinook flying over fast dropping a string of items separated by the delay set in the script.  I believe the one you show is for dropping several ammo crates and a couple of crewed jeeps with m/gs.  

The cargo items are waiting on an offshore island before being setPos-ed to underneath the chopper when they are dropped.  The large items (Abrams etc.) appear to be slung underneath their chinook as they are 'carried' in by the chopper.

I hope this makes it all clear

If you want to have a bit of entertainement it is fun to set the player as a crew member in one of the vehicles being dropped - the jeep with m/g is particularly fun.  This is why I take so long writing missions - I play with them too much.

« Last Edit: 10 Oct 2004, 12:13:19 by THobson »

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re:paradrops
« Reply #8 on: 14 Oct 2004, 20:45:02 »
Hey THobson, do you still have the mission you described? So I can take a look??  Just curious... :)



Trash Can Man

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:paradrops
« Reply #9 on: 14 Oct 2004, 21:26:49 »
Just click on the name of the mission (Establish Bridgehead) in reply 5 above.
« Last Edit: 14 Oct 2004, 23:00:40 by THobson »