Home   Help Search Login Register  

Author Topic: spawning units with para  (Read 1156 times)

0 Members and 1 Guest are viewing this topic.

Offline dogzofwar

  • Members
  • *
    • dogzofwar xfire
spawning units with para
« on: 12 Sep 2008, 02:40:27 »
Just like the title implies i notice how mandobile and other people can spawn units , ammo etc, using parachutes with scripts ... how?
He belonged to that army known as invincible in peace, invisible in war.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: spawning units with para
« Reply #1 on: 14 Sep 2008, 10:58:44 »
Just two basic examples.

For soldiers:
Code: [Select]
// soldier_in_chute.sqf
// res = [my_soldier1, getMarkerPos "mk_1"]execVM"soldier_in_chute.sqf";
_soldier = _this select 0;
_pos = _this select 1;

_para = "ParachuteWest" createVehicle [0,0,0];
_para setPos [_pos select 0, _pos select 1, 100];
_soldier moveInDriver _para;

For ammo boxes:
Code: [Select]
// ammo_in_chute.sqf
// res = [my_ammo_box1, getMarkerPos "mk_1"]execVM"ammo_in_chute.sqf";

_box = _this select 0;
_pos = _this select 1;

_para = "ParachuteWest" createVehicle [0,0,0];
_para setPos [_pos select 0, _pos select 1, 100];

while {(getPos _para select 2) > 2.5} do
{
   _box setPos (_para modelToWorld [0,0,-2]);
   _box setVectorDir (vectorDir _para);
   _box setVectorUp (vectorUp _para);
   Sleep 0.002;
};
_box setDir 0;
_box setPos [getPos _para select 0, getPos _para select 1, 0];

Offline Binary

  • Members
  • *
Re: spawning units with para
« Reply #2 on: 15 Sep 2008, 13:55:22 »
Nice one Mando :)
Is there a way to ease the parachutes descent?
I tried the above example with a HMMWV - but it looks really strange as the HMMWV moves as much with the chute as a person would..
"Ah.. Home sweet hell !" - Al Bundy

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: spawning units with para
« Reply #3 on: 15 Sep 2008, 15:45:59 »
Constantly setDir the chute to its original direction. You might also try a constant setVectorUp but I have had strange experiences using that on chutes, so maybe on the car? Could also use Kronzky's drop script.

Code: [Select]
// ammo_in_chute.sqf
// res = [my_ammo_box1, getMarkerPos "mk_1"]execVM"ammo_in_chute.sqf";

_box = _this select 0;
_pos = _this select 1;

_para = "ParachuteWest" createVehicle [0,0,0];
_para setPos [_pos select 0, _pos select 1, 100];
_dir = getDir _para;

while {(getPos _para select 2) > 2.5} do
{
   _box setPos (_para modelToWorld [0,0,-2]);
   _para setDir _dir;   
   _box setDir _dir;
   Sleep 0.002;
};
_box setDir _dir;
_box setPos [getPos _para select 0, getPos _para select 1, 0];
Code: [Select]
// ammo_in_chute.sqf
// res = [my_ammo_box1, getMarkerPos "mk_1"]execVM"ammo_in_chute.sqf";

_box = _this select 0;
_pos = _this select 1;

_para = "ParachuteWest" createVehicle [0,0,0];
_para setPos [_pos select 0, _pos select 1, 100];

while {(getPos _para select 2) > 2.5} do
{
   _box setPos (_para modelToWorld [0,0,-2]);
   _box setVectorDir (vectorDir _para);
   _box setVectorUp ([ 0, 0, 1]);
   Sleep 0.002;
};

« Last Edit: 15 Sep 2008, 15:57:54 by Mr.Peanut »
urp!