CoffeeScript VNM snippets that don't deserve their own thread

Discussion in 'Visual Novel Maker Plugins and Extensions' started by Archeia, Apr 25, 2018.

  1. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,564
    Likes Received:
    14,246
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Share snippets.
    No questions allowed. Just post in the support forum if you need help.

    [​IMG]

    Add Right Click -> Cancel to Backlog
    • Copy and Paste Template_MessageBacklog
    • Look for this line:
      Code:
      "frame": [0, 0, Graphics.width, Graphics.height]
    • Add this code below it:
      Code:
      "action": { "event": "onCancel", "name": "disposeControl", "params": 'backlog' }
    [​IMG]
    Disable Escape Key
    • Go to Script Editor and look for: Components > Scenes > Component_GameSceneBehavior
    • Below that, make a new script and add the following code:
    Code:
    # ===================================================================
    #
    #   Script: Component_GameSceneBehavior
    #
    #   $$COPYRIGHT$$
    #
    # ===================================================================
    class Component_CustomGameSceneBehavior extends vn.Component_GameSceneBehavior
        ###*
        * Checks for the shortcut to exit the game. By default, this is the escape-key. You
        * can override this method to change the shortcut.
        *
        * @method updateQuitShortcut
        * @protected
        ###  
        updateQuitShortcut: ->
     
    vn.Component_GameSceneBehavior = Component_CustomGameSceneBehavior
    It should look like this:
    upload_2018-4-25_2-30-2.png

    [​IMG]
    Disable Settings Shortcut Key
    • Go to Script Editor and look for: Components > Scenes > Component_GameSceneBehavior
    • Below that, make a new script and add the following code:
    Code:
    # ===================================================================
    #
    #   Script: Component_GameSceneBehavior
    #
    #   $$COPYRIGHT$$
    #
    # ===================================================================
    class Component_CustomGameSceneBehavior extends vn.Component_GameSceneBehavior
        ###*
        * Checks for the shortcut to open the Settings menu by Pressing A and disables it.
        * You can override this method to change the shortcut.
        *
        * @method updateSettingsShortcut
        * @protected
        ###    
          updateSettingsShortcut: ->
          # Do nothing
    vn.Component_GameSceneBehavior = Component_CustomGameSceneBehavior
    It should look like this:
    2018-05-04_4-34-26.png

    [​IMG]

    Disable Settings and Quit Shortcut Keys
    Code:
    # ===================================================================
    #
    #   Script: Component_GameSceneBehavior
    #
    #   $$COPYRIGHT$$
    #
    # ===================================================================
    class Component_CustomGameSceneBehavior extends vn.Component_GameSceneBehavior
        ###*
        * Disables shortcut keys for settings and quitting. By default these are the
        * A and ESC keys. You can override this method to change the shortcut.
        *
        * @method updateQuitShortcut
        * @protected
        ###    
          updateQuitShortcut: ->
          # Do nothing
     
        ###*
        * @method updateSettingsShortcut
        * @protected
        ###    
          updateSettingsShortcut: ->
          # Do nothing
    vn.Component_GameSceneBehavior = Component_CustomGameSceneBehavior
    
    It should look like this:
    2018-05-04_4-40-49.png
     
    Last edited: May 4, 2018
    #1

Share This Page