Open KVonGit opened 6 years ago
This is the function that is missing when playing online:
// SaveTranscript added by KV to write/append to GAMENAME-transcript.html in Documents\Quest Transcripts
function SaveTranscript(data) {
data = data + "<style>*{color:black !important;background:white !important;text-align:left !important}</style>";
if (!webPlayer && transcriptString != '') { UIEvent("SaveTranscript", data); }
transcriptString += data;
}
I added that to desktopplayer.js, but I'm pretty sure that I should have added it to WebPlayer\player.js as well.
I have been working diligently for about two weeks to come up with the best overall solution for the transcript issues I introduced in Quest 5.8.0.
When enabling the transcript online, the game completely crashes. This is because I added a SaveTranscript()
function to Player\desktop.js, but I failed to add its online counterpart to WebPlayer\player.js.
After enabling the transcript in the desktop player, the turn scripts all cease firing until the transcript is disabled.
Also, when recording a walkthrough while the transcript is enabled, each step recorded is the HTML output from each turn.
There is also "scrollback" functionality that was introduced in Quest 5.8.0.
The clearScreen()
function was modified to hide all the text rather than deleting it when saveClearedText
is true
(which is the default). If saveClearedText
is false
, clearScreen()
uses its old method (deleting all the cleared text).
So, by default, all that text is being saved and slowing the game down exponentially each turn.
saveClearedText
in PlayerController\playercore.js is now set to false
by default.
game.notranscript
false
by defaulttrue
game.ingametranscript
false
by defaulttrue
game.writetranscripttofile
false
by defaultSaveTranscript()
to write to an HTML file in "Documents\Quest Transcripts\" while the player has the transcript enabled while this is true
game.transcriptenabled
false
by defaultThis gets set to true
when the player enables the transcript. If game.notranscript
is not true
, this allows both writing to file and the in-game transcript, neither, or whichever is set to true
Core InitInterface
has a bit that sets JS gameName
and transcriptName
Core HandleCommand
modified to add player's command to transcript if game.echocommand
is false
CoreFunctions ShowMenuResponse
modified to add player's command to transcript if game.echocommand
is false
CoreCommands view_transcript_cmd
CoreCommands transcript_on_cmd
CoreCommands transcript_off_cmd
CoreFunctions DisableTranscript()
game.transcriptenabled
to false
, JS transcriptEnabled
to false
, and JS saveClearedText
to false
CoreFunctions KillTranscript()
game.nostranscript
to true
, game.ingametranscript
to false
, game.writetranscripttofile
to false
, JS writingTranscriptToFile
to false
, JS inGameTranscript
to false
, JS noTranscript
to true
, and runs DisableTranscript
CoreFunctions ClearHtmlTranscript
JS.eval("saveClearedText = false; $('.clearedScreen').remove(); transcriptString = '';")
PlayerController\playercore.js addText()
SaveTranscript()
if writingTranscriptToFile
PlayerController\playercore.js clearScreen()
game.ingametranscript
and saveClearedText
are true
PlayerController\playercore.js showScrollback()
game.ingametranscript
and inGameTranscript
are true
Player\desktop.js SaveTranscript()
game.transcriptenabled
and game.writetranscripttofile
(and JS writingTranscriptToFile
and transcriptEnabled
)WebPlayer\player.js SaveTranscript()
PlayerController\playercore.js default booleans:
var writingTranscriptToFile = false;
var inGameTranscript = false;
var transcriptEnabled = false;
var noTranscript = false;
CoreEditorGame has an added checkbox for the transcript, and a tab if that box is checked
Player\PlayerHTML.vb has modified code to fix the issue with using the transcript name entered by the player when enabling the transcript
CoreCommands - UpdateTranscriptString()
[gone]
game.transcriptstring
string [gone]
game.savetranscript
boolean [sort of replaced with game.ingametranscript
]
JS - savingTranscript
boolean [replaced with inGameTranscript
and saveClearedText
]
JS - transcriptString
string [gone]
JS - replaceTranscriptString()
[gone]
JS - showTranscript()
[replaced by showScrollback()
]
JS - printTranscriptDiv()
[replaced by printScrollback()
]
I tested this extensively, to the best of my ability. I found three or four forum threads concerning all the different issues during debugging and testing, and I made sure all those issues were addressed.
I ran the web player from Visual Studio to test everything out as well. Here is a PDF of the transcript: NewTranscriptTester1-transcript.pdf
NOTE: I could not actually test saving the game, but it seemed to make it all the way to end until it found that I was not logged into the site.
I also ran the web editor from VS, just to make sure the new Transcript editor controls looked okay.
I'll submit a pull request in the morning. (I would wait to post this, too, but I don't want to lose all this. It took much longer to write than I expected, haha.)
Enabling a transcript online crashes (freezes) the game.
I seem to remember writing code to handle online transcripts in a dialog popup, but it was long ago and I'm not positive my recollection is correct.