General > User modifications

Trying To Make New Weapon Fire-modes And Failing Epicly At It.

(1/2) > >>

DiDiT:
I'v been trying to add a new 'charged fire' mode to the laser weapons, but i cant seem to do it. It never shows up in game.
Here's my code:


--- Code: ---// =======================
// LASER PISTOL
// =======================
item laserpistol
{
name "_Laser Pistol"
model weapons/laserpistol/laserpistol
weapon true
type pistol
animationindex 2
holdtwohanded false
firetwohanded false
shape "0 0 3 2"
center "2.5 0 1.2"
scale 1.7
ammo 26
reload 12
price 2000
size 10
is_secondary true
}

// =======================
// LASER RIFLE
// =======================
item laserrifle
{
name "_Laser Rifle"
model weapons/laserrifle/laserrifle
weapon true
type rifle
animationindex 1
holdtwohanded false
firetwohanded true
shape "0 0 5 1"
shape "0 1 4 1"
center "4.5 0 .5"
scale 1.26
ammo 16
reload 16
price 2500
size 35
is_primary true
}


// =======================
// HEAVY LASER
// =======================
item heavylaser
{
name "_Heavy Laser"
model weapons/laserheavy/laserheavy
weapon true
type biggun
animationindex 1
holdtwohanded false
firetwohanded true
shape "1 0 4 1"
shape "0 1 4 1"
center "8.5 4.5 3.5"
scale 1.15
ammo 6
reload 16
price 4000
size 50
is_primary true
is_heavy true
}

// =======================
// ELECTRO LASER
// =======================
item electrolaser
{
name "_Electro Laser"
model weapons/electrolaser/electrolaser
weapon true
type rifle
animationindex 1
holdtwohanded false
firetwohanded true
shape "0 0 5 1"
shape "0 1 4 1"
center "4.5 0 .5"
scale 1.26
ammo 16
reload 12
price 1000
size 35
is_primary true
}

item laser_ammo
{
name "_D-F Cartridge"
model weapons/laserrifle/laserrifle_clip
type ammo
animationindex 0
shape "0 0 1 2"
center "0 0 0"
scale 1.8
price 210
size 7
is_primary true
dmgtype laser

weapon_mod laserpistol
{
firedef
{
name "_Wave Fire"
skill close
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
speed 0
spread "0.75 0.75"
crouch 0.9
range 60
shots 1
ammo 1
time 5
damage "36 6"
dmgweight laser_light
reaction true
}
firedef
{
name "_Pulsed Fire"
skill close
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
delaybetweenshots 6
speed 0
spread "0.75 0.75"
crouch 0.9
range 60
shots 3
ammo 3
time 8
damage "36 6"
dmgweight laser_light
reaction true
}
firedef
{
name "_Charged fire"
skill assault
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
speed 0
spread "0.5 0.5"
crouch 0.8
range 120
shots 1
ammo 6
time 12
damage "42 8"
dmgweight laser_heavy
reaction true
}
}

weapon_mod laserrifle
{
firedef
{
name "_Wave Fire"
skill assault
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
speed 0
spread "0.5 0.5"
crouch 0.8
range 90
shots 1
ammo 2
time 7
damage "42 6"
dmgweight laser_medium
reaction true
}
firedef
{
name "_Pulsed Fire"
skill assault
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
delaybetweenshots        6
speed 0
spread "0.5 0.5"
crouch 0.8
range 90
shots 3
ammo 3
time 12
damage "42 5"
dmgweight laser_medium
reaction true
}
firedef
{
name "_Charged Fire"
skill Heavy
projtl laserOverload
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
speed 0
spread "0.5 0.5"
crouch 0.8
range 120
shots 1
ammo 6
time 16
damage "54 10"
dmgweight laser_heavy
reaction true
}
}

weapon_mod heavylaser
{
firedef
{
name "_Wave Fire"
skill heavy
projtl laserOverload
impact laserImpact
hitbody laserImpact
firesnd weapons/heavy_laser
speed 0
spread "0.5 0.5"
crouch 0.7
range 120
shots 1
ammo 1
time 10
damage "55 6"
dmgweight laser_heavy
reaction true
}
firedef
{
name "_Pulsed Fire"
skill heavy
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
delaybetweenshots        6
speed 0
spread "0.5 0.5"
crouch 0.7
range 120
shots 3
ammo 3
time 15
damage "52 6"
dmgweight laser_heavy
reaction true
}
firedef
{
name "_Charged Fire"
skill heavy
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
delaybetweenshots        6
speed 0
spread "0.5 0.5"
crouch 0.7
range 140
shots 1
ammo 4
time 18
damage "68 10"
dmgweight laser_heavy
reaction true
}
firedef
{
name "_OverCharged Fire"
skill heavy
projtl laserPulse
impact laserImpact
hitbody laserImpact
firesnd weapons/laser
delaybetweenshots        6
speed 0
spread "0.5 0.5"
crouch 0.7
range 140
shots 3
ammo 6
time 20
damage "70 10"
dmgweight laser_heavy
reaction true
}
}

weapon_mod electrolaser
{
firedef
{
name "_Stun Shot"
skill assault
projtl laserFrizzledBeam
impact laserFrizzledImpact
hitbody laserFrizzledImpact
firesnd weapons/electrolaser
speed 0
spread "0.8 0.8"
crouch 0.8
range 40
shots 1
ammo 1
time 7
damage "30 6"
dmgweight stun_electro
reaction true
}
}
}

--- End code ---

What am I doing wrong? Am I missing something out? is there another file I need to edit?

Also, Any pointers on my attempt at a mod?
since I cant get it working, I cant test it out, so I don't know if my charged fire-mode's are WAY too powerful or not.


EDIT:
also, while I would have posted this thread in a coding related section of the forum, I intend to edit this post and put up my weapon 'mods' here under a new topic title.

Destructavator:
Hmmm..., From what I know from playing with firedefs in the past I don't see anything that jumps out at me right off the bat as being wrong or improperly formatted...

Does the console report any strange errors in the battlescape?

Also, if you unpacked the pk3 file did you remove the pk3 (or rename it to some extension such as ".bak" or ".old" or whatever) so the game wouldn't find the .ufo in more than one place resulting in a conflict?

The game reads pk3 files in a specific order, and also gives priority IIRC to un-zipped files over pk3 files it finds on startup.  If it finds duplicates, it makes a decision as to which version of a file to use and only uses one.

Mattn:
please post a diff - easier to look at the changes then

DiDiT:
a Diff? I don't know you mean. do you mean, like, a copy of the file it's self?


edit:
Meh, I'v attached a 7zipped copy of the ufo anyway.

edit 2:
just looked Diff up, and its Way over my head. I was never good at svn stuff. Bah...

Mattn:
attached is a diff

btw. a diff is not svn only.

Navigation

[0] Message Index

[#] Next page

Go to full version