Weapon model creation (HUD)
From Mod Wiki
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.
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.
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.
After finishing the bone attaching, save it to file in Physique root settings with Save to *.phy button - it'll be useful in future.
Now, we can begin to work with the animation.
4. HUD-model animation
You can use Set Key mode and Auto Key mode, but the second is more useful.
Press the Auto Key button, choose the bone (to make animation process easier, just press the Context menu (RMB) –> Freeze selected in one of the viewports), fix it with pressing the key, and move the animation scroller to another position - trajectory and key frames will be created automatically.
After the model export (without animation), choose our animation and, in the Stalker Export utility, select Export Motion. Animation will be converted to *.skl format.
- If the game CTD with cannot find anim [...]_r log or something else, just create copies of all your animations with _r endings.
5. Model configuration in Actor Editor
Открываем Actor Editor. Настраиваем параметры в свитке Surface. Я ставил такие:
- models\weapons
- def_shader\def_vertex
- game mtl\objects\small_weapon
В принципе, можно попробовать и другие.
Далее, настроим кости в свитке Bones. В параметрах свитка выделяем все кости, ставим Type -> XXXX, нет никакой разницы, а также Game mtl\objects\small_weapon, и нажимаем Generate shape -> All
Также чтобы анимации не "заедались" во время игры надо поставить галки напротив пунктов Stop at End и Sync Part.
После этого - настройка анимации. Открываем свиток Motions, нажимаем кнопку Append, выделяем все наши *.skl – анимации и вставляем в модель. Редактируем в параметрах скорость, плавность и проигрывание анимации. В оружии типа MP5 есть семь стандартных анимаций:
- idle
- idle_aim
- idle_sprint
- shoot
- draw
- holster
- reload
Берем с главной кости координаты и градус поворота худа, и вписываем их в конфиг.
В разделе конфига 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