Turnscripts broken by updating to 5.8.0


I've been developing a game in version 5.6.2 for a while. I recently updated to 5.8.0 and one of the things that has changed is that turnscripts don't seem to work anymore. I can see in the debugger that they are being activated (a "turnscript" object is being created), but the "turncount" never ticks up to the requisite number; it's always stuck at 0.

So I'm completely confused by all of this. I honestly don't even know where to start.

Source code is here (warning, the game is NSFW): https://drive.google.com/file/d/1RcBx4a0iwne9aFFc2kGsMR1BUSgkPnfW/view?usp=sharing

I appreciate it.

Turnscripts changed in 5.8 - they now count the number of commands the player has entered, rather than the number of times the Quest backend has passed control to the javascript frontend for user input. (This means that turnscripts no longer count turns where the player is selecting an option from a disambiguation menu, or where the player enters an invalid command)

This is a major change.

In Quest up to 5.7.2, the engine calls FinishTurn directly as soon as all scripts have finished and the engine is ready to wait for a player response.

In 5.8 and later, this no longer happens. Instead, there have been modifications to some of the core functions, specifically HandleCommand, ResolveNextName, and ResolveNameFromList, which call FinishTurn after running a command.

Your ASL version in the game header is 580, so FinishTurn will not be magically called by the engine. However, your game appears to include the versions of HandleCommand from the Quest 5.7.2 core library, which do not call the function FinishTurn directly.

It seems that a lot of the core functions are included directly in your game file, overriding the functions included from the core files. Therefore you are using the 5.8 engine with an older version of the core libraries.

Have you modified the functions FinishCommand, HandleCommand, ResolveNextName, and ResolveNameFromList? If so, you will need to compare your versions to the originals, and then make the same modifications based on the Quest 5.8 versions of those functions.

If you haven't modified those functions, deleting the copy that's in your game should cause Quest to use the default versions from the core libraries.

There may be other issues caused by having copies of the old functions from a previous version of Quest; but the four I listed are (I think) the only ones related to the turnscript problem.

I think I ran through and deleted all the extra functions from the old libraries because I thought that was the issue, but that didn't seem to fix the issue. I dunno how all those functions ended up in the game file, but I'm gonna go through and delete them again I guess? Anything else I should delete?

OH yeah I remember why that didn't work. When I deleted all the old functions I got this error when playing: https://i.imgur.com/vVTJ7IJ.png

That looks like conflicts between different bits of 5.8 and older code.

Specifically, if you remove the function ProcessTextCommand so that it is replaced by the current version from the core libraries, you will need to do the same with the type defaultgame.

Similarly, the commands take and drop need to be the same version as the parser, because Quest recently changed how multiple commands (ones which allow the player to enter a list of items) are implemented.

I suspect that at some point in the past, you've recovered your game by editing the game.aslx file from a published game; in which case your file will include all of the core libraries. In that case, you;ll have an awful lot of functions, types, and commands which are copied straight from the core libraries; which means that you're using those parts of the version of Quest it was originally published with, which might not work so well with the current version of the engine.

Yeahhhh, I've done that in the past. Is there like a block of text I can copy into a new file to "refresh" it? I've tried deleting all the verbs/commands/functions manually but I must have missed some

[post edited to fix link]
I don't think there's an easy way to do it.

I've written a quick shell script to make a list of all the types, functions, commands, and verbs in the core libraries.

Running that script, your game includes the following blocks which also exist in the 5.7.2 or 5.8 libraries:

