project-navigation
Personal tools

Author Topic: Can not add new model of weapon  (Read 14929 times)

Offline Asarhadon

  • Rookie
  • ***
  • Posts: 12
    • View Profile
Can not add new model of weapon
« on: May 21, 2012, 07:11:58 pm »
I made a new weapon in the game with the standart weapon model just have slightly changed the settings (0ufos.pk3, weapons_human.ufo) and I can use it. But I can not add new 3D model for this weapon.
I used a script to export from the 3s max. But I have an error when loading the game. And I have no idea how to create this .mdx file (if it is the cause of errors).

I made a model, until no texture (i'm used just image for it)

Links:
http://ufoai.org/wiki/index.php/Modelling
http://ufoai.org/wiki/index.php/Modelling/3DSMax
« Last Edit: May 21, 2012, 07:15:27 pm by Asarhadon »

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Can not add new model of weapon
« Reply #1 on: May 21, 2012, 08:09:34 pm »
If you have an MDX file in the directory, try removing it. (Put it on desktop or something.) Not sure that will help but give it a shot. I believe the MDX is compiled from the MD2 at some stage, but I don't think it's necessary.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Can not add new model of weapon
« Reply #2 on: May 21, 2012, 08:12:53 pm »
yes - the mdx is not necessary - and you have to remove any existing mdx. the mdx data (if there is no mdx file) is auto calculated on model load.

it will only increase the loading times of your model if you don't have the mdx data cached in a file called yourmodel.mdx

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Can not add new model of weapon
« Reply #3 on: May 21, 2012, 08:14:46 pm »
it looks like your model has no skin assigned.

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Can not add new model of weapon
« Reply #4 on: May 21, 2012, 08:44:40 pm »
when you export your md2, there is a little area to add skins. If you want to use a skin file that has the name assault.png and is located in teh same folder as your model, you would enter:

.assault

The game then knows to look in the same folder for an image file named assault.

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Can not add new model of weapon
« Reply #5 on: May 21, 2012, 08:45:12 pm »
If you get it working, please feel free to extend the wiki with the information that was missing.

Offline Asarhadon

  • Rookie
  • ***
  • Posts: 12
    • View Profile
Re: Can not add new model of weapon
« Reply #6 on: May 22, 2012, 10:08:58 pm »
Thank you! It works.
Not quite sure about the wiki. My English is very bad.
When assault rifle appeared in the game, he does not fit in a box of equipment and its position is not where needed (screenshot). What do I need to edit the file weapons_human.ufo or other file?

(the texture is not ready yet so there is temporarily image)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Can not add new model of weapon
« Reply #7 on: May 22, 2012, 10:13:01 pm »
edit - nevermind, I was wrong!
« Last Edit: May 22, 2012, 10:23:45 pm by H-Hour »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Can not add new model of weapon
« Reply #8 on: May 22, 2012, 10:18:49 pm »
center and scale are the parameters of your item script entry that you have to tweak.

Offline Asarhadon

  • Rookie
  • ***
  • Posts: 12
    • View Profile
Re: Can not add new model of weapon
« Reply #9 on: May 23, 2012, 07:16:37 pm »
Thank you! I'll try

The texture is almost ready, but in the game it's too bright (screenshots). Is it necessary/possible to add lighting/specular texture for model?

The shot Fire is not where it mast be (pic 1,4). How can I change this?
« Last Edit: May 23, 2012, 07:34:53 pm by Asarhadon »

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Can not add new model of weapon
« Reply #10 on: May 23, 2012, 07:48:16 pm »
Check out this page for information on normalmaps, specularity maps, glowmaps, etc.

You can control where the muzzle flash occurs by adding a tag to your weapon model. Find more info here.

Offline Asarhadon

  • Rookie
  • ***
  • Posts: 12
    • View Profile
Re: Can not add new model of weapon
« Reply #11 on: May 24, 2012, 01:01:54 pm »
When I added the normal map (assault74_nm.png) or specular map (assault74_sm.png) , the effect did not exist. The normal map is not working
« Last Edit: May 24, 2012, 01:05:11 pm by Asarhadon »

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Can not add new model of weapon
« Reply #12 on: May 24, 2012, 02:09:29 pm »
You'll need to make sure your video settings in the game have all the special effects turned on. You'll need at least realtime lighting with at least 1 light, shader settings on high, stuff like that.

Offline Asarhadon

  • Rookie
  • ***
  • Posts: 12
    • View Profile
Re: Can not add new model of weapon
« Reply #13 on: May 24, 2012, 07:31:25 pm »
You'll need to make sure your video settings in the game have all the special effects turned on. You'll need at least realtime lighting with at least 1 light, shader settings on high, stuff like that.
I think that special effects turned on (scrin 1). But effect did not exist.
Any way, I decided to leave as it is. I added a little more color, so that weapon are not merged into a single gray spot. I am quite happy with the result of my work :). New weapon works fine and looking good. If anyone is interested I can put the result as a mod for the game. And thank you very much for your help!

PS: Of course, I'd love to see this weapon in new game version :) You can try it now. In archiv file you can find model of weapon and ammunition in .MD2 format with textures and configuration files for the game (weapons_human.ufo, researched_list.ufo, research.ufo).

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Can not add new model of weapon
« Reply #14 on: May 24, 2012, 08:20:42 pm »
I didn't see any normalmap in the zip file you attached. Are you sure you've got a _nm file in place?