Non-Uninterruptible cutscenes (SOLVED in V5 only)

  • #1, z brut69Saturday, 20. May 2017, 13:24 hodinky 7 years ago
    Is there a way to disallow the player to skip cutscenes by clicking the ESC button?


    ps

    I am on V4 since V5 is buggy for me

    Čestný člen

    266 Posts


  • #2, z sebastianSaturday, 20. May 2017, 14:35 hodinky 7 years ago
    you could add this as a definition script:

    function keyboardHandler(eventType, character, keycode, modifiers)
      if not Conditions["k_esc"].ConditionValue and keycode == eKeyEscape then return true
      end 
    end
    
    registerEventHandler("keyEvent", "keyboardHandler")


    Before i start cutscenes i set the condition "k_esc" to false and afterwards to true.

    Kapitán

    2346 Posts

  • #3, z brut69Saturday, 20. May 2017, 16:08 hodinky 7 years ago
    you could add this as a definition script:

    function keyboardHandler(eventType, character, keycode, modifiers)
      if not Conditions["k_esc"].ConditionValue and keycode == eKeyEscape then return true
      end 
    end
    
    registerEventHandler("keyEvent", "keyboardHandler")


    Before i start cutscenes i set the condition "k_esc" to false and afterwards to true.
    Doesn't work on V4 but thank you though
    I get this error:

    Warning: Unsupported event 'keyEvent'.
    5:06:24 PM: [string "Script0"]:7: Failed to execute command registerEventHandler
    5:06:24 PM: stack traceback:
     [string "Script0"]:10: in function 
     [C]: in function 'registerEventHandler'
     [string "Script0"]:7: in function 
     [C]: in function 'xpcall'
     [string "Script0"]:1: in main chunk

    Čestný člen

    266 Posts

  • #4, z sebastianSaturday, 20. May 2017, 16:25 hodinky 7 years ago
    this should work in V4 (i used it since 4.2 - it should work since 3.6)... There must be something else missing/wrong... 
    Maybe add a "return false" before the last "end"


    Do you have already a keyboard handler script in your project?

    If you look up keyboard handler you will find some more topics related to it.

    Kapitán

    2346 Posts

  • #5, z brut69Saturday, 20. May 2017, 16:47 hodinky 7 years ago
    this should work in V4 (i used it since 4.2 - it should work since 3.6)... There must be something else missing/wrong... 
    Maybe add a "return false" before the last "end"


    Do you have already a keyboard handler script in your project?

    If you look up keyboard handler you will find some more topics related to it.

    It works on 5 though (just tested).

    Čestný člen

    266 Posts

  • #6, z brut69Sunday, 21. May 2017, 13:06 hodinky 7 years ago
    Just tried this : 

    function keyboardHandler(eventType, character, keycode, modifiers)
    
    
    
      if keycode == eKeyEscape then
    
       
        return true
    
      end
    
      return false  
    end 
     
    Which is a simpler version of what you wrote above ... Still not working 
    The "keyEvent" is not recognised in 4.01 even though it says that it should work from 3.6
    This it he only script that I have btw. I deleted the other ones for testing purposes
    Here is the Log file :

    registerEventHandler("keyEvent", "keyboardHandler")
    2:02:45 PM: Engine Version: 4.0.1 (Build 1173 from Build date: Aug 12 2014)
    2:02:45 PM: Time needed for preloading game: 14 msec
    2:02:45 PM: Initializing graphics interface. Surface size: 1920x1080, render size: 1920x1080
    2:02:45 PM: Using Framebuffer with texture.
    2:02:46 PM: red, green, blue, alpha, depth size: , doublebuffer , accelerated
    2:02:46 PM: Serialization finished. Needed time: 33 ms
    2:02:46 PM: SetupParents finished. Needed time: 1 ms
    2:02:46 PM: SortLinks finished. Needed time: 0 ms
    2:02:46 PM: Interfaces loaded. Needed time: 20 ms
    2:02:46 PM: Warning: Unsupported event 'keyEvent'.
    2:02:46 PM: [string "Script0"]:11: Failed to execute command registerEventHandler
    2:02:46 PM: stack traceback:
     [string "Script0"]:14: in function
     [C]: in function 'registerEventHandler'
     [string "Script0"]:11: in function
     [C]: in function 'xpcall'
     [string "Script0"]:1: in main chunk

    Čestný člen

    266 Posts

  • #7, z afrlmeSunday, 21. May 2017, 14:04 hodinky 7 years ago
    No, registerEventHandler might have been added in 3.6, but keyEvent wasn't added until some point in 4.x. I don't remember which version, but probably around 4.1 or 4.2 maybe? I forget, sorry.

    Imperátor

    7285 Posts

  • #8, z sebastianSunday, 21. May 2017, 14:44 hodinky 7 years ago
    I would not bet that there will be a fix for this VS4.X in any way...
    Maybe there is a workaround for older versions.

    Kapitán

    2346 Posts

  • #9, z afrlmeSunday, 21. May 2017, 14:53 hodinky 7 years ago
    I would not bet that there will be a fix for this VS4.X in any way...
    Maybe there is a workaround for older versions.
    Yes, there is. Use hide/show cursor wrapper instead of begin/end cutscene wrappers as cursor one can't be skipped with ESC - it actually kills all key input, though texts can still be skipped by left clicking if you enabled the option for it inside of the game properties tab.

    Imperátor

    7285 Posts

  • #10, z MachtnixSunday, 21. May 2017, 15:05 hodinky 7 years ago
    What about putting (kann man das sagen? *lol*) an action to stop animations into the "esc"-button?

    Kapitán

    1097 Posts

  • #11, z brut69Sunday, 21. May 2017, 15:15 hodinky 7 years ago
    I would not bet that there will be a fix for this VS4.X in any way...
    Maybe there is a workaround for older versions.
    Yes, there is. Use hide/show cursor wrapper instead of begin/end cutscene wrappers as cursor one can't be skipped with ESC - it actually kills all key input, though texts can still be skipped by left clicking if you enabled the option for it inside of the game properties tab.

    Cool! I will try that and let you know

    Čestný člen

    266 Posts