sharo-jefの雑記帳

インフラエンジニアの雑記帳

【Microsoft Flight Simulator】機体アドオンのサスペンション設定を変更する方法

あまり情報が出てこなかったので、 Microsoft Flight Simulator の機体アドオンのサスペンション(?)設定を変更する方法の備忘録を残す。

デフォルト機体を含め、サスペンションがやたら硬かったりするやつを改善できる(はず)。

各アドオンの SimObjects/AirPlanes/<対象の機体>/flight_model.cfg を編集する。

編集するのは以下の部分。

[CONTACT_POINTS]
;0 Type of contact point - 1 = wheel, 2 = scrape point, 3 = skid, 4 = float, 5 = water rudder, 16 = ski, 17 = propeller
;1 Longitudinal position z relative to Datum Reference Point, in ft.
;2 Lateral position x relative to Datum Reference Point, in ft.
;3 Vertical position y relative to Datum Reference Point, in ft.
;4 Impact damage threshold crash velocity, in ft per minute.
;5 The brake type the wheel contact uses. - 1 = brake on left gear, 2 = brake on right gear, 3 = brake on both gears
;6 The wheel radius (including tire), in ft.
;7 Wheel max steering angle, in degrees, between -90 and 90.
;8 The static compression coefficient constant (which is used to compute spring reaction when on the ground), in ft. If the contact point is rigid, then set this to 0.
;9 The maximum static compression ratio.
;10 The damping ratio constant (used to compute ground reaction damping). A value between 0.0 (un-damped) and 1.0 (critically damped)
;11 Extension time, in seconds. This is the time required to fully extend wheels/water rudder/skis/floats.
;12 Retraction time, in seconds. This is the time required to fully retract wheels/water rudder/skis/floats.
;13 Identifies the type of sound that is going to be played for the contact point. 0 = Center Gear, 1 = Auxiliary Gear, 2 = Left Gear, 3 = Right Gear, 4 = Fuselage Scrape, 5 = Left Wing Scrape, 6 = Right Wing Scrape, 7 = Aux1 Scrape, 8 = Aux2 Scrape, 9 = Tail Scrape
;14 The airspeed limit for gears retraction, in kias.
;15 Airspeed above which gear is damaged, in kias.
;16 The exponential constant for springs
;         0       1    2      3      4   5        6    7          8      9   10 11   12 13   14 15 16
point.0 = 1,  27.44,   0, -9.55,   800,  0,    1.25,  95,  0.960516, 1.613, 0.6, 8, 7.5, 0, 485, 0, 5
point.1 = 1, -14.03, -14, -9.83,  1200,  1,  1.9167,   0,     1.121, 1.177, 0.3, 9, 8.5, 2, 485, 0, 5
point.2 = 1, -14.03,  14, -9.83,  1200,  2,  1.9167,   0,     1.121, 1.177, 0.3, 9, 8.5, 3, 485, 0, 5

各数値の役割は、コメントアウトに記載されている通り。 (A32NXflight_model.cfg から抜粋)

8~12 をいい感じに変更すると、挙動が変わる模様。

試しに PMDGB737 の設定をデフォルトの A320 に入れたところ動きが柔らかくなったような気がする。(ちゃんと検証してないので気がするだけかも)

Minecraft で Symbolic Link を使う

なかなか正しい設定を見つけられなかったのでメモ。

  1. 各プロファイルのルートフォルダallowed_symlinks.txt を作成
    • プロファイル毎にフォルダを変えている場合は .minecraftallowed_symlinks.txt を作成しても読まれない
    • CRLF, LF のどちらでも良さそう
    • マルチバイト文字が含まれていないパターンしか試していないが、 UTF-8 でも Shift_JIS でも読み込まれた
  2. allowed_symlinks.txt に設定を記入
    • 文法違反の行が含まれる場合は読み込まれない模様
    • (現時点では [glob] でフォルダを許可する方法がわかっていない)

以下に allowed_symlinks.txt の記入例を記載しておく。(Windows)

# Allow all file
[regex].*
# Prefix example
[prefix]C:
[prefix]C:\

# Invalid
[prefix]C:/
# Glob example
[glob]C:\hoge*

Monster Siren OST の非公式 CLI ツールを作ってみた

アークナイツの OST が公開されていることに気がついたので、 CLI ツールを作ってみた。

monster-siren.hypergryph.com

www.npmjs.com

とりあえずぱっと思いついた以下の機能を実装してある。

  • Album
    • 一覧表示
    • 詳細取得
    • ダウンロード
  • Song
    • 一覧表示
    • 詳細表示
    • ダウンロード

Node.js で書いたので npm から落とせる。

npm i -g monster-siren-cli
monster-siren album list

とかやるとアルバムの一覧が表示されるはず。(バグってたら Issue 上げてね)

github.com

【Minecraft】プレイヤーが所持しているアイテムの情報を更新する方法

Minecraftdata コマンドではプレイヤーの情報を更新できないので、他の手段でプレイヤーが所持しているアイテムの情報を更新してみる。

大まかな流れは以下の通り。

  1. アイテムの NBT タグ情報を storage にコピー
  2. シュルカーボックス内に何かしらのアイテムを入れる
  3. シュルカーボックス内のアイテムの情報を書き換える
  4. 書き換えたアイテムを元のスロット(プレイヤーのインベントリ)に戻す

シュルカーボックスからアイテムを戻すために loot_table を上書きする必要があるので注意。

アイテムの NBT タグ情報を storage にコピー

# メインハンドのアイテムの場合
data modify storage foo:bar Item set from entity @s SelectedItem
# それ以外のアイテムの場合 (Slot にはスロット ID を入れる)
data modify storage foo:bar Item set from entity @s Inventory[{Slot:-106b}]

