Development > Artwork
New weapons - SOLVED
Latino210:
Hello!
I am trying my hand at modding weapons. I've just built a model for a new rifle (I need it for my mod), but I cannot make it work. I've built the .md2 and extracted a .jpg, but I do not know how to apply a little light spot, how to tell the engine from where the bullet will come off and, more important, how to put it ingame. Any help will be appreciated.
H-Hour:
You're going to need tags, which are small triangles put onto models to tell it where to attach various other items. For weapons, you only need a tag_muzzle. The character models have tags which tell it how to equip your weapon.
Latino210:
--- Quote from: H-Hour on November 23, 2012, 05:38:18 pm ---You're going to need tags, which are small triangles put onto models to tell it where to attach various other items. For weapons, you only need a tag_muzzle. The character models have tags which tell it how to equip your weapon.
--- End quote ---
OK, got it thanks, I have created a new tag, named it tag_muzzle and exported the .tag file with the script. Now, if you could explain me how to implement the new rifle? I can copy the assault rifle entry in the weapons_human.ufo file, changing the path for the model and the name of the weapons, but I do not know how to add this as an usable weapon. Should I add a dummy tech in the research.ufo and a ufopaedia entry?
EDIT: I managed to put the files in the SMG dir, it's enough to test the graphics. As you can see for yourself, I still have some problems with the skinning. I unwrapped the UVmap, packed it and rendered the UV template (all in 3ds max, of course) but the result is not what I wanted. Can anyone help with the UVmapping?
My idea is a rifle cobbled together by a bunch of engineers with access to a CNC lathe and a lot of desperation. It's the kind of weapon I could build if my factory was attacked by aliens.
DarkRain:
Every item (including ammo) needs a tech, so, yes, you need to add a new tech entry (but you can create new ufo files for your new tech/items/wathever if you want), you might want to look at the assault rifle techs as an example, maybe you also want to take a look at researched_list.ufo
An ufopaedia entry isn't strictly needed, (but would be cool, wouldn't it?) you can write a short description if you like.
Latino210:
Sorry, I am having some problems. I've created a new dir called "scraprifle" in the models/weapons dir, with the md2 and jpg for the new rifle. I 've added this code to the weapons_human.ufo file:
--- Code: ---// SCRAPRIFLE
item scraprifle
{
name "_Scraprifle"
model "weapons/scraprifle/scraprifle"
weapon true
type "rifle"
animationindex 1
holdtwohanded false
firetwohanded true
shape "0 0 2 2"
center "2 0 1"
scale 1.35
ammo 12
reload 6
reloadsound "weapons/reload-pistol"
price 900
size 7
is_secondary false
}
item scraprifle_ammo
{
name "_Scraprifle Ammo"
model "weapons/scraprifle/scraprifle_clip"
type "ammo"
animationindex 0
shape "0 0 1 1"
center "0 0 -0.2"
scale 1.5
price 20
size 1
is_secondary false
dmgtype "normal"
weapon_mod
{
weapon scraprifle
firedef
{
name "_Snap Shot"
skill "close"
projtl bullet-smg
impact bulletImpact
hitbody null
firesnd "weapons/bullet-pistol"
impsnd "impact/bullet-impact"
bodysnd "impact/bullet-bodyimpact"
speed 3000
spread "2 2"
crouch 1
range 40
shots 1
ammo 1
time 4
damage "30 5"
dmgweight "normal_light"
reaction true
}
firedef
{
name "_Aimed Shot"
skill "close"
projtl bullet-smg
impact bulletImpact
hitbody null
firesnd "weapons/bullet-pistol"
impsnd "impact/bullet-impact"
bodysnd "impact/bullet-bodyimpact"
speed 3000
spread "1.5 1.5"
crouch 1
range 40
shots 1
ammo 1
delaybetweenshots 10
time 8
damage "30 5"
dmgweight "normal_light"
}
}
}
--- End code ---
(copied from the pistol code)
Then I've added this code to the researched_list.ufo
--- Code: ---rs_weapon_scraprifle
rs_weapon_scraprifle_ammo
--- End code ---
and this code to the research.ufo
--- Code: ---tech rs_weapon_scraprifle
{
type "weapon"
up_chapter equipment
description {
default "*msgid:pistol_txt"
}
// pre_description "*msgid:pistol_pre_txt"
provides scraprifle
time 0
producetime 40
}
tech rs_weapon_scraprifle_ammo
{
type "weapon"
up_chapter equipment
description {
default "*msgid:pistol_mag_txt"
}
// pre_description "*msgid:pistol_mag_pre_txt"
provides scraprifle_ammo
time 0
producetime 12
}
--- End code ---
copied from pistol, again.
But when I start a new campaign the scraprifle is nowhere to be seen. What am I doing wrong?
Navigation
[0] Message Index
[#] Next page
Go to full version