Click to expand the liist
  • command:ask
  • command:close
  • command:drop
  • command:give
  • command:givesingle
  • command:go
  • command:help
  • command:inventory
  • command:jump
  • command:lie
  • command:look
  • command:lookat
  • command:lookdir
  • command:oops
  • command:open
  • command:put
  • command:quit
  • command:removefrom
  • command:save
  • command:sit
  • command:sleep
  • command:take
  • command:tell
  • command:undo
  • command:use
  • command:useon
  • command:wait
  • command:xyzzy
  • function:AddDescriptionLine
  • function:AddExternalStylesheet
  • function:AddStatusAttributesForElement
  • function:AddToInventory
  • function:AddToResolvedNames
  • function:AllKeysAvailable
  • function:Ask
  • function:CanReachThrough
  • function:CanSeeThrough
  • function:ChangePOV
  • function:CheckDarkness
  • function:ClearFramePicture
  • function:ClearMenu
  • function:ClearScreen
  • function:CloneObject
  • function:CloneObjectAndMove
  • function:CloseObject
  • function:CommandLink
  • function:CompareNames
  • function:ContainsAccessible
  • function:ContainsReachable
  • function:ContainsVisible
  • function:CreateGiveMenuList
  • function:CreateUseMenuList
  • function:DecreaseHealth
  • function:DecreaseObjectCounter
  • function:DecreaseScore
  • function:DiceRoll
  • function:DisableTimer
  • function:DisableTurnScript
  • function:DisplayHttpLink
  • function:DisplayList
  • function:DisplayMailtoLink
  • function:DoAskTell
  • function:DoDrop
  • function:DoTake
  • function:EnableTimer
  • function:EnableTurnScript
  • function:EndOutputSection
  • function:FinishTurn
  • function:FormatExitList
  • function:FormatObjectList
  • function:FormatStatusAttribute
  • function:GenerateMenuChoices
  • function:GetBlockingObject
  • function:GetCoordinateOwner
  • function:GetCurrentFontFamily
  • function:GetCurrentLinkTextFormat
  • function:GetCurrentTextFormat
  • function:GetDisplayAlias
  • function:GetDisplayName
  • function:GetDisplayNameLink
  • function:GetDisplayVerbs
  • function:GetExitsList
  • function:GetKeywordsMatchStrength
  • function:GetLinkTextColour
  • function:GetListDisplayAlias
  • function:GetNonTransparentParent
  • function:GetPlacesObjectsList
  • function:GetRoomDescription
  • function:GetVolume
  • function:Got
  • function:GridSquareClick
  • function:Grid_AddNewShapePoint
  • function:Grid_CalculateMapCoordinates
  • function:Grid_ClearCustomLayer
  • function:Grid_DrawArrow
  • function:Grid_DrawGridLines
  • function:Grid_DrawImage
  • function:Grid_DrawLine
  • function:Grid_DrawPlayerInRoom
  • function:Grid_DrawRoom
  • function:Grid_DrawShape
  • function:Grid_DrawSquare
  • function:Grid_DrawSvg
  • function:Grid_GetGridCoordinateForPlayer
  • function:Grid_GetPlayerCoordinateDictionary
  • function:Grid_GetPlayerCoordinatesForRoom
  • function:Grid_GetRoomBooleanForPlayer
  • function:Grid_LoadSvg
  • function:Grid_Redraw
  • function:Grid_SetCentre
  • function:Grid_SetGridCoordinateForPlayer
  • function:Grid_SetRoomBooleanForPlayer
  • function:Grid_SetScale
  • function:Grid_ShowCustomLayer
  • function:HandleCommand
  • function:HandleGiveTo
  • function:HandleMenuTextResponse
  • function:HandleMultiVerb
  • function:HandleNextCommandQueueItem
  • function:HandleSingleCommand
  • function:HandleSingleCommandPattern
  • function:HandleUseOn
  • function:HelperCloseObject
  • function:HelperOpenObject
  • function:HideOutputSection
  • function:HidePreviousTurnOutput
  • function:IncreaseHealth
  • function:IncreaseObjectCounter
  • function:IncreaseScore
  • function:InitInterface
  • function:InitPOV
  • function:InitStatusAttributes
  • function:InitUserInterface
  • function:InitVerbsList
  • function:IsSwitchedOn
  • function:JS_GridSquareClick
  • function:ListObjectContents
  • function:ListParents
  • function:LockExit
  • function:Log
  • function:MakeExitInvisible
  • function:MakeExitVisible
  • function:MakeObjectInvisible
  • function:MakeObjectVisible
  • function:MapPOVCoordinate
  • function:MapPOVCoordinates
  • function:MergePOVCoordinates
  • function:MoveObject
  • function:MoveObjectHere
  • function:ObjectLink
  • function:OnEnterRoom
  • function:OpenObject
  • function:OutputText
  • function:OutputTextNoBr
  • function:OutputTextRaw
  • function:OutputTextRawNoBr
  • function:Pause
  • function:PrintCentered
  • function:ProcessTextCommand
  • function:ProcessTextCommand_Command
  • function:ProcessTextCommand_Counter
  • function:ProcessTextCommand_Exit
  • function:ProcessTextCommand_GetNextLinkId
  • function:ProcessTextCommand_If
  • function:ProcessTextCommand_Img
  • function:ProcessTextCommand_Object
  • function:ProcessTextCommand_Once
  • function:ProcessTextCommand_Random
  • function:ProcessTextCommand_RandomAlias
  • function:ProcessTextCommand_Select
  • function:ProcessTextSection
  • function:RandomChance
  • function:RemoveDarkObjects
  • function:RemoveLookOnlyExits
  • function:RemoveObject
  • function:RemoveSceneryObjects
  • function:ResolveName
  • function:ResolveNameInternal
  • function:ResolveNameList
  • function:ResolveNameListItem
  • function:ResolveNameListItemFinished
  • function:ResolveNextName
  • function:ResolveNextNameListItem
  • function:RunTurnScripts
  • function:ScopeCommands
  • function:ScopeExits
  • function:ScopeExitsForRoom
  • function:ScopeInventory
  • function:ScopeReachable
  • function:ScopeReachableForRoom
  • function:ScopeReachableInventory
  • function:ScopeReachableNotHeld
  • function:ScopeReachableNotHeldForRoom
  • function:ScopeVisible
  • function:ScopeVisibleForRoom
  • function:ScopeVisibleLightsource
  • function:ScopeVisibleNotHeld
  • function:ScopeVisibleNotHeldForRoom
  • function:ScopeVisibleNotHeldNotScenery
  • function:ScopeVisibleNotHeldNotSceneryForRoom
  • function:ScopeVisibleNotReachable
  • function:ScopeVisibleNotReachableForRoom
  • function:SetAlignment
  • function:SetBackgroundColour
  • function:SetBackgroundImage
  • function:SetBackgroundOpacity
  • function:SetDark
  • function:SetExitLightstrength
  • function:SetFontName
  • function:SetFontSize
  • function:SetForegroundColour
  • function:SetFramePicture
  • function:SetLight
  • function:SetObjectFlagOff
  • function:SetObjectFlagOn
  • function:SetObjectLightstrength
  • function:SetTimeout
  • function:SetTimeoutID
  • function:SetTimerInterval
  • function:SetTimerScript
  • function:SetTurnScript
  • function:SetTurnTimeout
  • function:SetTurnTimeoutID
  • function:SetWebFontName
  • function:ShowMenu
  • function:ShowMenuResponse
  • function:ShowRoomDescription
  • function:ShowVimeo
  • function:ShowYouTube
  • function:StartGame
  • function:StartNewOutputSection
  • function:StartTurnOutputSection
  • function:SwitchOff
  • function:SwitchOn
  • function:TextFX_Typewriter
  • function:TextFX_Typewriter_Internal
  • function:TextFX_Unscramble
  • function:TextFX_Unscramble_Internal
  • function:TryOpenClose
  • function:Tsplit
  • function:UIOptionUseGameColours
  • function:UIOptionUseGameFont
  • function:UnlockExit
  • function:UnresolvedCommand
  • function:UpdateObjectLinks
  • function:UpdateStatusAttributes
  • function:WaitForKeyPress
  • type:compassdirection
  • type:container
  • type:container_base
  • type:container_closed
  • type:container_limited
  • type:container_lockable
  • type:container_open
  • type:defaultcommand
  • type:defaultexit
  • type:defaultgame
  • type:defaultobject
  • type:defaultplayer
  • type:defaultverb
  • type:direction
  • type:downdirection
  • type:eastdirection
  • type:edible
  • type:female
  • type:femaleplural
  • type:gridborder_path_e
  • type:gridborder_path_ew
  • type:gridborder_path_n
  • type:gridborder_path_ns
  • type:gridborder_path_s
  • type:gridborder_path_w
  • type:indirection
  • type:inoutdirection
  • type:male
  • type:maleplural
  • type:namedfemale
  • type:namedmale
  • type:northdirection
  • type:northeastdirection
  • type:northwestdirection
  • type:openable
  • type:outdirection
  • type:plural
  • type:southdirection
  • type:southeastdirection
  • type:southwestdirection
  • type:surface
  • type:theme_hotdogstand
  • type:theme_novella
  • type:theme_retro
  • type:theme_typewriter
  • type:updirection
  • type:updowndirection
  • type:westdirection
  • verb:lieon

