Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: HLD_Prophecy on October 31, 2016, 10:28:24 am

Title: Assertion failed? (Fireballs)
Post by: HLD_Prophecy on October 31, 2016, 10:28:24 am
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!
Title: Re: Assertion failed? (Fireballs)
Post by: AdmiralRalwood on November 04, 2016, 08:51:35 pm
Do you have a custom fireball.tbl file? Does the ship class in question have an "$Explosion Animations:" entry?
Title: Re: Assertion failed? (Fireballs)
Post by: HLD_Prophecy on November 04, 2016, 08:56:16 pm
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.

Title: Re: Assertion failed? (Fireballs)
Post by: AdmiralRalwood on November 04, 2016, 10:04:39 pm
What does it say?
Title: Re: Assertion failed? (Fireballs)
Post by: HLD_Prophecy on November 05, 2016, 01:16:34 pm
It says (4,5,6)
Title: Re: Assertion failed? (Fireballs)
Post by: AdmiralRalwood on November 05, 2016, 05:44:15 pm
...And do you have a custom fireball.tbl to define a 7th fireball, or are you generating this error on purpose?
Title: Re: Assertion failed? (Fireballs)
Post by: HLD_Prophecy on November 05, 2016, 09:08:28 pm
...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?
Title: Re: Assertion failed? (Fireballs)
Post by: AdmiralRalwood on November 05, 2016, 10:22:33 pm
...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.
Title: Re: Assertion failed? (Fireballs)
Post by: HLD_Prophecy on November 06, 2016, 03:18:40 pm
...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?
Title: Re: Assertion failed? (Fireballs)
Post by: AdmiralRalwood on November 06, 2016, 07:48:18 pm
...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).
Title: Re: Assertion failed? (Fireballs)
Post by: HLD_Prophecy on November 08, 2016, 10:29:16 am
Okay, thanks a bunch!  :)
Title: Re: Assertion failed? (Fireballs)
Post by: m!m on November 08, 2016, 10:46:58 am
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.