Missing Function :UpdateTranscriptString ?Turnscripts not happy

Since updating to 5.8 I've noticed that my games Turnscripts are not firing, things like simple turn counters aren't even functioning, After looking up in the forums I found the issue might be this function and decided to fix it, but looking through all the hidden functions It didn't even show up.. Honestly I'm perplexed at this point

Edit: A very clumsy workaround I've gotten is putting the Scripts in the games enter a room section, its not elegant or nice but at least its a temp fix for the key aspects


Have you edited any of the parser scripts?

Turnscripts used to be called by the function RunTurnScripts, which was run by FinishTurn, which was run by the engine immediately before handing control back to the frontend.

However, in 5.8 the engine stopped calling FinishTurn, which is now called by one of the functions HandleCommand or ResolveNextName instead. If you've modified either of those functions, or have them in your game, then you'll be using the 5.7.x version of those functions with the 5.8 version of the engine; resulting in turnscripts not running.

I really can't see UpdateTranscriptString having any effect in this context; as far as I'm aware, it's only called back from JS code. Why do you think it's connected?


That does make more sense..

I don't think I've touched any of those functions at all, I do have finished turn in the functions but it seems to be from the core library

So..that brings up the question of "Fixing" this -Edit to remove crazy idea i tried that didn't even get loading I know I can't just delete the core library, so back to square not quite one but pretty early

edit found the link to what gave me that idea at last
https://textadventures.co.uk/forum/quest/topic/a-tegwysvkqyfbkmwxh0rg/script-on-command-causes-npcs-to-shut-down

as to where I got the other idea, I remember it posted on the forums but can't find it at the moment through my google fu, will keep checking and reply back later


Is there any way I can get around this issue to get the Turnscripts to fire, maybe modifying a function or something to restore the missing functionality.? I've actually tried making a quicky new game with only a basic turn counting script and two moves(Back and forth) and that doesn't even seem to work, It logically seems like it should since the game was started on 5.8 rather than my previous game. Could I have a messed up Core.aslx? Looking at the file code both say version 580

Edit real strange behavior
Okay this is getting curiouser and curiouser, I'm using a simple Turn counting script because those are easy to test, and have discovered it counts when I'm working inside a menu(I have an item that lets the player set name, stats, species, ect) each time its activated the turn gets a plus one. In testing I've moved the item around, works the same way in any of the rooms, eventually further investigation seems that whenever an action has an input typed in triggers a turn while just selecting an item in a menu from a list does not...(nor does moving from room to room

Amendum.. The hyperlink in the main window do not seem to work as well, can use things from the inventory and the like..its annoying and odd... maybe I messed up a feature somewhere


Sorry I'm late to the party.

I messed this part of the code up.

I've been offline for a couple of years, and I just recently found out about this issue.

I came up with a fix that disables all the transcript code and just uses JS.showScrollback() to show the transcript. It completely solves the turn script (and walkthrough) issues.

...but I hadn't seen this post when I came up with that fix.

Whatever code I end up submitting, I will be sure to make saveClearedText set to false by default. (The game I'm testing for someone has tons of text, and it slows down as you go, as you describe here.)


I wonder what's easier on Quest: the transcriptString variable, or saving the cleared text?


I am so sorry my code has these issues. I sincerely apologize for all the stress it has caused everyone.

I'm scouring the forum to find all the data I can concerning this, and I will submit a pull request with the best solution I discover.


Here is UpdateTranscriptString in CoreCommands.aslx:

https://github.com/textadventures/quest/blob/f47a55b960082f559053209e1fbae7366e8f3036/WorldModel/WorldModel/Core/CoreCommands.aslx#L1041-L1044

  <function name="UpdateTranscriptString" parameters="data">
    game.suppressturnscripts = true
    game.transcriptstring = game.transcriptstring + data
  </function>

Based upon this post in the thread to which you linked, we need to remove the first line of that script. And possibly add a call to FinishTurn?

I'm going to test things.

UPDATE

Removing game.suppressturnscripts = true definitely fixes the turn scripts.

Adding JS.eval("saveClearedText=false;") to game.inituserinterface definitely increase performance during play, too.

It still records walkthrough steps as event: UpdateTranscriptString: "[all the HTML that prints to the screen each turn!]"though.

It seems like maybe UpdateTranscriptString should only run during a game save.


I am diligently working on these issues, and I'll be sure to ask smarter and wiser people (especially mrangel and Pixie) to double-check any possible solution(s) before submitting the code.


Log in to post a reply.

Support

Forums