project-navigation
Personal tools

Author Topic: Trying To Make New Weapon Fire-modes And Failing Epicly At It.  (Read 5739 times)

Offline DiDiT

  • Squad Leader
  • ****
  • Posts: 149
  • Your local Flame-thrower wielding Furry.
    • View Profile
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: [Select]
// =======================
// 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
}
}
}

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.
« Last Edit: April 24, 2010, 11:04:11 pm by DiDiT »

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Trying To Make New Weapon Fire-modes And Failing Epicly At It.
« Reply #1 on: April 25, 2010, 04:19:14 am »
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.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Trying To Make New Weapon Fire-modes And Failing Epicly At It.
« Reply #2 on: April 25, 2010, 01:28:46 pm »
please post a diff - easier to look at the changes then

Offline DiDiT

  • Squad Leader
  • ****
  • Posts: 149
  • Your local Flame-thrower wielding Furry.
    • View Profile
Re: Trying To Make New Weapon Fire-modes And Failing Epicly At It.
« Reply #3 on: April 25, 2010, 02:12:25 pm »
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...

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Trying To Make New Weapon Fire-modes And Failing Epicly At It.
« Reply #4 on: April 25, 2010, 02:44:28 pm »
attached is a diff

btw. a diff is not svn only.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Trying To Make New Weapon Fire-modes And Failing Epicly At It.
« Reply #5 on: April 25, 2010, 02:46:50 pm »
i can see your firedefs in-game

Offline DiDiT

  • Squad Leader
  • ****
  • Posts: 149
  • Your local Flame-thrower wielding Furry.
    • View Profile
Re: Trying To Make New Weapon Fire-modes And Failing Epicly At It.
« Reply #6 on: April 25, 2010, 02:48:12 pm »
odd. I cant.

Hmm, well, let me try something out quickly.

Offline DiDiT

  • Squad Leader
  • ****
  • Posts: 149
  • Your local Flame-thrower wielding Furry.
    • View Profile
Re: Trying To Make New Weapon Fire-modes And Failing Epicly At It.
« Reply #7 on: April 25, 2010, 02:54:52 pm »
Right, got it working. God, i feel like a idiot now... I Forgot to add the 0 in front of my decompressed 0ufos folder, so it wasn't loading my custom files.

*face-palm*

Also, my charged fire modes are weak as piss... meh, I'll sort that out...

Thanks for the help.