Text Skipping Protection

From The Official Visionaire Studio: Adventure Game Engine Wiki
Name Type By
Text Skipping Protection Definition AFRLme (& others)

This script keeps the user from skipping character and narration texts accidentally by deactivating the cursor for a small amount of time when a text appears.

Note that this script is no longer needed. In version 5.3 Visionaire included the option "Delay between text skips" in the Game Properties.


Instructions

Add the main script to the Visionaire Studio Script Editor and set the script as a definition script.


Main Script

-- Prevent accidental text skipping
function delaySkipText(text)
  if not text.Background then
    game.AlwaysAllowSkipText = false
      
    if game.HideCursor == false and game.CutsceneAction:isEmpty() then
      game.HideCursor = true
    
      setDelay(300, function() game.AlwaysAllowSkipText = true; game.HideCursor = false end)
    else
      setDelay(300, function() game.AlwaysAllowSkipText = true end)
    end
  end
end

registerEventHandler("textStarted", "delaySkipText")