skipping cutscene problems in html5 game question

  • #1, by el_geeFriday, 07. September 2018, 23:46 6 years ago
    Hello!

    I am currently exploring/testing how an online version of my game would work. More specifically through itch.io. 

    However, during gameplay, skipping cutscenes and other esc button functions aren't working. Maybe because the browser is using it for things such as exiting fullscreen? I don't know.

    Anyone know a way of fixing/working around this?

    If possible, preferrably not using the mouse buttons, as they are being used to skip dialog.

    Thanks guys!

    Newbie

    45 Posts


  • #2, by NigecSaturday, 08. September 2018, 10:23 6 years ago
    Yeah it looks like keys are bound to the browser, F1 which brings up my Save menu also opens a new tab (Edge Tips)
    To be honest I would probably add buttons to quit or save, but my roots were Flash so I'd overcompensate

    I've noticed saves only work while you are playing and no preview image

    edit
    quit game seems to cause the player to hang

    Key Killer

    627 Posts

  • #3, by afrlmeSaturday, 08. September 2018, 12:21 6 years ago
    Apparently there's a system function that you can use to skip cutscenes.
    system.skipCutscene()
    I believe that function might have been created for mobile devices so that they could be added to gestures. However, you should be able to bind that to another key - might have to do that via the Lua key event handler though because I'm not sure if the editor key actions will register during a cut-scene.

    Add this to the script section of the editor...
    function keyboardHandler(eventType, character, keycode, modifiers)
      if eventType == eEvtKeyUp then -- on key release
        if character == 'x' and not game.CutsceneAction:isEmpty() then -- if key = x & cutscene is active 
          system.skipCutscene() -- kill the current cutscene
        end
      end
      return false -- key event will also be handled by engine
    end
    
    registerEventHandler("keyEvent", "keyboardHandler")
    Change x to whichever key you want. It has to be a character or number. if you want to use a function key then you will need edit the script a bit &/or replace character with keycode & figure out which keycode belongs to key that you want to listen out for.

    Imperator

    7278 Posts

  • #4, by el_geeSunday, 09. September 2018, 07:24 6 years ago
    Thanks for the reply AFRLme!
    It doesn't seem to work for me though? 
    I might have mistunderstood or be misplacing the text.
    But when I make a script with the given text in the Visionaire Script section - I'm not able to skip the cutscenes.

    Newbie

    45 Posts

  • #5, by afrlmeSunday, 09. September 2018, 12:03 6 years ago
    Is there anything mentioned in the log when you press the key that is to be used for skipping cut-scenes? Is the script set as definition type?

    Imperator

    7278 Posts

  • #6, by el_geeSunday, 09. September 2018, 12:39 6 years ago
    The definition script box is ticked - and when I run the game and try to press x to skip the cutscene, after quitting (without using esc to skip the cutscene), I get:

    12:33:26.239:Engine Version: 5.0.6 (Build 1197 from Build date: Jun 25 2018)
    12:33:26.239:Time needed for preloading game: 14 msec
    12:33:26.239:No config.ini in /Users/laurentgehin/Library/Application Support/VisionaireStudio/STM0006_0219//config.ini
    12:33:26.275:Initializing graphics interface. Surface size: 640x480, render size: 320x240
    12:33:26.282:red, green, blue, alpha, depth size: , doublebuffer , accelerated 
    12:33:26.304:Serialization finished. Needed time: 22 ms
    12:33:26.304:SetupParents finished. Needed time: 0 ms
    12:33:26.304:SortLinks finished. Needed time: 0 ms
    12:33:26.306:Interfaces loaded. Needed time: 1 ms
    12:33:26.307:Blocks loaded. Needed time: 1 ms
    12:33:26.309:Unknown data-field "AnimationFirstFrame" for object (-1,-1) .
    12:33:26.309:49
    12:33:26.309:stack traceback:
     [C]: in function '__newindex'
     [string "(30,2)"]:1: in main chunk
    12:33:26.310:Scripts loaded. Needed time: 4 ms
    12:33:26.310:Time needed for loading game: 71 msec
    12:33:26.311:Illegal polygon border for object 'Tutorial: obj_Intro' (id: 226)
    12:33:26.334:Illegal polygon border for object 'Tutorial: obj_Intro' (id: 226)
    12:33:26.368:no uniform resolution in shader

     

    Newbie

    45 Posts

  • #7, by afrlmeSunday, 09. September 2018, 13:01 6 years ago
    Ah sorry, the key you want to access needs to be written with a capital letter - I haven't used key event handler in a while, so I wasn't sure if it would accept both lowercase & uppercase.

    function keyboardHandler(eventType, character, keycode, modifiers)
      if eventType == eEvtKeyUp then -- on key release
        if character == 'X' and not game.CutsceneAction:isEmpty() then -- if key = x & cutscene is active 
          system.skipCutscene() -- kill the current cutscene
        end
      end
      return false -- key event will also be handled by engine
    end
    
    registerEventHandler("keyEvent", "keyboardHandler")

    Imperator

    7278 Posts

  • #8, by el_geeSunday, 09. September 2018, 14:15 6 years ago
    Thank you again AFRLme!

    It works on the offline versions of the game, 
    but when it's online on itch.io it doesn't seem to recognise it.

    I'll give them a shout, and also try and see how it works with some other game hosting sites.

    Newbie

    45 Posts