返信: スクリプト公開スレ

#2839
Stealer
メンバー

それについてですが、解決法が無くはないものの、非常に難しいです。
まず、open doorアクションを消去することは不可能です。
おそらくremoveactionのようなアクションを取り除く感覚を想像していると思いますが、まずremoveactionはデフォルトのアクションを取り除けません。
removeAction

なので連続して閉め続けるアクションをするスクリプトがあれば解決できるのですが、ここで問題があります。
ArmAの建物関連のアクション、とりわけBIS謹製の物に関しては、非常に融通が利かず、最もコントロールの面倒くさいものの一つになっています。
というのも建物に付いているドアの一つ一つがアクションの名前が異なり、しかも例えば閉める動作が1、開く動作が0のものもあれば、その逆もあるのです。

以下はchernarusとutesのドア全てをミッション開始時に開くスクリプトについてのポストですが、それでも空港や倉庫や一部のドアはカバーされていません。OAやアドオンの建物を含めると、そのアクションの名前自体の調査が煩雑であることも含め、”汎用性のあるドアを閉めるスクリプト”にどれだけの手間が掛かるか分からないのが現状です…

Huh,
I see, this is an old one. So what, I’m gonna reply anyway.
Closing doors, well, that’s not an easy one, thanks to BIS. I mean, basically, all you need is this:
Code:
_houses = [1000,1000] nearobjects [“house”, 1000000];
{
_x animate [“door”, 0];
sleep 0.0001;
} foreach _houses;
Or so you think! Problem: BIS forgot to use a standard or nomenclature for their buildings. So, some doors are named “door”, some are named “dvere”, then we have “door01” or “door_01” and so on. It’s a mess!
And it gets even worse! On ArmA 2 buildings, the parameter to close a door is 0, while on OA buildings, the parameter is 1! Dear BIS, how can you possibly confuse 0s and 1s?!?
Whatever! So, after a long period of trying, this came out:

Code:

_houses = [1000,1000] nearObjects [“house”, 1000000];
_zeroes = [“dvere”,”dvere1l”,”dvere1r”,”dvere2l”,”dvere2r”,”dvere_spodni_r”,”dvere_spodni_l”,”dvere_vrchni”,”vrata1″,”vrata2″,”vratal1″,”vratar1″,”vratal2″,”vratar2″,”vratal3″,”vratar3″];
_ones = [“door”,”door_1_1″,”door_1_2″,”door_2_1″,”door_2_2″,”dvere1″,”dvere2″,”dvere3″,”dvere4″,”dvere5″,”dvere6″,”dvere7″,”dvere8″,”dvere9″,”dvere10″,”dvere11″,”dvere12″,”dvere13″,”dvere14″,”doorl”,”doorr”,”door_01″,”door01_a”,”door_02″,”door02_a”,”door_03″,”door_04″,”door_05″,”door_06″,”door_1a”,”door_1″,”door_2″];
{
_y = _x;
{_y animate [format [“%1”, _x], 0]} foreach _zeroes;
{_y animate [format [“%1”, _x], 1]} foreach _ones;
sleep 0.0001;
} foreach _houses;

As far as I know, it works on most buildings. No, wait, I think forgot about the LHD. Ach, not that important, eh? If there’s more missing, or not working at all, just let me know.
Good day,
mr_book

EDIT: I just found out that above script doesn’t work on both Utes and Chernarus. A (rather unsatisfying) workaround is:

Code:

{
_y = _x;
{_y animate [format [“%1″, _x], 0]} foreach _zeroes;
if ((worldname==”Utes”) or (worldname==”Chernarus”)) then
{
{_y animate [format [“%1”, _x], 0]} foreach _ones;
} else
{
{_y animate [format [“%1”, _x], 1]} foreach _ones;
};
sleep 0.0001;
} foreach _houses;

It does work now, although it looks really messed up. Take it or leave it, the choice is yours.