Author Topic: Assertion failed? (Fireballs)  (Read 2144 times)

0 Members and 1 Guest are viewing this topic.

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Assertion failed? (Fireballs)
Hey all, my mod is almost done and ready for beta testing!

So I've got a sequence in a mission where a ship is supposed to self-destruct. When the ship is supposed to blow up, I get this error:

Assertion Failed!
Code: [Select]
Assert: fireball_type < Num_fireball_types
File: fireballs.cpp
Line: 797

ntdll.dll! NtWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! SCP_DumpStack + 354 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! WinAssert + 194 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! fireball_create + 102 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! ship_dying_frame + 1109 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! ship_process_post + 361 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! obj_move_all_post + 718 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! obj_move_all + 428 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! game_simulation_frame + 1121 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! game_frame + 496 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! game_do_frame + 231 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! game_do_state + 403 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! gameseq_process_events + 232 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! game_main + 787 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! WinMain + 328 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! invoke_main + 30 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! __scrt_common_main_seh + 346 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! __scrt_common_main + 13 bytes
fs2_open_3_7_4_SSE2-DEBUG.exe! WinMainCRTStartup + 8 bytes
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes


The self-destruction works just fine in the regular, non-debug version, but the debug version crashes with this error.

I'm not sure what the problem is - am I missing a file?

Thanks!

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Assertion failed? (Fireballs)
Do you have a custom fireball.tbl file? Does the ship class in question have an "$Explosion Animations:" entry?
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Assertion failed? (Fireballs)
Do you have a custom fireball.tbl file? Does the ship class in question have an "$Explosion Animations:" entry?

Yes, it has an $Explosion Animations entry.


 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Assertion failed? (Fireballs)
What does it say?
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Assertion failed? (Fireballs)
It says (4,5,6)

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Assertion failed? (Fireballs)
...And do you have a custom fireball.tbl to define a 7th fireball, or are you generating this error on purpose?
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Assertion failed? (Fireballs)
...And do you have a custom fireball.tbl to define a 7th fireball, or are you generating this error on purpose?

No, I don't have a fireball.tbl. I don't know anything about how fireballs work. Why would I be generating it on purpose?

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Assertion failed? (Fireballs)
...And do you have a custom fireball.tbl to define a 7th fireball, or are you generating this error on purpose?

No, I don't have a fireball.tbl. I don't know anything about how fireballs work. Why would I be generating it on purpose?
Well, because you have a ship referencing fireball ID #6 when the default fireball.tbl only defines 0-5.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Assertion failed? (Fireballs)
...And do you have a custom fireball.tbl to define a 7th fireball, or are you generating this error on purpose?

No, I don't have a fireball.tbl. I don't know anything about how fireballs work. Why would I be generating it on purpose?
Well, because you have a ship referencing fireball ID #6 when the default fireball.tbl only defines 0-5.

Oh! So can I just get rid of #6 and it will work?

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Assertion failed? (Fireballs)
...And do you have a custom fireball.tbl to define a 7th fireball, or are you generating this error on purpose?

No, I don't have a fireball.tbl. I don't know anything about how fireballs work. Why would I be generating it on purpose?
Well, because you have a ship referencing fireball ID #6 when the default fireball.tbl only defines 0-5.

Oh! So can I just get rid of #6 and it will work?
Or just remove the "$Explosion Animations:" entry entirely because the default should be equivalent to (4, 5).
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Assertion failed? (Fireballs)
Okay, thanks a bunch!  :)

 

Offline m!m

  • 211
Re: Assertion failed? (Fireballs)
How could this be converted to a proper warning? The fireballs are only parsed on mission start so we can't use that to validate the specified indices. The easiest solution would be to just convert the Assertion to an if with a Warning but it would be more convenient for the modder to do all the validation when parsing the weapons table so that the warning appears as soon as possible.