Help with weapons and skills

Started by Proximity_Microwave, February 03, 2015, 09:41:17 PM

Previous topic - Next topic

Proximity_Microwave

Is it possible to control which skills a weapon uses to determine accuracy? Like could one create a ranged weapon that uses melee calculations or a new skill to determine throwing accuracy for grenades? I was looking through the core files and found ranged and melee skills but couldn't find how they were tied to weapons.

Rikiki

You should look into the Verb_LaunchProjectile class. It controls projectiles launching.
What you are looking for is this line:
public HitReport HitReportFor(TargetPack target)
{
[...]
   if (base.CasterIsPawn)
   {
      f = base.CasterPawn.GetStatValue(StatDefOf.ShootingAccuracy, true);
   }
[...]


Have a look at the M&Co. Laser weapons mod. In Alpha 7, the heavy lasgun used a custom Verb_ShootWithCustomWarmup class. The code is still in the mod but no more used.

Proximity_Microwave

Thanks for the response. I was hoping I was overlooking something in an XML file. Looks like I'll have to dust off my programming skills.