Difference between revisions of "PrintToConsole"

Jump to navigation Jump to search
831 bytes added ,  12:11, 15 September 2014
Added suggestions for message prefixing on larger mods, and corrected some spelling and grammar.
imported>Low Post
m
imported>Syscrusher
(Added suggestions for message prefixing on larger mods, and corrected some spelling and grammar.)
 
Line 23: Line 23:
If the mod is complex with several scripts running simultaneously, it can be a good idea to identify the script as well, in order to easily identify where a message is coming from, such as:
If the mod is complex with several scripts running simultaneously, it can be a good idea to identify the script as well, in order to easily identify where a message is coming from, such as:
  printc "RMM|OptionsMenu: the player closed the menu"
  printc "RMM|OptionsMenu: the player closed the menu"
By following the above suggestions you also help the end-user of your mod determine where possible bugs are occuring, as well as to be able to distinguish which mod is printing the various console messages that show up when running multiple mods.
Another option (not mutually exclusive of the preceding) is to identify messages from quest scripts and quest stage result scripts by prefixing them with a short version of the name of the quest. For instance, if Random Modder's Mod has quests RMM Quest 1 and RMM Quest 2, the message might be might be:
printc "RMMQ2: Player defeated secondary boss"
For quest stage result scripts, it can be useful to include the stage number in the prefix, for example:
printc "RMMQ2.115 Player obtained location of cave from town guard"
for Stage 115's result script.
This more elaborate prefixing is most useful for large mods with many scripts and multiple quests. Also, carefully-formatted messages can be especially useful when a mod's beta testers are using one of the various console log capture utilities to keep their logs as text files.
By following the above suggestions you help the end-user of your mod determine where possible bugs are occurring, and they will be able to distinguish which mod is printing the various console messages that show up when running multiple mods.


== Displaying Variables ==
== Displaying Variables ==
Anonymous user

Navigation menu