project-navigation
Personal tools

Author Topic: Modifying research  (Read 5321 times)

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Modifying research
« on: April 18, 2013, 09:42:18 pm »
Hello...

I'd like to modify some weapon research to obtain this effect:

Player starts with a weapon (assault entry) and a related ammo (a standard 24 V battery, assault_ammo entry)

The aliens have another weapon that uses the same ammo, but with a different effect.


Is that possible? I've tried to modify the plasma pistol entry in the weapons_plasma.ufo: I removed the plaspistol_ammo entry and added another "weapon mod" entry in the "assault ammo" in the weapons_human.ufo file. It's not working, can somebody give me a quick guide on how to do that?

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: Modifying research
« Reply #1 on: April 18, 2013, 09:47:00 pm »
I wrote that in an atrocious manner. Let's be more explicit. I changed the assault rifle into a high tech stunner rifle:

Code: [Select]
item assault

{
name "_Stunner"
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 8
reload 18
reloadsound "weapons/reload-rifle"
price 1000
size 35
is_primary true
weight 3.2
}

item assault_ammo
{
name "_24 Volts Battery"
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 "stun_electro"
weight 0.3

weapon_mod
{
weapon assault
firedef
{
name "_Stun Shot"
skill "assault"
projtl laserFrizzledBeam
impact laserFrizzledImpact
hitbody laserFrizzledImpact
firesnd "weapons/electro-taser"
speed 0
spread "1.4 1.4"
crouch 0.85
range 40
shots 1
ammo 1
time 12
damage "50 6"
dmgweight "stun_electro"
reaction true
}
}

weapon_mod
{
weapon assault
firedef
{
name "_Stun Sweep"
skill "assault"
projtl laserFrizzledBeam
impact laserFrizzledImpact
hitbody laserFrizzledImpact
firesnd "weapons/electro-taser"
speed 0
spread "2 2"
crouch 0.75
range 40
shots 3
ammo 3
time 24
damage "50 6"
dmgweight "stun_electro"
reaction true
}
}
}



I rewrote the entry for the assault ammo turning it into a standard 24 V battery.

Now I wish to rewrite the entry for the plasma pistol, turning it into an insurgent weapon powered by the same 24 V battery, but it's not working well...

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Modifying research
« Reply #2 on: April 19, 2013, 10:28:33 am »
I think this is what you need. Note the comments (lines that start with //).

Code: [Select]
item assault

{
name "_Stunner"
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 8
reload 18
reloadsound "weapons/reload-rifle"
price 1000
size 35
is_primary true
weight 3.2
}

item assault_ammo
{
name "_24 Volts Battery"
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 "stun_electro"
weight 0.3

// Put all assault firedefs under a single weapon_mod
weapon_mod
{
weapon assault
firedef
{
name "_Stun Shot"
skill "assault"
projtl laserFrizzledBeam
impact laserFrizzledImpact
hitbody laserFrizzledImpact
firesnd "weapons/electro-taser"
speed 0
spread "1.4 1.4"
crouch 0.85
range 40
shots 1
ammo 1
time 12
damage "50 6"
dmgweight "stun_electro"
reaction true
}
firedef
{
name "_Stun Sweep"
skill "assault"
projtl laserFrizzledBeam
impact laserFrizzledImpact
hitbody laserFrizzledImpact
firesnd "weapons/electro-taser"
speed 0
spread "2 2"
crouch 0.75
range 40
shots 3
ammo 3
time 24
damage "50 6"
dmgweight "stun_electro"
reaction true
}
}

// Then declare a new weapon_mod for plaspistol
weapon_mod
{
weapon plaspistol
firedef
{
name "_Stun Shot"
skill "assault"
projtl laserFrizzledBeam
impact laserFrizzledImpact
hitbody laserFrizzledImpact
firesnd "weapons/electro-taser"
speed 0
spread "1.4 1.4"
crouch 0.85
range 40
shots 1
ammo 1
time 12
damage "50 6"
dmgweight "stun_electro"
reaction true
}
firedef
{
name "_Stun Sweep"
skill "assault"
projtl laserFrizzledBeam
impact laserFrizzledImpact
hitbody laserFrizzledImpact
firesnd "weapons/electro-taser"
speed 0
spread "2 2"
crouch 0.75
range 40
shots 3
ammo 3
time 24
damage "50 6"
dmgweight "stun_electro"
reaction true
}
}
}

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: Modifying research
« Reply #3 on: April 20, 2013, 05:55:08 am »
All right, thanks. So, then I will have to replace every "plaspistol_ammo" entry with a "assault_ammo" entry in the equipment_mission.ufo file, right? I've tried it, now the aliens have no weapon apart for the kerrblade...

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Modifying research
« Reply #4 on: April 20, 2013, 10:38:54 am »
Alien team equipment is defined in base/ufos/equipment_missions.ufo. You should read about all the ufo files.

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: Modifying research
« Reply #5 on: April 21, 2013, 05:37:05 pm »
All right, sorry if I bother you but I think I got something wrong. I've modified the weapons_human.ufo as you said, I've removed the plaspistol_ammo entry in the weapons_plasma.ufo, and I've modified the equipment_missions.ufo file this way:

Code: [Select]
equipment alien_workers1
{
mininterest 0
maxinterest 79

// Primary

// Secondary
item (plaspistol 100)
item (assault_ammo 1)

// Misc
item (kerrblade 10)
}

Now the tamans are equipped only with Kerrblades. I've tried to remove the item (assault_ammo 1) entry, same result. Can you help me? I am really looking forward to making this modification...

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Modifying research
« Reply #6 on: April 21, 2013, 07:29:13 pm »
Maybe you need more than 1 assault_ammo. Try 100. If that doesn't work, remove the kerrblade and see what happens.

Offline Latino210

  • Squad Leader
  • ****
  • Posts: 161
  • UFORadiant mapper
    • View Profile
Re: Modifying research
« Reply #7 on: April 22, 2013, 09:37:36 am »
All right, it worked, thanks!