SCRIPT ON command causes NPCs to shut down

Hello! I tried looking this up in forums to see if anyone else ever had problems with it, but nothing turned up in my search.

So after releasing my game "HAWK THE HUNTER," a reviewer found that when he used the command SCRIPT ON to get a transcript of his gaming session, it caused the NPCs to stop functioning. I think it interferes with turnscripts. I had to put a prominent warning into my game portal, so that Quest would work properly.

Has anyone else ever heard of this happening? Is there a workaround?


It is definitely messing up the turn scripts, not just for NPCs.


Is this a build in command? Try to deactivate it


I think this could be a result of changing the way turnscripts fire in 5.8.

Every time text is added to the output, there's a javascript callback using ASLEvent, to the function UpdateTranscriptString. This function looks like:

    game.suppressturnscripts = true
    game.transcriptstring = game.transcriptstring + data

It suppresses turnscripts so that every line of output printed doesn't count as an extra turn for turn-counting scripts and similar.

But because of the changes in 5.8, turnscripts no longer run in response to ASLEvent calls. So the "suppressturnscripts" stays in effect until the next time the player takes a turn, causing the turnscripts not to run.

I think that if you remove the game.suppressturnscripts = true line from that function, transcripts will behave properly.

(And on a side note, if you are calling any functions using ASLEvent, note that the sidebars, verb menus, etc. will no longer be updated as of Quest 5.8; so if you're calling a script from ASLEvent you will need to run FinishTurn manually to avoid the display getting out of sync)


Thanks for looking into this! What you say makes sense. I just don't know how to access either ASLEvents or the function UpdateTranscriptString. I guess if I could, it would behoove me to fix it, then do innumerable walk-through's to make sure that this change would not then mess up something else deep within my code. It's hard to know how changes on this scale will affect the rest of the programming. I think my game is fairly large, and I'm not sure if it's worth risking other unforeseen errors.

If there were a sure-fire fix or feature that I was simply overlooking, I'd do it. I can understand an experienced player wanting a transcript of their game sessions, so I would much rather have Quest all set up properly for them, instead of my welcome page having to display a dire warning about how the SCRIPT ON command will cause the game not to work, which some people will interpret as the game being buggy on my side of things instead of it being a systemic error.

It's definitely something for me to look into, possibly to incorporate into a subsequent update to the game. Thanks so much!


If you're on the desktop editor, I believe there's an option to show hidden objects and functions. One of the hidden functions in your game will be UpdateTranscriptString. You can then remove the offending line. I'm afraid I can't offer further guidance, because I use the web editor (on which this fix is harder).

Using the web editor, you can't modify core functions. But you can override JS functions. So you'd need to make a new function in Quest, call it something like Modified_UpdateTranscriptString, with a single parameter data and the script simply game.transcriptstring = game.transcriptstring + data.

Then you'd have a modified version of the addText JS function. The javascript would be:

function addText(text) {
    if (getCurrentDiv() == null) {
        createNewDiv("left");
    }
    if (savingTranscript) {
        SaveTranscript(text);
        ASLEvent("Modified_UpdateTranscriptString", text);
    }
    getCurrentDiv().append(text);
    $("#divOutput").css("min-height", $("#divOutput").height());
}

Which you can install by putting the following line in your UI Initialisation script:

JS.eval("$(function(){addText=function(t){null==getCurrentDiv()&&createNewDiv('left'),savingTranscript&&(SaveTranscript(t),ASLEvent('Modified_UpdateTranscriptString',t)),getCurrentDiv().append(t),$('#divOutput').css('min-height',$('#divOutput').height())}});")

Yeah! Here you will learn what is important, it gives you a link to an interesting site page: 8 ball pool


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums