返信先: ARMA3 ミッションエディットスレ
ホーム › フォーラム › TRI Gaming フォーラム › ARMA3 ミッションエディットスレ › 返信先: ARMA3 ミッションエディットスレ
2014年11月26日 2:10 PM
#28800
参加者
- ミッション製作お役立ちスクリプト
先人でもあり偉人でもあるStealer氏のScriptを自分なりに改良した物です。
下記コードの内容をテキストに張り付け名前をcopypos.sqfに変更し、mission.sqmのある階層に放り込み
init.sqf内にplayer addAction [“>Copy Position”,”copypos.sqf”];と入れるだけです。
ミッションをリリースする時は、必ず「//」コメントアウトするか削除してください。
Copy Position Script
copypos.sqf
//player addAction [">Copy Position","copypos.sqf"];
_dir = getdir player;
_stance = "NULL";
_canmove = "move";
_pos = getpos player;
_posX = _pos select 0;
_posY = _pos select 1;
_posZ = _pos select 2;
_posASL = getposASL player;
_neck = player selectionPosition "Neck" select 2;
if (_neck <= 0.45) then {_stance = "DOWN";};
if (_neck >= 0.8 && _neck <= 1.2) then {_stance = "MIDDLE";};
if (_neck >= 1.3) then {_stance = "UP";};
if (_stance == "NULL") then {hint "ERROR - Stance capture failed\nkeep your stance horizontality and try again"}
else{
hint format ["Position > %1,\nDirection >\n%2\nStance > %3\n\n*Position data copied*",_posASL,_dir,_stance];};
copytoclipboard ("this setPosASL "+str _posASL+"; this setdir "+str _dir+"; this setunitpos "+str _stance+";this disableAI "+str _canmove+";");
getposで三次元座標をgetdirで向きを決め、
モデルの首の位置の高さを計測し、setunitposの値を決めています。
これで実際に歩いてユニットを置きたい場所に移動し、アクションメニューから選択したら裏画面に戻り、メモ帳にCtrl+Vをしてメモしていきましょう。
エディット画面に戻った時に、メモ帳に記録してあるコードをユニットのinitializationにメモ帳からCtrl+XしてCtrl+Vするだけでハッピー!