Source Code Project Mantis - FSSCP
View Issue Details
0002977FSSCPscriptingpublic2013-12-13 01:412013-12-18 07:27
Reporterz64555 
Assigned Toz64555 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformSager NP8250 "BlackPhoenix"OSWindowsOS Version8
Product Version3.7.0 
Target VersionFixed in Version3.7.1 
Summary0002977: GS_STATE and GS_EVENT names not matching up to proper text strings
DescriptionFringeSpace had an issue where they could not bring up the ship lab via mainhall script since the new Pilot code went in. I have since tracked this down to an issue with the GS_STATE and GS_EVENT names in gamesequence.h not matching up to the text in the char arrays in gamesequence.cpp, resulting in improper referencing to GS_EVENT_LOOP_BRIEF and above, and GS_STATE_LOOP_BRIEF and above.

Since LUA aparently gets the GS_EVENT and GS_STATE index values from this char arrays, any scripts that attempted to use these out-of-sequence indices would fail, or otherwise trigger on/call up the wrong event/state.

Another effect, although minor, was that the "Got event..." strings in the fs2_open.log would show the improper GS_EVENT and GS_STATE names along with their index.
Steps To ReproduceTry running a script that uses any of these, and take careful note of when they trigger in the fs2_open.log:
GS_EVENT_LOOP_BRIEF, GS_EVENT_CAMPAIGN_CHEAT, GS_EVENT_PXO, GS_EVENT_LAB, GS_EVENT_PXO_HELP, GS_EVENT_FICTION_VIEWER, GS_EVENT_SCRIPTING

GS_STATE_LOOP_BRIEF, GS_STATE_PXO, GS_STATE_LAB, GS_STATE_PXO_HELP, GS_STATE_START_GAME, GS_STATE_FICTION_VIEWER, GS_STATE_SCRIPTING
TagsNo tags attached.
Attached Filesdiff mantis_2977_1.diff (17,629) 2013-12-13 10:09
http://scp.indiegames.us/mantis/file_download.php?file_id=2308&type=bug

Notes
(0015512)
z64555   
2013-12-13 01:43   
Added a patch that changes the #define lists into enumerations, which should make things easier to add, delete, move around, etc. Just be sure that you make the strings in gamesequence.cpp match up to the enum's sequence or you'll screw up the LUA scripts
(0015513)
m_m   
2013-12-13 03:16   
Looks good to me although I don't think that the changes to the Visual Studio solution are necessary but everything else seems to be alright.
(0015514)
z64555   
2013-12-13 10:11   
Oh, right. It took me a few times to figure it out, but I uploaded a new version sans the VS solution changes.

(Jeez, only took me 3 attempts to get the blasted thing done.)
(0015522)
z64555   
2013-12-18 07:27   
Fix committed @r10252

Issue History
2013-12-13 01:41z64555New Issue
2013-12-13 01:42z64555File Added: mantis_2977.diff
2013-12-13 01:43z64555Note Added: 0015512
2013-12-13 01:43z64555Assigned To => z64555
2013-12-13 01:43z64555Statusnew => code review
2013-12-13 03:16m_mNote Added: 0015513
2013-12-13 10:03z64555File Added: mantis_2977_1.diff
2013-12-13 10:06z64555File Deleted: mantis_2977_1.diff
2013-12-13 10:07z64555File Added: mantis_2977_1.diff
2013-12-13 10:08z64555File Deleted: mantis_2977_1.diff
2013-12-13 10:09z64555File Added: mantis_2977_1.diff
2013-12-13 10:10z64555File Deleted: mantis_2977.diff
2013-12-13 10:11z64555Note Added: 0015514
2013-12-18 07:27z64555Note Added: 0015522
2013-12-18 07:27z64555Statuscode review => resolved
2013-12-18 07:27z64555Fixed in Version => 3.7.1
2013-12-18 07:27z64555Resolutionopen => fixed