UPDATE: Fixed. Be very careful with consistent naming, the game won't catch everything at launch!Hey all. I'm busy implementing some custom weapons for some fighter craft I'm making for fun. One of these weapons is an anti-fighter MIRV-type missile.
Unfortunately, when my fighters fire it, they crash the game. (I'm not sure, but I *think* the game isn't crashing until the missile attempts to split
EDIT: confirmed, game does not crash until missile attempts to split). This is the error in the log:
java.lang.NullPointerException
at com.fs.starfarer.combat.ai.missile.MirvAI.do.String(Unknown Source)
at com.fs.starfarer.combat.ai.missile.MirvAI.õÕ0000(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.combat.OOoO.ÕøÒ000(Unknown Source)
at com.fs.A.super.Ò00000(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
None of that makes any real sense to me; it seems that perhaps something in the MirvAI is having issues.
So, to help me see if I'm doing anything wrong, here's the weapon (please excuse any balance numbers, I'm just trying to get it to work first!).
Yes, it's very much copied from the Hurricane MIRV--again, I'm trying to get it to work before tweaking it too much.
.WPN:
{
"id":"gtm_infyrno",
"specClass":"projectile",
"type":"MISSILE",
"size":"MEDIUM",
"turretSprite":"graphics/fs2/weapons/freespace2_fighter_hidden_base.png",
"hardpointSprite":"graphics/fs2/weapons/freespace2_fighter_hidden_base.png",
"hardpointOffsets":[23, 0],
"turretOffsets":[17, 0],
"hardpointAngleOffsets":[0],
"turretAngleOffsets":[0],
"barrelMode":"ALTERNATING",
"animationType":"SMOKE",
"interruptibleBurst":false,
"displayArcRadius":300,
"smokeSpec":{"particleSizeMin":20.0,
"particleSizeRange":20.0,
"cloudParticleCount":3,
"cloudDuration":1.0,
"cloudRadius":10.0,
"blowbackParticleCount":3,
"blowbackDuration":2.0,
"blowbackLength":30.0,
"blowbackSpread":10.0,
"particleColor":[100,100,100,200]},
"projectileSpecId":"gtm_infyrno_mirv",
"fireSoundTwo":"missile_light",
}
.PROJ:
{
"id":"gtm_infyrno_mirv",
"specClass":"missile",
"missileType":"MIRV",
"sprite":"graphics/missiles/missile_MIRV.png",
"size":[12,28],
"center":[6,14],
"collisionRadius":16,
"collisionClass":"MISSILE_NO_FF",
"explosionColor":[255,165,0,255], # purely visual, will get a white additively blended core on top of this color
"explosionRadius":125, # purely visual
"engineSpec":{"turnAcc":300,
"turnRate":50,
"acc":50,
"dec":50},
"engineSlots":[{"id":"ES1",
"loc":[-14, 0],
"style":"MISSILE_MIDLINE",
"width":12.0,
"length":60.0,
"angle":180.0}],
"behaviorSpec":{"behavior":"MIRV",
"splitRange":150,
"minTimeToSplit":0.1,
"numShots":6,
"damage":25,
"damageType":FRAGMENTATION,
"hitpoints":15,
"arc":180,
"spreadSpeed":150,
"projectileSpec":"gtm_infyrno_mirv_warhead",
"smokeSpec":{"particleSizeMin":20.0,
"particleSizeRange":20.0,
"cloudParticleCount":11,
"cloudDuration":1.0,
"cloudRadius":20.0,
"blowbackParticleCount":0,
"blowbackDuration":0,
"blowbackLength":0,
"blowbackSpread":0,
"particleColor":[175,100,50,200]}
}
}
.PROJ:
{
"id":"infyrno_mirv_warhead",
"specClass":"missile",
"missileType":"MISSILE",
"sprite":"graphics/missiles/missile_MIRV_warhead.png",
"size":[7,16],
"center":[3.5,8],
"collisionRadius":12,
"collisionClass":"MISSILE_NO_FF",
"explosionColor":[255,165,0,255], # purely visual, will get a white additively blended core on top of this color
"explosionRadius":75, # purely visual
"maxFlightTime":1,
"engineSpec":{"turnAcc":280,
"turnRate":0,
"maxSpeed":100,
"acc":200,
"dec":0},
"engineSlots":[{"id":"ES1",
"loc":[-7, 0],
"style":"MISSILE_MIDLINE",
"width":4.0,
"length":20.0,
"angle":180.0}]
}
weapon_data.csv :
name,id,tier,base value,range,damage/second,damage/shot,emp,impact,turn rate,OPs,ammo,ammo/sec,type,energy/shot,energy/second,chargeup,chargedown,burst size,burst delay,min spread,max spread,spread/shot,spread decay/sec,beam speed,proj speed,launch speed,flight time,proj hitpoints,hints,number
GTM Infyrno,gtm_infyrno,1,0,600,,350,,75,10,0,6,,FRAGMENTATION,0,,0,3,1,,0,0,0,0,,250,100,3,200,ANTI_FTR,5003