バトルフィールドのように、操縦と砲塔の操作を同時に動かせられる One Man Tank Operationスクリプト。Arma 3のスクリプト チュートリアルなどを掲載するハック ブログKK's blogで公開されました。
下記の構文をM1A2 Slammerのinit欄か、init.sqfに記述するのみ。マルチプレイにも対応。
this call {
if (isServer) then {
_this lockTurret [[0], true];
_this lockTurret [[0,0], true];
_this lockCargo true;
_this addMPEventHandler ["MPKilled", {
if (isServer) then {
_d = driver (_this select 0);
_g = gunner (_this select 0);
if (!isNull _d) then {deleteVehicle _d};
if (!isNull _g) then {_g setDamage 1};
};
}];
};
if (!isDedicated) then {
_this addEventHandler ["GetIn", {
enableSentences false;
_tank = _this select 0;
_unit = _this select 2;
_unit allowDamage false;
_unit action ["EngineOn", _tank];
_unit action ["MoveToGunner", _tank];
_tank lock true;
_tank switchCamera "EXTERNAL";
_tank addAction [localize "str_action_getout", {
_this select 0 removeAction (_this select 2);
_this select 1 action ["GetOut", _this select 0];
}, "", 3, false, true, "GetOver"];
_tank spawn {
waitUntil {!isNull gunner _this};
_ai = createAgent [
typeOf gunner _this, [0,0,0], [], 0, "NONE"
];
_ai allowDamage false;
_ai moveInDriver _this;
};
}];
_this addEventHandler ["GetOut", {
_tank = _this select 0;
_unit = _this select 2;
deleteVehicle driver _tank;
_unit allowDamage true;
_unit action ["EngineOff", _tank];
_tank lock false;
enableSentences true;
}];
};
};
但しempty状態でしか動作しません。
KK's blog – ArmA Scripting Tutorials: One Man Tank Operation
init欄はどのようにして見れば良いのでしょうか?
返信削除