1. create a condition somewhere & name it:
disable_esc.
2. Add the script below to the script section.
-- * function used to disable the escape key (prevents skipping of cut-scenes etc) * --
function keyboardHandler(eventType, character, keycode, modifiers)
if Conditions["disable_esc"].ConditionValue == true and keycode == eKeyEscape then return true end
return false
end
registerEventHandler("keyEvent", "keyboardHandler")
3. Before executing a display text action, add a change condition action part, link it to disable_esc & set to true. Alternatively you could create some textStarted & textStopped event listeners to automatically disable esc each time a text is displayed & enable it when a text stops.
function txtStart(text)
Conditions["disable_esc"].ConditionValue = true
end
function txtStop(text)
Conditions["disable_esc"].ConditionValue = false
end
registerEventHandler("textStarted", "txtStart")
registerEventHandler("textStopped", "txtStop")
... should work.
P.S: there is actually an option in the game tab for determining if key actions are allowed to be executed when text is displayed. I think esc will still work either way as it defaults as a cancel key during cutscenes, videos & texts, if I remember correctly.