# Slot 情報を消す
data remove storage foo:bar Item.Slot

この例では foo:bar の Item にアイテム情報を保存している。

主要なスロット ID は以下のとおり。

スロット スロット ID
オフハンド -106b
ヘルメット 103b
チェストプレート 102b
レギンス 101b
ブーツ 100b

シュルカーボックスにアイテムを格納

アイテム情報を編集するためにシュルカーボックスにアイテムを入れる。 配布マップであれば遠くに置けば良いが、その他の用途ではどこにブロックを置くか考える必要があるかも。 今回の解説では 0 0 0 に配置する。

インベントリを持つブロックであれば、シュルカーボックス以外でもできるかもしれない。

# 既に置いてあるシュルカーボックスを使う場合は setblock で置く必要は無い
setblock 0 0 0 minecraft:shulker_box

# container.0 に何かしらのアイテムを入れる
loot replace block 0 0 0 container.0 loot blocks/stone
# container.0 に入っているアイテムの情報を書き換える(id ごと書き換えるので元のアイテムは何でも良いと思われる)
data modify block 0 0 0 Items[0] merge from storage foo:bar Item

# シュルカーボックスを消す場合は以下を実行
setblock 0 0 0 minecraft:air

シュルカーボックス内のアイテムをプレイヤーのインベントリに戻す

loot replace entity @s weapon.mainhand 1 mine 0 0 0 minecraft:debug_stick

戻すスロットを変更したい場合は weapon.mainhand の部分を変更する。 主要なスロットは以下のとおり。

スロット スロット名
オフハンド weapon.offhand
ヘルメット armor.head
チェストプレート armor.chest
レギンス armor.legs
ブーツ armor.feet

上記のコマンドでアイテムを戻すためには、下記のようにシュルカーボックスの loot_table を変更しておく必要がある。 これを設定していない場合はアイテムが入ったシュルカーボックスが戻ってくる。 以下の設定の場合は 0 0 0 に配置されたもの以外には影響しない。

{
    "type": "minecraft:block",
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "minecraft:dynamic",
                    "name": "minecraft:contents",
                    "conditions": [
                        {
                            "condition": "minecraft:location_check",
                            "predicate": {
                                "block": {
                                    "nbt": "{\"x\":0,\"y\":0,\"z\":0}"
                                }
                            }
                        }
                    ]
                }
            ]
        },
        {
            "bonus_rolls": 0.0,
            "entries": [
                {
                    "type": "minecraft:item",
                    "functions": [
                        {
                            "function": "minecraft:copy_name",
                            "source": "block_entity"
                        },
                        {
                            "function": "minecraft:copy_nbt",
                            "ops": [
                                {
                                    "op": "replace",
                                    "source": "Lock",
                                    "target": "BlockEntityTag.Lock"
                                },
                                {
                                    "op": "replace",
                                    "source": "LootTable",
                                    "target": "BlockEntityTag.LootTable"
                                },
                                {
                                    "op": "replace",
                                    "source": "LootTableSeed",
                                    "target": "BlockEntityTag.LootTableSeed"
                                }
                            ],
                            "source": "block_entity"
                        },
                        {
                            "type": "minecraft:shulker_box",
                            "entries": [
                                {
                                    "type": "minecraft:dynamic",
                                    "name": "minecraft:contents"
                                }
                            ],
                            "function": "minecraft:set_contents"
                        }
                    ],
                    "name": "minecraft:shulker_box"
                }
            ],
            "rolls": 1.0
        }
    ]
}

0 0 0 以外に shulker_box を置く場合等、条件を変える場合は以下の部分を書き換える必要がある。

                    "conditions": [
                        {
                            "condition": "minecraft:location_check",
                            "predicate": {
                                "block": {
                                    "nbt": "{\"x\":0,\"y\":0,\"z\":0}"
                                }
                            }
                        }
                    ]

【ウマ娘】育成論テンプレート作成中

ウマ娘の育成論を共有するためのスプレッドシート用テンプレートを作成中なので進捗を公開します。

育成論テンプレート (基本情報)
育成論テンプレート (育成フロー)

2023-09-04 追記 ウマ娘熱がどこへやらっす

【Minecraft】Sharo Utilities

以前より利用している複数のModが更新されていないので、Minecraft JE 1.16.4向けに便利Modとして作成しました。

アイテム

Sharo Ingot

f:id:sharo-jef:20201212143319p:plain
Sharo Ingot

f:id:sharo-jef:20201212143606p:plain
Recipe - Sharo Ingot

中間アイテム

Sharo Ring

f:id:sharo-jef:20201212143445p:plain
Sharo Ring

f:id:sharo-jef:20201212143705p:plain
Recipe - Sharo Ring

クリエ飛行用リング

Sharo Manju

f:id:sharo-jef:20201212143833p:plain
Sharo Manju

f:id:sharo-jef:20201212143911p:plain
Recipe - Sharo Manju

腹持ちのいい飯

ブロック

Sharo Earth

f:id:sharo-jef:20201212144123p:plain
Sharo Earth

f:id:sharo-jef:20201212144201p:plain
Recipe - Sharo Earth

明るさに関わらずMobがスポーンする草ブロックを追加 (回収不可, 上にブロックを置くと土に戻る)

Elevator

f:id:sharo-jef:20201212145948p:plain
Elevator

f:id:sharo-jef:20201212150850p:plain
Recipe - Elevator

elevator

垂直方向に移動できるエレベータ

ダウンロード

github.com

バグ報告

github.com