I've made a copy of your game with all of the functions/objects/types/commands/verb from the list above removed. You can find it here - You might need to look through the list, to see if you've actually modified any of these while working on the game (in which case you might need to look at the version in the Quest 5.8 libraries and make the same modifications there)

I also note that it didn't match all the verbs. So, for example, your game has verbs named speak (in your file) and speakto (from the core 5.8 libraries) which probably do the same thing. I don't think this will cause a problem; and removing them automatically would be a pain because the names seem to have changed at some point.

Holy hell, this is actually super helpful. I am pretty sure I didn't modify anything like that, but this is a great start. Thank you so much!!

If it's not too much trouble, can you run this through that script as well? It's an older version of the game but I fucked up and opened it in 5.8.0 so now it has the same problems. I'd gladly pay for the help you've provided, this game has over 1200 copies sold so you're like a lifesaver lol


If it's not too much trouble, can you run this through that script as well? It's an older version of the game but I fucked up and opened it in 5.8.0 so now it has the same problems. I'd gladly pay for the help you've provided, this game has over 1200 copies sold so you're like a lifesaver lol

Mostly the same functions removed.
This one also seems to contain a lot of the templates from English.aslx. I'm not sure if any of these are used, but I removed only the ones that are different. Here's a list of the ones that remain, so you can look at what's changed and make sure they look right:

