This mod, as it stand, does not change functionality at all. This is why I'm not submitting the binary yet, just the source.
(Also, whenever I compile the binary, it's about 10MB for some reason, and I don't know how to control the various options, like music support, which likely relates.)
Anyway, in addition to the slightly reduced filesizes of the source, I have extracted most of the data from the various switch statements and placed them in arrays, making the code notably more readable and easier to modify. This is especially the case with the pickup lines, as now the pickup lines and responses are kept in the same location.
My intention is to move the data from the arrays into external files. I have successfully done this with "escapes_running" and "escapes_crawling" as a proof of concept (not included), and I hope to have this finished version submitted here in short order.
The notation to be used is ultimately arbitrary, as well as the filenames and locations of the files containing this XML. My standing intention is to use a new separate folder to hold these various custom strings, the "art/custom_string" folder, and have created a new class CustomString to control and manipulate these strings (not included, but based off the CreatureTypes class).
This new class also requires the modification of "game.cpp", "externs.h" and "includes.h". I pulled the source from SVN July 27, and am acting under the assumption these files have not been changed since then, but I intend to post in this thread the exact changes I make in those three files, due to their sensitivity.
The reason I am using a custom class for this purpose, as well as storing the data in XML instead of raw strings, is the occasional logic used in manipulating the data.
A specific example is the death message (paraphrased):
addstr("mutters last words")
if(liberal){ addstr(slogan)}
else if(moderate){ addstr("plague on both your houses")}
else { addstr("better dead than liberal")}
The XML I was using would list the preceding as follows:
<string>
<line>mutters last words</line>
<line2>better dead than liberal<liberal/ = "slogan"><moderate/ = "plague on both your houses"></line2>
</string>
It's not pretty, so I'm open to suggestions for improvement. The plan is to use a separate file for each set of custom strings. One for death messages, one for pickup lines, one for when a character is stunned, one for the custom rejection lines for mutants, one for the custom attacks of judges, etc. There are about 40 of these at my last count.
So yeah, I intend to have a working prototype in the next few days, and if anyone has any pointers, suggestions, or requests I'm happy to hear them.
I do have two questions for anyone able to answer:
1: how do I get the LCS executable's filesize down to the 500KB or so it normally is, rather than the 10MB I keep getting. I'm using Visual C++ 2010 SP1, I opened the project file and have been running everything on its default setting (I'm a Java programmer by trade, I'm not used to C++ yet).
2: How do I link a C++ header file to a C++ source. As it stands I can only get my custom class to compile by placing the source code entirely within the header file, "customstring.h". So far it's ignoring the "customstring.cpp" I also made. Java doesn't have header files, and my textbook gives the unhelpful advice "consult your compiler's documentation."
Thank you for your time.
tldr;
This source code is easier to read (ideally) and easier to modify (ideally) but doesn't change any functionality. I intend add XML files for all the custom strings soon.
Edit:
No more XML, just standard strings, as per advice.
I've updated talk.cpp a little bit, and added interrogation.cpp.
I still haven't got anything for external files, but I expect that's going to all go down at once.
http://www.mediafire.com/download/c094hbdquopncin/talk.cpphttp://www.mediafire.com/download/j7ca23ba8k5tc9b/fight.cpphttp://www.mediafire.com/download/pidz8c3fhcklfpn/interrogation.cpphttp://www.mediafire.com/download/ax3mvqntph9haui/justice.cpp (very few changes, as someone got to it first)
And a dated full rip of the SVN for those interested.
http://www.mediafire.com/download/dz0ue0ixk8nc38x/LCS+Source+20150727.rar