Weapon model creation (HUD)

From Mod Wiki

Revision as of 12:03, 7 March 2008 by Bac9-flcl (Talk | contribs)
Jump to: navigation, search

Contents

HUD model creation

1. Introduction

This tutorial is about weapon HUD-model creation. We do not recommend it to unexperienced users of 3DSMax, so don't ask something like "how to create sphere?". That's what we'll get in the final (3DSMax):


Before this tutorial, I recommend to read Model export tutorial.

If you want to work with the game model, I recommend ogf2smd plug-in for import, because the same function in OGFViewer function creates 11 polygons on the each coordinate, making almost impossible to use the model.

2. Materials

Let's open the 3DSMax. Import the model, open the matetial editor (М button by default). Clink on the Standart button, choose STALKER Mtl.


Image:Hud lesson 2.jpg

Clink on the little button near the Diffuse function, choose Bitmap, and select your texture. Now, assign it to the model. That's all, we've finished with the texturing.

3. Bones creation

It's better to use Bone Tools utility, situated in Character menu.

You can see, now the bones are placed in the HUD-model, in the attached file below. But the main thing is to crate the main, central bone, from which the hand and weapon skeletons will be built. Bones are created in Create -> Systems -> Bones.

4. Skeleton attaching

After the bone placing, use Physique modifier, press Attach to node –> Rigid\Deformable –> Initialize button. Now, the skeleton is ready for attaching.

  • Important note: in every weapon model, must exist wpn_body bone. Without it - the game will crash.

Image:Hud lesson 3.jpg

Turn on the Vertex modе, and, during Select button pressing (do not forget to mark the blue "plus" symbol) choose the vertexes, then press Attach to link. Next, mark the red "plus" symbol (or red, if the object is solid), then click on the bone and choose Lock Assignment. Repeat this with all bones.


Image:Hud lesson 4.jpg

After finishing the bone attaching, save it to file in Physique root settings with Save to *.phy button - it'll be useful in future.


Image:Hud lesson 5.jpg

Now, we can begin to work with the animation.

4. HUD-model animation

Анимировать можно в режиме Set Key, и в режиме Auto Key, но в данном случае удобнее будет все-таки во втором режиме.

Нажимаем кнопку Auto Key, выбираем именно кость (для удобства анимации можно выполнить команду ПКМ –> Freeze selected в любом видовом окне), фиксируем ее положение нажатием ключа, переводим ползунок кадров в любое положение - траектория движения и ключи в промежутке кадров просчитаются автоматически.



После того, как мы экспортировали модель без анимации, выбираем нашу анимацию и в утилите Stalker Export выбираем Export Motion, после чего экспортим анимацию формат *.skl

  • Если игра вылетает с логом "cannot find anim [название_аним-и]_r" или с чем-то подобным, то создавайте копии существующих анимаций с окончанием _r и добавляйте их вместе с обычными.


Image:Hud lesson 7.jpg

5. Model configuration in Actor Editor

Открываем Actor Editor. Настраиваем параметры в свитке Surface. Я ставил такие:

  • models\weapons
  • def_shader\def_vertex
  • game mtl\objects\small_weapon


Image:Hud lesson 8.jpg

В принципе, можно попробовать и другие.

Далее, настроим кости в свитке Bones. В параметрах свитка выделяем все кости, ставим Type -> XXXX, нет никакой разницы, а также Game mtl\objects\small_weapon, и нажимаем Generate shape -> All

Также чтобы анимации не "заедались" во время игры надо поставить галки напротив пунктов Stop at End и Sync Part.


Image:Hud lesson 9.jpg

После этого - настройка анимации. Открываем свиток Motions, нажимаем кнопку Append, выделяем все наши *.skl – анимации и вставляем в модель. Редактируем в параметрах скорость, плавность и проигрывание анимации. В оружии типа MP5 есть семь стандартных анимаций:

  • idle
  • idle_aim
  • idle_sprint
  • shoot
  • draw
  • holster
  • reload


Image:Hud lesson 10.jpg

Берем с главной кости координаты и градус поворота худа, и вписываем их в конфиг.

В разделе конфига wpn_..._hud редактируются также параметры точки вылета гильзы из оружия, а также партикла выстрела. Чтобы облегчить себе работу с этими параметрами, можно создать в 3DSMax вспомогательные кости и сразу получить их координаты при настройке HUD'а в Actor Editor. Если в логе при импорте или экспорте вашего творения есть какие-то ошибки – значит, вы что-то сделали не так.

Рекомендую сразу не хвататься за сложный HUD, а просто сделать анимированное штурмового–наступательное оружие под названием "Кубик". Удачи!

6. Source files

You can download them there.

Authors

Article was created by: Egorych
Thanks to: Haron, tambovski, Alwen
Translated by: Bac9-flcl

Personal tools