Click to expand
  • Template SelfAlt is different
    • Quest 5.8 English.aslx has: me; myself; self
    • hotelsourcev115.txt has: myself; self
  • Template not in English.aslx: CompassDirectionPrefix
  • Template not in English.aslx: CompassDirectionSuffix
  • Template not in English.aslx: UpDownDirectionPrefix
  • Template not in English.aslx: UpDownDirectionSuffix
  • Template not in English.aslx: InOutDirectionPrefix
  • Template not in English.aslx: InOutDirectionSuffix
  • Template not in English.aslx: CompassInShort
  • Template not in English.aslx: lookat
  • Template not in English.aslx: take
  • Template not in English.aslx: drop
  • Template not in English.aslx: use
  • Template not in English.aslx: speakto
  • Template not in English.aslx: open
  • Template not in English.aslx: close
  • Template put is different
    • Quest 5.8 English.aslx has: .*) (on|in|on to|in to|into) (?
    • hotelsourcev115.txt has: .*) (on|in) (?
  • Template removefrom is different
    • Quest 5.8 English.aslx has: .*) (from|out of|off|out) (?
    • hotelsourcev115.txt has: .*) from (?
  • Template not in English.aslx: buy
  • Template not in English.aslx: climb
  • Template not in English.aslx: drink
  • Template not in English.aslx: eat
  • Template not in English.aslx: givesingle
  • Template not in English.aslx: hit
  • Template not in English.aslx: kill
  • Template not in English.aslx: kiss
  • Template not in English.aslx: knock
  • Template not in English.aslx: lick
  • Template not in English.aslx: lie
  • Template not in English.aslx: listento
  • Template not in English.aslx: lock
  • Template not in English.aslx: move
  • Template not in English.aslx: pull
  • Template not in English.aslx: push
  • Template not in English.aslx: read
  • Template not in English.aslx: search
  • Template not in English.aslx: show
  • Template not in English.aslx: sit
  • Template not in English.aslx: smell
  • Template not in English.aslx: taste
  • Template not in English.aslx: throw
  • Template not in English.aslx: tie
  • Template not in English.aslx: touch
  • Template not in English.aslx: turnon
  • Template not in English.aslx: turnoff
  • Template not in English.aslx: turn
  • Template not in English.aslx: unlock
  • Template not in English.aslx: untie
  • Template not in English.aslx: wear
  • Template LanguageSpecificObjectTypes is different
    • Quest 5.8 English.aslx has: masculine=Inanimate object (masculine); feminine=Inanimate object (feminine);
    • hotelsourcev115.txt has:
  • Template ObjectNotOpen is different
    • Quest 5.8 English.aslx has: CapFirst(GetDefiniteName(object)) + " " + Conjugate(object, "be") + " not open."
    • hotelsourcev115.txt has: CapFirst(GetDisplayAlias(object)) + " " + Conjugate(object, "be") + " not open."
  • Template DefaultListenTo is different
    • Quest 5.8 English.aslx has: "You listen, but " + object.gender + " makes no sound."
    • hotelsourcev115.txt has: "You listen, but " + object.article + " makes no sound."
  • Template DefaultSmell is different
    • Quest 5.8 English.aslx has: "You sniff, but " + object.gender + " doesn't smell of much."
    • hotelsourcev115.txt has: "You sniff, but " + object.article + " doesn't smell of much."

The file with all the core stuff stripped out is on my site at https://mrangel.info/hotelsourcev115.stripped2.txt

Hope that helps :)

I get this error whenever I load the file up: https://i.imgur.com/rrN8v6u.png // never mind, fixed

That's an odd error. defaultverb is defined in the file CoreTypes.aslx. Did I accidentally strip out the line <include ref="Core.aslx"/>?

Good to know it's fixed :)

Looking at those templates, I suspect you don't really need most of them. All you've got is stuff like "Box is not open" (your version) rather than "The box is not open" (new in 5.8) when the player tries to put something in a closed container; or some commands that now understand more expressions (like 5.8 allows "put bunny into box" as a synonym for "put bunny in box")

Log in to post a reply.