« キャビネットに関する質疑応答の和訳 | メイン | ダイナマイトで破壊するオブジェクト »

April 15, 2005

■ MG42の作り方

翻訳元:http://www.splashdamage.com/forums/viewtopic.php?t=2658

製作サイドの人の発言を限定的に和訳。

ika注:
entityを作る際にくどく原点ブラシを含むようにといっているのは、ETには奇妙なバグと
いうか仕様のようなものがあり、原点が設定されていないと一連のスクリプトの処理がう
まくいかないそうです。ですので、騙されたと思って設定しておきましょう。
また、ここで紹介されているキーと値についてですが、これらの数値は自分が設置しよう
としているオブジェクトによって変わりうるので注意してください。

以下本文:

A. Radiantですること。

1. misc_gamemodelのEntityを作る(インポートしろということですな)。これが作業箱(工
事のときにペンチでつねる対象)になる。作ったら以下のキーを入力。

classname, misc_gamemodel
skin, models/mapobjects/cmarker/allied_crates.skin
model, models/mapobjects/cmarker/cmarker_crates.md3
targetname, construction_materials

2. 次に、箱のそばに立つどちらのチームが建設できるのかを表す旗となるEntityを作る。
それに、以下のキーを入力。

classname, misc_gamemodel
skin, models/mapobjects/cmarker/allied_cflag.skin
model, models/mapobjects/cmarker/cmarker_flag.md3
targetname, construction_materials
angle, 180 (Facing direction)
modescale, 0.4
spawnflags, 2 (Animated)
frames, 190 (Total frames)

3. 建設箱と旗などのセットを囲む、クリッピング(そのentityへの移動を制限)ブラシを
作る。作ったら、それらをscript_mover entityとする。その際に、原点ブラシを含むこ
とを忘れないように。全てのscript_mover entityは、それが使われるかどうかに関係な
くscriptnameのキーが必要である。

classname, script_mover
targetname, construction_materials
scriptname, construction_materials
spawnflags, 2 (This makes the script_mover solid)

4. 建設箱のまわりにTrigger_objective_infoのブラシを作る。これが実際にエンジニア
が作業を行なえる範囲となる。原点ブラシをを含むことを忘れずに。

classname, trigger_objective_info
targetname, construction_toi
scriptname, construction_toi
target, construction_target (Points to the func_constructible)
shortname, Construction MG (Command map name)
track, the Construction MG
spawnflags, 1 (This is constructible by Allied)

MG42 Entityを望む場所に作る。

classname, misc_mg42
targetname, construction_mg42 (Needs to be different because of the repairmg42 c
ommand)
track, construction_track (This links all the extra stuff together)
accuracy, 0.5
angle, 90

6. MG42を囲むように、2つの土嚢モデルを作る。

classname, misc_gamemodel
targetname, construction_extra
track, construction_track (This links all the extra stuff together)
model, models/mapobjects/miltary_trim/sandbag1_45s.md3
angle, 215

classname, misc_gamemodel
targetname, construction_extra
track, construction_track (This links all the extra stuff together)
model, models/mapobjects/miltary_trim/sandbag1_45s.md3
angle, 135

7. 最後に、func_constructible Entityを作る。これは大抵土嚢やMG42の前あたりに作り、
プレイヤーをクリッピングするのに使う。原点ブラシも作るのを忘れずに。

classname, func_constructible
targetname, construction_target
track, construction_track (This links all the extra stuff together)
scriptname, construction_script (The main script routine)
spawnflags, 8 (Allied construction)

概要:

func_constructble、土嚢、MG42は同じtrack keyを持つため、建設スクリプトの処理の際
にこれらが一つのものとして認識されて、建設完了の際には一度に出現し、破壊の際には
一度に消える。

MG42 Entityは違うtargetnameが必要になる。というのも、MG42を修理するコマンドには、
そのEntityを直接指定しなければならないからだ。このコマンドがないと、MG42は壊れな
くなる。

建設箱、旗、script_moverクリッピングブラシは、すべて同じtargetnameであるconstruc
tion_materialsとなっている。これにより、スクリプトは対象がconstruction_materials
とされた時には、これら全てを参照することになる。

最後に、Trigger_objective_info Entityはfunc_constructibleにリンクされる。

スクリプト:

Code:
construction_script
{
spawn
{
wait 200
constructible_class 2
trigger self startup
}

buildstart final
{
}

built final
{
setstate construction_extra default
setstate construction_mg42 default
setstate construction_materials invisible

// Some kind of UI pop-up to alert players
wm_announce "Allied team has built the construction!"
}

decayed final
{
trigger self startup
}

death
{
trigger self startup
// Some kind of UI pop-up to alert players
wm_announce "Axis team has destroyed the construction!"
}

trigger startup
{
setstate construction_extra invisible
setstate construction_mg42 invisible
setstate construction_materials default
repairmg42 construction_mg42
}
}


The code is an alternative way again of creating single staged constructions but
instead of duplicating the same commands over and over again in each of the dif
ferent functions. I use a single trigger function at the bottom of the routine w
hich does the same stuff.

(!訳不明瞭:このコードは、異なるファンクションごとに何度も何度も同じコマンドを
せずに一段階建造物の建造/破壊を行なうものです。私(製作者)は同じようなシングルト
リガファンクションをルーチンの下に置いています。)

投稿者 ikanatto : April 15, 2005 06:45 PM