Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: X3N0-Life-Form on August 04, 2014, 01:02:52 pm
-
As I've been fooling around with hud_gauges.tbl, it has come to my attention that hudparse gives very little info when something in the table goes wrong. Usually, the only message I get from an invalid entry is "Invalid gauge found in hud_gauges.tbl", which gives very little info regarding what went wrong and where.
I was wondering if someone familiar with the parsing code could take a look and see whether it would be possible to provide more useful feedback, at the very least what line threw the warning.
I've also noticed that the parser doesn't complain about otherwise bogus sections, see as the one below (copied from Wing Commander Saga's hud table).
#Ship Gauges
$Ship: F-66A Thunderbolt VII
$Default: (1024 768)
$Gauge: Hardpoints
$HP_Silhouette: (0 0)
+Image: hp_sil_thunderbolt
$HP_PBank1_L: (49 20)
$HP_PBank1_R: (69 20)
$HP_PBank2_L: (39 33)
$HP_PBank2_R: (79 33)
$HP_PBank3_L: (29 41)
$HP_PBank3_R: (89 41)
$HP_SBank1: (19 64)
$HP_SBank2: (60 40)
$HP_SBank3: (102 64)
$HP_SBank4: (0 0)
$HP_SBank5: (0 0)
$HP_SBank6: (0 0)
#End
I get the feeling that this is also something FSO should warn the modder about.
EDIT - Second issue is expected behavior.
-
I'm working on a patch for the first issue; if you want a test build, I can get one to you in... several hours, probably.
-
That would be nice, thank you :)
-
Test build that should provide more useful complaints about invalid gauge types (uses error_display(), so you get filename and line number, as well as downgrading to a Warning if -noparseerrors is used): [EDIT: Deleted]
What exactly is the second problem? The fact that "#Ship Gauges" isn't a valid section header? I don't think there are any tables in FSO that will actually complain about bogus section headers like that; stick that on the end of just about any table and FSO should ignore it. Heck, you could append an entire Shakespearean play to the end of most (if not all) tables and FSO wouldn't even notice, because it just stops caring once it's parsed the relevant data.
-
Test build that should provide more useful complaints about invalid gauge types (uses error_display(), so you get filename and line number, as well as downgrading to a Warning if -noparseerrors is used): http://deviance.duckish.net/downloads/FS2_Open_hudparse_test.7z
Thank you very much sir, I'll test that right away.
What exactly is the second problem? The fact that "#Ship Gauges" isn't a valid section header? I don't think there are any tables in FSO that will actually complain about bogus section headers like that; stick that on the end of just about any table and FSO should ignore it. Heck, you could append an entire Shakespearean play to the end of most (if not all) tables and FSO wouldn't even notice, because it just stops caring once it's parsed the relevant data.
Hmm, I didn't know that. I guess that's not an issue then :) Thanks for clarifying.
-
OK, with no mod selected, I'm getting this:
Error prompt:
ships.tbl(line 235):
Error: Required token = [#End], [$Subsystem:], or [$Ship], found [$Name: GTF Hercules]
ntdll.dll! ZwWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! SCP_DumpStack + 354 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! Error + 229 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! error_display + 369 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! required_string_one_of + 561 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! parse_ship_values + 23790 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! parse_ship + 939 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! parse_shiptbl + 364 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! ship_init + 556 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! game_init + 1679 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! game_main + 519 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! WinMain + 328 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! __tmainCRTStartup + 296 bytes
fs2_open_3_7_1_SSE2-DEBUG.exe! WinMainCRTStartup + 13 bytes
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes
fs2_open.log
==========================================================================
DEBUG SPEW: No debug_filter.cfg found, so only general, error, and warning
categories can be shown and no debug_filter.cfg info will be saved.
==========================================================================
FreeSpace 2 Open version: 3.7.1
Passed cmdline options:
-3dshockwave
-soft_particles
-post_process
-fb_explosions
-rearm_timer
-targetinfo
-3dwarp
-ship_choice_3d
-weapon_choice_3d
-warp_flash
-output_sexps
-output_scripting
Building file index...
Found root pack 'C:\Freespace 2\FS2OGGcutscenepack.vp' with a checksum of 0x84396e99
Found root pack 'C:\Freespace 2\multi-mission-pack.vp' with a checksum of 0x377695e0
Found root pack 'C:\Freespace 2\multi-voice-pack.vp' with a checksum of 0xd50e7442
Found root pack 'C:\Freespace 2\Root_fs2.vp' with a checksum of 0xce10d76c
Found root pack 'C:\Freespace 2\smarty_fs2.vp' with a checksum of 0xddeb3b1e
Found root pack 'C:\Freespace 2\sparky_fs2.vp' with a checksum of 0x164fe65a
Found root pack 'C:\Freespace 2\sparky_hi_fs2.vp' with a checksum of 0xa11d56f1
Found root pack 'C:\Freespace 2\stu_fs2.vp' with a checksum of 0xd77da83a
Found root pack 'C:\Freespace 2\tango1_fs2.vp' with a checksum of 0x4c25221e
Found root pack 'C:\Freespace 2\tango2_fs2.vp' with a checksum of 0x86920b82
Found root pack 'C:\Freespace 2\tango3_fs2.vp' with a checksum of 0x705e8d71
Found root pack 'C:\Freespace 2\warble_fs2.vp' with a checksum of 0xd85c305d
Searching root 'C:\Freespace 2\' ... 127 files
Searching root pack 'C:\Freespace 2\FS2OGGcutscenepack.vp' ... 10 files
Searching root pack 'C:\Freespace 2\multi-mission-pack.vp' ... 110 files
Searching root pack 'C:\Freespace 2\multi-voice-pack.vp' ... 307 files
Searching root pack 'C:\Freespace 2\Root_fs2.vp' ... 157 files
Searching root pack 'C:\Freespace 2\smarty_fs2.vp' ... 10 files
Searching root pack 'C:\Freespace 2\sparky_fs2.vp' ... 3027 files
Searching root pack 'C:\Freespace 2\sparky_hi_fs2.vp' ... 1337 files
Searching root pack 'C:\Freespace 2\stu_fs2.vp' ... 2355 files
Searching root pack 'C:\Freespace 2\tango1_fs2.vp' ... 32 files
Searching root pack 'C:\Freespace 2\tango2_fs2.vp' ... 15 files
Searching root pack 'C:\Freespace 2\tango3_fs2.vp' ... 10 files
Searching root pack 'C:\Freespace 2\warble_fs2.vp' ... 52 files
Found 13 roots and 7549 files.
Setting language to English
Game Settings Table: Using Standard Loops For SEXP Arguments
Game Settings Table: Using standard event chaining behavior
Game Settings Table: External shaders are DISABLED
Initializing OpenAL...
OpenAL Vendor : Creative Labs Inc.
OpenAL Renderer : Software
OpenAL Version : 1.1
Found extension "ALC_EXT_EFX".
Sample rate: 44100 (44100)
EFX enabled: NO
Playback device: Generic Software on Haut-parleurs (Realtek High Definition Audio)
Capture device: Microphone (Realtek High Defini
... OpenAL successfully initialized!
Failed to init speech
Initializing OpenGL graphics device at 1280x1024 with 32-bit color...
Initializing WGL...
Requested WGL Video values = R: 8, G: 8, B: 8, depth: 24, stencil: 8, double-buffer: 1
Actual WGL Video values = R: 8, G: 8, B: 8, depth: 24, stencil: 8, double-buffer: 1
OpenGL Vendor : NVIDIA Corporation
OpenGL Renderer : GeForce GT 630/PCIe/SSE2
OpenGL Version : 4.4.0
Using extension "GL_EXT_fog_coord".
Using extension "GL_ARB_multitexture".
Using extension "GL_ARB_texture_env_add".
Using extension "GL_ARB_texture_compression".
Using extension "GL_EXT_texture_compression_s3tc".
Using extension "GL_EXT_texture_filter_anisotropic".
Using extension "GL_ARB_texture_env_combine".
Using extension "GL_EXT_compiled_vertex_array".
Using extension "GL_EXT_draw_range_elements".
Using extension "GL_ARB_texture_mirrored_repeat".
Using extension "GL_ARB_texture_non_power_of_two".
Using extension "GL_ARB_vertex_buffer_object".
Using extension "GL_ARB_pixel_buffer_object".
Using extension "GL_SGIS_generate_mipmap".
Using extension "GL_EXT_framebuffer_object".
Using extension "GL_ARB_texture_rectangle".
Using extension "GL_EXT_bgra".
Using extension "GL_ARB_texture_cube_map".
Using extension "GL_EXT_texture_lod_bias".
Using extension "GL_ARB_point_sprite".
Using extension "GL_ARB_shading_language_100".
Using extension "GL_ARB_shader_objects".
Using extension "GL_ARB_vertex_shader".
Using extension "GL_ARB_fragment_shader".
Using extension "GL_ARB_shader_texture_lod".
Using extension "GL_ARB_texture_float".
Using extension "GL_ARB_draw_elements_base_vertex".
Found special extension function "wglSwapIntervalEXT".
Compiling new shader:
Loading built-in default shader for: soft-v.sdr
Loading built-in default shader for: soft-f.sdr
Shader features:
Depth-blended Particles
Compiling new shader:
Loading built-in default shader for: soft-v.sdr
Loading built-in default shader for: soft-f.sdr
Shader features:
Distorted Particles
Compiling post-processing shader 1 ...
Loading built-in default shader for: post-v.sdr
Loading built-in default shader for: post-f.sdr
Compiling post-processing shader 2 ...
Loading built-in default shader for: post-v.sdr
Loading built-in default shader for: blur-f.sdr
Compiling post-processing shader 3 ...
Loading built-in default shader for: post-v.sdr
Loading built-in default shader for: blur-f.sdr
Compiling post-processing shader 4 ...
Loading built-in default shader for: post-v.sdr
Loading built-in default shader for: brightpass-f.sdr
Compiling post-processing shader 5 ...
Loading built-in default shader for: fxaa-v.sdr
Loading built-in default shader for: fxaa-f.sdr
Compiling post-processing shader 6 ...
Loading built-in default shader for: post-v.sdr
Loading built-in default shader for: fxaapre-f.sdr
Compiling post-processing shader 7 ...
Loading built-in default shader for: post-v.sdr
Loading built-in default shader for: ls-f.sdr
Max texture units: 4 (32)
Max elements vertices: 1048576
Max elements indices: 1048576
Max texture size: 16384x16384
Max render buffer size: 16384x16384
Can use compressed textures: YES
Texture compression available: YES
Post-processing enabled: YES
Using trilinear texture filter.
OpenGL Shader Version: 4.40 NVIDIA via Cg compiler
... OpenGL init is complete!
Size of bitmap info = 742 KB
Size of bitmap extra info = 48 bytes
ANI cursorweb with size 24x24 (25.0% wasted)
GRAPHICS: Initializing default colors...
SCRIPTING: Beginning initialization sequence...
SCRIPTING: Beginning Lua initialization...
LUA: Opening LUA state...
LUA: Initializing base Lua libraries...
LUA: Beginning ADE initialization
ADE: Initializing enumeration constants...
ADE: Assigning Lua session...
SCRIPTING: Outputting scripting metadata...
SCRIPTING: Beginning main hook parse sequence....
Wokka! Error opening file (scripting.tbl)!
TABLES: Unable to parse 'scripting.tbl'! Error code = 5.
SCRIPTING: Inititialization complete.
SCRIPTING: Splash screen overrides checked
SCRIPTING: Splash hook has been run
SCRIPTING: Splash screen conditional hook has been run
Using high memory settings...
Wokka! Error opening file (interface.tbl)!
WMCGUI: Unable to parse 'interface.tbl'! Error code = 5.
Dutifully ignoring the extra sound values for retail sound 36, 'l_hit.wav'...
Dutifully ignoring the extra sound values for retail sound 37, 'm_hit.wav'...
Windows reported 16 joysticks, we found 0
Current soundtrack set to -1 in event_music_reset_choices
Wokka! Error opening file (armor.tbl)!
TABLES: Unable to parse 'armor.tbl'! Error code = 5.
ships.tbl(line 235): Error: Required token = [#End], [$Subsystem:], or [$Ship], found [$Name: GTF Hercules]
ERROR: ships.tbl(line 235):
Error: Required token = [#End], [$Subsystem:], or [$Ship], found [$Name: GTF Hercules]
File: parselo.cpp
Line: 333
Freeing all existing models...
-
Whoops; sorry, apparently that build included another thing that happened to be broken. I thought I'd compiled it with just the hudparse changes, but apparently not. Please stand by while I fetch a proper test build...
EDIT: [EDIT2: Deleted] now contains a build containing nothing but latest trunk and the hudparse changes.
-
Seems to be working as intended so far, thank you very much. Until this goes into trunk, would it be possible to have a patch file?
-
You can have two: http://scp.indiegames.us/mantis/view.php?id=3085
-
Thanks again.
-
The version of the patch in the test build I uploaded earlier is now in trunk as of r10978, so I've deleted the test build from my hosting.