Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Help me spot the fatal null error in my .wpn file. *SOLVED*  (Read 2426 times)

Vandala

  • Admiral
  • *****
  • Posts: 1841
  • We need ponies, ponies in spaceships!
    • View Profile

Hey, guys, I getting a fatal null error from this .wpn file. Can anyone spot it?

It's been heavily edited, I'm trying to put everything into a sensible order and cut out as much useless text as I can but I probably cut out to much.

Spoiler
Quote
{
   "id":"zica_laser",
   "specClass":"projectile",
   "projectileSpecId":"zica_laser_shot.png",
   "type":"ENERGY",
   "size":"LARGE",
   
   "turretSprite":"graphics/weapons/zica_laser.png",
   "hardpointSprite":"graphics/weapons/zica_laser.png",
   
   "turretOffsets":[12, 0],
   "turretAngleOffsets":[0],
   "hardpointOffsets":[17, 0],
   "hardpointAngleOffsets":[0],
   
   "barrelMode":"ALTERNATING",
   "interruptibleBurst":false,
   "autocharge":true,
   "requiresFullCharge":true,
   
   "animationType":"NONE",
   
   "fireSoundTwo":"energy_pulse_blaster",
}
[close]
« Last Edit: July 08, 2012, 04:31:49 PM by Vandala »
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Help me spot the fatal null error in my .wpn file.
« Reply #1 on: July 08, 2012, 08:06:54 AM »

Well, is the name of the .wpn file the same as the weapon ID in the first line?  That can be a problem.
There's also the animation type.  I've never seen a vanilla weapon without an animation, despite there being "NONE" there, so that can be a problem too.
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

Blade Skydancer

  • Lieutenant
  • **
  • Posts: 71
    • View Profile
Re: Help me spot the fatal null error in my .wpn file.
« Reply #2 on: July 08, 2012, 08:09:05 AM »

The projectilespecid, which points to the projectile file has a .png extension. This should point to the weapon's projectile file.
Logged

Tezarius

  • Lieutenant
  • **
  • Posts: 66
    • View Profile
Re: Help me spot the fatal null error in my .wpn file.
« Reply #3 on: July 08, 2012, 08:27:08 AM »

Ok, I replace projectileSpecId and textures with my own and this code work perfect, however if I make wrong projectileSpecId, game falls to null exception error, that could be the case

Well, is the name of the .wpn file the same as the weapon ID in the first line?  That can be a problem.
I never face with this problem using wpn files with names differ from their ID's
« Last Edit: July 08, 2012, 08:28:49 AM by Tezarius »
Logged

Vandala

  • Admiral
  • *****
  • Posts: 1841
  • We need ponies, ponies in spaceships!
    • View Profile
Re: Help me spot the fatal null error in my .wpn file.
« Reply #4 on: July 08, 2012, 04:31:39 PM »

The projectilespecid, which points to the projectile file has a .png extension. This should point to the weapon's projectile file.
Excellent, that was indeed the problem, thanks everyone.