General > User modifications

Modifying research

(1/2) > >>

Latino210:
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?

Latino210:
I wrote that in an atrocious manner. Let's be more explicit. I changed the assault rifle into a high tech stunner rifle:


--- Code: ---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
}
}
}


--- End code ---


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...

H-Hour:
I think this is what you need. Note the comments (lines that start with //).


--- Code: ---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
}
}
}
--- End code ---

Latino210:
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...

H-Hour:
Alien team equipment is defined in base/ufos/equipment_missions.ufo. You should read about all the ufo files.

Navigation

[0] Message Index

[#] Next page

Go to full version