UFO:Alien Invasion

General => User modifications => Topic started by: Asarhadon on May 21, 2012, 07:11:58 pm

Title: Can not add new model of weapon
Post by: Asarhadon 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
Title: Re: Can not add new model of weapon
Post by: H-Hour 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.
Title: Re: Can not add new model of weapon
Post by: Mattn 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
Title: Re: Can not add new model of weapon
Post by: Mattn on May 21, 2012, 08:14:46 pm
it looks like your model has no skin assigned.
Title: Re: Can not add new model of weapon
Post by: H-Hour 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.
Title: Re: Can not add new model of weapon
Post by: H-Hour 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.
Title: Re: Can not add new model of weapon
Post by: Asarhadon 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)
Title: Re: Can not add new model of weapon
Post by: H-Hour on May 22, 2012, 10:13:01 pm
edit - nevermind, I was wrong!
Title: Re: Can not add new model of weapon
Post by: Mattn on May 22, 2012, 10:18:49 pm
center and scale are the parameters of your item script entry that you have to tweak.
Title: Re: Can not add new model of weapon
Post by: Asarhadon 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?
Title: Re: Can not add new model of weapon
Post by: H-Hour on May 23, 2012, 07:48:16 pm
Check out this page (http://ufoai.org/wiki/index.php/Artwork) 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 (http://ufoai.org/wiki/index.php/Modelling/Tags).
Title: Re: Can not add new model of weapon
Post by: Asarhadon 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
Title: Re: Can not add new model of weapon
Post by: H-Hour 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.
Title: Re: Can not add new model of weapon
Post by: Asarhadon 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).
Title: Re: Can not add new model of weapon
Post by: H-Hour 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?
Title: Re: Can not add new model of weapon
Post by: Asarhadon on May 24, 2012, 08:35:49 pm
I didn't see any normalmap in the zip file you attached. Are you sure you've got a _nm file in place?
Yes Im sure :)
I decided to remove the file because I did not see the effect of normal map. There is not NM in archive. But I even tried to add normal map from another model (if my normal was wrong), but still the effect is not seen. :(
Title: Re: Can not add new model of weapon
Post by: DarkRain on May 24, 2012, 08:45:20 pm
Hmm..., looking at your settings, doesn't the Intel Graphic Hardware Hack cause the shaders be forcibly disabled if you have it activated? (and enables Texture Compression IIRC) you should try disabling it.
Title: Re: Can not add new model of weapon
Post by: Asarhadon on May 25, 2012, 05:42:24 pm
Hmm..., looking at your settings, doesn't the Intel Graphic Hardware Hack cause the shaders be forcibly disabled if you have it activated? (and enables Texture Compression IIRC) you should try disabling it.
I disabled Intel Graphic Hardware Hack, but i didnt see normal map.
Is it need to add normal map in skins when export in md2 format (like difuse map .assault and .assault_nm)? or im jast need to copy NM in directory?

PS: and you did not say anything about my model, bad / normal model or you can/cann't add it in the game.

________________________
Animation:
Can be weapon animated? if yes, how to add weapon anim in the game?

character Animation:
Is the animation sequences need to be separated only in .anm file format or in 3dsMAx to (im asking coz i didnt know how to do this in MAX)? (for example in .anm file we have sequence: dead1   30 60 18)
Can I create .anim file in any TXT program?
Title: Re: Can not add new model of weapon
Post by: kurja on May 25, 2012, 06:25:07 pm
if armed civilians/army forces at some point get added to the game, gun models like this would be good for them?
Title: Re: Can not add new model of weapon
Post by: H-Hour on May 25, 2012, 11:24:47 pm
Is it need to add normal map in skins when export in md2 format (like difuse map .assault and .assault_nm)? or im jast need to copy NM in directory?

If you have a file with *_nm.png, it should appear. I haven't worked a lot with model normalmaps so I can't say for sure that they are working. But as far as I know they should be. A lot of our maps have flat lighting. Try standing near a light on a night-time map to see it best.

PS: and you did not say anything about my model, bad / normal model or you can/cann't add it in the game.

The model looks nice. What's the poly count? I haven't had a chance to look at it in an editor. Our game starts in 2084 and we prefer future-tech rifles, so we won't be including it in the game. You can always create and release an expanded armoury mod to allow players more weapon choices. I think a lot of players would like that. Talk to Trashman about it. He's made lots of rifles that I've been trying to get him to release in a mod (a strong mod community is a good thing).

Animation:
Can be weapon animated? if yes, how to add weapon anim in the game?

Not that I know of.

character Animation:
Is the animation sequences need to be separated only in .anm file format or in 3dsMAx to (im asking coz i didnt know how to do this in MAX)? (for example in .anm file we have sequence: dead1   30 60 18)
Can I create .anim file in any TXT program?

You can create the .anm file in any basic text editor. Are you working on a character, by any chance? or just hopeing to animate the gun?
Title: Re: Can not add new model of weapon
Post by: kurja on May 26, 2012, 12:02:12 am
Our game starts in 2084 and we prefer future-tech rifles, so we won't be including it in the game.

Have there been actual plans to add "armed 3rd parties", or has it been just suggestions/discussion?
Title: Re: Can not add new model of weapon
Post by: H-Hour on May 26, 2012, 12:17:14 am
*spoiler* There are plans to have humans attack Phalanx. (http://ufoai.org/wiki/index.php/Translation:Enemy_on_earth_txt/en)

I don't know of any definite plans to have civilians or a third-party armed and fighting aliens on the battlescape.
Title: Re: Can not add new model of weapon
Post by: kurja on May 26, 2012, 12:27:58 am
well, just thought that it might be kewl if these "other humans" could use different, perhaps more old-fashioned weapons.

edit - not the humans you linked to though if they're going to have alien weapons =)
Title: Re: Can not add new model of weapon
Post by: H-Hour on May 26, 2012, 12:55:03 am
It wouldn't surprise me at all if the AK weapons were still banging around in 2084. Extraordinary gun that has featured in almost every small war in the last 50 years.
Title: Re: Can not add new model of weapon
Post by: kurja on May 26, 2012, 01:07:02 am
with the vast numbers they were (and still are?) made, with all the clones and spinoffs, I would be surprised if some AK's weren't still in use after another 60 years.
Title: Re: Can not add new model of weapon
Post by: Asarhadon on May 26, 2012, 01:57:35 pm
A lot of our maps have flat lighting. Try standing near a light on a night-time map to see it best.
On map or night-time map model is too small to see anything. I think that normal maps need to be use only in the interface of the base/ingame-Wiki where the weapons represented more detailed. But I'll try

The model looks nice. What's the poly count?
Thanks :).  383 tris (polys) in this model

You can always create and release an expanded armoury mod to allow players more weapon choices. I think a lot of players would like that. Talk to Trashman about it. He's made lots of rifles that I've been trying to get him to release in a mod (a strong mod community is a good thing).
It's a good idea.

Are you working on a character, by any chance? or just hopeing to animate the gun?
Yes. I'm going to create the character (I can not promise that :( ). But I don`t know what files to edit to add character to the game. Can you tell me what files to edit?
And of course, I would like to create animation for the weapons too. it can be just barrel off at least.

It wouldn't surprise me at all if the AK weapons were still banging around in 2084. Extraordinary gun that has featured in almost every small war in the last 50 years.
with the vast numbers they were (and still are?) made, with all the clones and spinoffs, I would be surprised if some AK's weren't still in use after another 60 years.
I think so :)
Title: Re: Can not add new model of weapon
Post by: H-Hour on May 26, 2012, 02:23:50 pm
On map or night-time map model is too small to see anything. I think that normal maps need to be use only in the interface of the base/ingame-Wiki where the weapons represented more detailed. But I'll try

Our UI does not support normalmaps (or specularity) for models. It doesn't use the same renderer as the battlescape.


383 tris (polys) in this model
That's a good count.

Yes. I'm going to create the character (I can not promise that :( ). But I don`t know what files to edit to add character to the game. Can you tell me what files to edit?

It depends on what kind of character you want to create: alien, soldier, civilian? You'll need to add the model and animation to the appropriate folder under /base/models/. Then you'll want to edit the appropriate /base/ufos/team_*.ufo file. A single entry in the Africa civilian team in team_civilians.ufo looks like this:

Code: [Select]
civilians/male body02 head02 0 0 //body:arabic looking, head: beard, white hat
THat would be:

Code: [Select]
path/from/base/models/to/your/model body_model_name head_model_name body_skin head_skin