返信先: ARMA3 ミッションエディットスレ
ホーム › フォーラム › TRI Gaming フォーラム › ARMA3 ミッションエディットスレ › 返信先: ARMA3 ミッションエディットスレ
2014年12月5日 9:59 AM
#30304
参加者
-
Simple Supply Drop Script
上空から弾薬箱、車両を投下するスクリプトです。
少し話題になっていたので投下します。
SupplyDrop.sqf
_temp = [“markerName”,”vehicleType”] execVM “scripts\supplyDrop.sqf”;
_position = _this select 0;
_vehicleclass = _this select 1;
_createpos = getMarkerpos _position;
_chuteType = "B_Parachute_02_F";
_chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
_chute setPos [_createpos select 0, _createpos select 1, 100];
_drop = createVehicle [_vehicleclass, position _chute, [], 0, 'NONE'];
_drop attachTo [_chute, [0, 0, -.3]];
waitUntil {position _drop select 2 < 0.5 || isNull _chute};
detach _drop;
_drop setPos [position _drop select 0, position _drop select 1, 0];
基本はこれベースでグローブマスター等から投下する事も可能です。
夢ひろがりんぐですが使いどころが限定されますね。
ミッション開始時やタスク完了時のインターバル等でどうぞ。
追記(応用編)動作未確認
ミッションに組み込んだ例を紹介します。
syntax : _temp = [“markerName”,”vehicleType”,1000] execVM “scripts\supplyDrop.sqf”;
_position = _this select 0;
_vehicleclass = _this select 1;
_altitude = _this select 2;
_createpos = getMarkerpos _position;
_drop = createVehicle [_vehicleclass, _createpos, [], _altitude, "FLY"];
[_drop] execVM "scripts\cargo_ammo.sqf";
WaitUntil {getPos _drop select 2 < 250};
_chuteType = "B_Parachute_02_F";
_chute = createVehicle [_chuteType, [100, 100, 250], [], 0, 'FLY'];
Sleep 0.1;
_d_drop = getposASL _drop;
_chute setPos [_d_drop];
_drop attachTo [_chute, [0, 0, -.3]];
waitUntil {position _drop select 2 < 0.5 || isNull _chute};
detach _drop;
_drop setPos [position _drop select 0, position _drop select 1, 0];
1000mで生成し、250mでパラシュートが展開されます。
そしてカーゴ内に弾薬生成しました。
グローブマスターから投下をしたい場合は
syntax : _temp = [“planeName”,”vehicleType”] execVM “scripts\supplyDrop.sqf”;
_createpos = getMarkerpos _position;
の箇所を
_createpos = [getpos _position select 0, getpos _position select 1, getpos _position select 2 - 10];
_chuteType = "B_Parachute_02_F";
_chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
_chute setPos [_createpos select 0, _createpos select 1, _createpos select 2 + 2];
_drop = createVehicle [_vehicleclass, position _chute, [], 0, 'NONE'];
_drop attachTo [_chute, [0, 0, -.3]];
waitUntil {position _drop select 2 < 0.5 || isNull _chute};
detach _drop;
_drop setPos [position _drop select 0, position _drop select 1, 0];
と書き換え、このスクリプト発動条件を
Plane01 distance getmarkerpos "dropzone" < 200
等に設定すれば出来ると思います。
スクリプトの文頭にwaitUntilをかませてもいいですけどね。