Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: New MIRV-type weapon crashing game -- what am I doing wrong?  (Read 2565 times)

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile

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:
Quote
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:
Code
{
"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:
Code
{
"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:
Code
{
"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 :
Code
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
« Last Edit: May 07, 2012, 08:25:29 AM by EnderNerdcore »
Logged

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: New MIRV-type weapon crashing game -- what am I doing wrong?
« Reply #1 on: May 07, 2012, 08:11:10 AM »

From what I can see, you've got a bit of a naming discrepency with the warhead, looks like you're trying to get the MIRV to possibly split into more of the same thing. Plus you've only made the inferno_mirv_warhead proj and not the gtm_inferno-mirv_warhead
Logged

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: New MIRV-type weapon crashing game -- what am I doing wrong?
« Reply #2 on: May 07, 2012, 08:23:06 AM »

From what I can see, you've got a bit of a naming discrepency with the warhead, looks like you're trying to get the MIRV to possibly split into more of the same thing. Plus you've only made the inferno_mirv_warhead proj and not the gtm_inferno-mirv_warhead
Holy crap, you're right. Thank you!
Logged