Advertisement
gerkrt

Skip cutscenes mode

Sep 16th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 16.87 KB | None | 0 0
  1. #==============================================================================
  2. # Skip Cutscenes Mode
  3. # By gerkrt/gerrtunk(main), GreenBanana, wecoc, pacman(some ideas or suggestions),
  4. # sandgolem(some of his script code here)
  5. # Version: 1.1
  6. # License: MIT, credits
  7. # Date: 11/08/2011
  8. # IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
  9. # script check here: http://usuarios.multimania.es/kisap/english_list.html
  10. #==============================================================================
  11.  
  12. =begin
  13.  
  14. ------INTRODUCTION------
  15.  
  16. This script introduce a mode where the cutscene type commands(show message, move
  17. event, etc, show picture, anymation, sounds, etc) dont function so only the
  18. logical and nor graphical options work(battle, changue equip, items, etc).
  19.  
  20. In this way you can use this feature to skip any cutscene using a election or using
  21. a key for this option.
  22.  
  23. Note that you can also use this to test better and very quick your games.
  24.  
  25. -----INSTRUCTIONS---------
  26.  
  27. You have two ways of doing this. First you can call this script to active or
  28. desactivate the cutscene mode:
  29.  
  30. $game_system.skip_cutscene_mode = true
  31.   ---> this activate it
  32.  
  33. $game_system.skip_cutscene_mode = false
  34.   ---> desactivate
  35.  
  36. You can also use a key to active or desactive it in the game maps, you configure
  37. the key in:
  38. Skip_key = Input::A
  39.  
  40. To changue it you have to use the information you configure using f1 ingame,
  41. and changuing the A letter to the you want to use.
  42.  
  43. Note that you can configure a sound for the map option. For default it uses your
  44. database cancel se, but you can use any other se. If you dont want anyone, just
  45. put = false.
  46.  
  47. Finally, note that the mode active/inactive is saved when you save the game and
  48. isnt reseted.
  49.  
  50. -----DEFINING WHAT IS A CUTSCENCE-----
  51.  
  52. You can also make that this mode only works when you want. To make that this mode
  53. works it have to be active this option with a script call:
  54.  
  55. $game_system.is_cutscene = true (you can make = false like the other)
  56.  
  57. Using this you can call this script at the start and the end of a event cutscene,
  58. activing and desactivating it, so it only works there. Note that also the key
  59. changuing dont work if that isnt active.
  60.  
  61. This option is permanent too.
  62.  
  63. -----DEBUG MODE-----
  64.  
  65. You can autoactivate the is_scene atribute in the game when debuging it with
  66. the rpgmaker so you can test the project better. You just dont need to active
  67. that option.
  68.  
  69. If you dont want to use this just set to false:  Use_debug_mode = false
  70.  
  71. -----COMPATIBILITY AND DESACTIVATING THE CUTSCENE KEY OPTION-------
  72.  
  73. This script is incompatible with any script that changues the interpreter in the
  74. way it executes commands.
  75.  
  76. But you can make it compatible with scripts that changue the map too much(normally
  77. it have to work). To do that put Modify_scene_map = false, but you will lose
  78. the key in map feature.
  79.  
  80. =end
  81.  
  82. module Wep
  83.   Use_debug_mode = true
  84.   Skip_key = Input::A
  85.   Skip_SE = '003-System03'
  86.   SKM_Modify_scene_map = true
  87. end
  88.  
  89.  
  90. #==============================================================================
  91. # ** Interpreter
  92. #------------------------------------------------------------------------------
  93. #  This interpreter runs event commands. This class is used within the
  94. #  Game_System class and the Game_Event class.
  95. #==============================================================================
  96.  
  97. class Interpreter
  98.   alias wep_scm_execcom_int execute_command
  99.   #--------------------------------------------------------------------------
  100.   # * Event Command Execution
  101.   # Now it returns all the graphical options when cutscene mode is active to skip
  102.   #--------------------------------------------------------------------------
  103.   def execute_command
  104.     # If last to arrive for list of event commands
  105.     if @index >= @list.size - 1
  106.       # End event
  107.       command_end
  108.       # Continue
  109.       return true
  110.     end
  111.     # Make event command parameters available for reference via @parameters
  112.     @parameters = @list[@index].parameters
  113.     # Branch by command code
  114.     case @list[@index].code
  115.     when 101  # Show Text
  116.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  117.       return command_101
  118.     when 102  # Show Choices
  119.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  120.       return command_102
  121.     when 402  # When [**]
  122.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  123.       return command_402
  124.     when 403  # When Cancel
  125.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  126.       return command_403
  127.     when 103  # Input Number
  128.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  129.       return command_103
  130.     when 104  # Change Text Options
  131.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  132.       return command_104
  133.     when 105  # Button Input Processing
  134.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  135.       return command_105
  136.     when 106  # Wait
  137.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  138.       return command_106
  139.     when 111  # Conditional Branch
  140.       return command_111
  141.     when 411  # Else
  142.       return command_411
  143.     when 112  # Loop
  144.       return command_112
  145.     when 413  # Repeat Above
  146.       return command_413
  147.     when 113  # Break Loop
  148.       return command_113
  149.     when 115  # Exit Event Processing
  150.       return command_115
  151.     when 116  # Erase Event
  152.       return command_116
  153.     when 117  # Call Common Event
  154.       return command_117
  155.     when 118  # Label
  156.       return command_118
  157.     when 119  # Jump to Label
  158.       return command_119
  159.     when 121  # Control Switches
  160.       return command_121
  161.     when 122  # Control Variables
  162.       return command_122
  163.     when 123  # Control Self Switch
  164.       return command_123
  165.     when 124  # Control Timer
  166.       return command_124
  167.     when 125  # Change Gold
  168.       return command_125
  169.     when 126  # Change Items
  170.       return command_126
  171.     when 127  # Change Weapons
  172.       return command_127
  173.     when 128  # Change Armor
  174.       return command_128
  175.     when 129  # Change Party Member
  176.       return command_129
  177.     when 131  # Change Windowskin
  178.       return command_131
  179.     when 132  # Change Battle BGM
  180.       return command_132
  181.     when 133  # Change Battle End ME
  182.       return command_133
  183.     when 134  # Change Save Access
  184.       return command_134
  185.     when 135  # Change Menu Access
  186.       return command_135
  187.     when 136  # Change Encounter
  188.       return command_136
  189.     when 201  # Transfer Player
  190.       return command_201
  191.     when 202  # Set Event Location
  192.       return command_202
  193.     when 203  # Scroll Map
  194.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  195.       return command_203
  196.     when 204  # Change Map Settings
  197.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  198.       return command_204
  199.     when 205  # Change Fog Color Tone
  200.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  201.       return command_205
  202.     when 206  # Change Fog Opacity
  203.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  204.       return command_206
  205.     when 207  # Show Animation
  206.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  207.       return command_207
  208.     when 208  # Change Transparent Flag
  209.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  210.       return command_208
  211.     when 209  # Set Move Route
  212.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  213.       return command_209
  214.     when 210  # Wait for Move's Completion
  215.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  216.       return command_210
  217.     when 221  # Prepare for Transition
  218.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  219.       return command_221
  220.     when 222  # Execute Transition
  221.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  222.       return command_222
  223.     when 223  # Change Screen Color Tone
  224.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  225.       return command_223
  226.     when 224  # Screen Flash
  227.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  228.       return command_224
  229.     when 225  # Screen Shake
  230.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  231.       return command_225
  232.     when 231  # Show Picture
  233.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  234.       return command_231
  235.     when 232  # Move Picture
  236.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  237.       return command_232
  238.     when 233  # Rotate Picture
  239.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  240.       return command_233
  241.     when 234  # Change Picture Color Tone
  242.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  243.       return command_234
  244.     when 235  # Erase Picture
  245.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  246.       return command_235
  247.     when 236  # Set Weather Effects
  248.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  249.       return command_236
  250.     when 241  # Play BGM
  251.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  252.       return command_241
  253.     when 242  # Fade Out BGM
  254.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  255.       return command_242
  256.     when 245  # Play BGS
  257.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  258.       return command_245
  259.     when 246  # Fade Out BGS
  260.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  261.       return command_246
  262.     when 247  # Memorize BGM/BGS
  263.       return command_247
  264.     when 248  # Restore BGM/BGS
  265.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  266.       return command_248
  267.     when 249  # Play ME
  268.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  269.       return command_249
  270.     when 250  # Play SE
  271.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  272.       return command_250
  273.     when 251  # Stop SE
  274.             return if $game_system.skip_cutscene_mode and $game_system.is_cutscene ; return if Wep::Use_debug_mode and $DEBUG and $game_system.skip_cutscene_mode
  275.       return command_251
  276.     when 301  # Battle Processing
  277.       return command_301
  278.     when 601  # If Win
  279.       return command_601
  280.     when 602  # If Escape
  281.       return command_602
  282.     when 603  # If Lose
  283.       return command_603
  284.     when 302  # Shop Processing
  285.       return command_302
  286.     when 303  # Name Input Processing
  287.       return command_303
  288.     when 311  # Change HP
  289.       return command_311
  290.     when 312  # Change SP
  291.       return command_312
  292.     when 313  # Change State
  293.       return command_313
  294.     when 314  # Recover All
  295.       return command_314
  296.     when 315  # Change EXP
  297.       return command_315
  298.     when 316  # Change Level
  299.       return command_316
  300.     when 317  # Change Parameters
  301.       return command_317
  302.     when 318  # Change Skills
  303.       return command_318
  304.     when 319  # Change Equipment
  305.       return command_319
  306.     when 320  # Change Actor Name
  307.       return command_320
  308.     when 321  # Change Actor Class
  309.       return command_321
  310.     when 322  # Change Actor Graphic
  311.       return command_322
  312.     when 331  # Change Enemy HP
  313.       return command_331
  314.     when 332  # Change Enemy SP
  315.       return command_332
  316.     when 333  # Change Enemy State
  317.       return command_333
  318.     when 334  # Enemy Recover All
  319.       return command_334
  320.     when 335  # Enemy Appearance
  321.       return command_335
  322.     when 336  # Enemy Transform
  323.       return command_336
  324.     when 337  # Show Battle Animation
  325.       return command_337
  326.     when 338  # Deal Damage
  327.       return command_338
  328.     when 339  # Force Action
  329.       return command_339
  330.     when 340  # Abort Battle
  331.       return command_340
  332.     when 351  # Call Menu Screen
  333.       return command_351
  334.     when 352  # Call Save Screen
  335.       return command_352
  336.     when 353  # Game Over
  337.       return command_353
  338.     when 354  # Return to Title Screen
  339.       return command_354
  340.     when 355  # Script
  341.       return command_355
  342.     else      # Other
  343.       return true
  344.     end
  345.     wep_scm_execcom_int
  346.   end
  347. end
  348.  
  349. #==============================================================================
  350. # ** Game System
  351. #==============================================================================
  352.  
  353. class Game_System
  354.  
  355.   attr_accessor :skip_cutscene_mode
  356.   attr_accessor :is_cutscene
  357.   alias gs_init_wep_skm initialize
  358.  
  359.   def initialize
  360.     @skip_cutscene_mode = false
  361.     @is_cutscene = false
  362.     gs_init_wep_skm
  363.   end
  364.  
  365. end
  366.  
  367. #==============================================================================
  368. # ** Scene Map
  369. #==============================================================================
  370.  
  371. # Compatibility check
  372. if Wep::SKM_Modify_scene_map
  373.  
  374. class Scene_Map
  375.   alias wep_cutsceneskip_update update
  376.   def update
  377.    
  378.     wep_cutsceneskip_update
  379.     # Skip cutscene
  380.     if $game_system.is_cutscene and Input.trigger?(Wep::Skip_key)
  381.      
  382.       # Use SE
  383.       if Wep::Skip_SE
  384.         #$game_system.se_play(Wep::Skip_SE)
  385.         Audio.se_play("Audio/SE/" + Wep::Skip_SE, 100, 0)
  386.       end
  387.      
  388.       # Operate mode
  389.       if $game_system.skip_cutscene_mode
  390.         $game_system.skip_cutscene_mode = false
  391.       else
  392.         $game_system.skip_cutscene_mode = true
  393.       end
  394.      
  395.     # Debug mode and its active    
  396.     elsif Wep::Use_debug_mode and $DEBUG and Input.trigger?(Wep::Skip_key)
  397.       # Use SE
  398.       if Wep::Skip_SE
  399.         #$game_system.se_play(Wep::Skip_SE)
  400.         Audio.se_play("Audio/SE/" + Wep::Skip_SE, 100, 0)
  401.       end
  402.      
  403.       # Operate mode
  404.       if $game_system.skip_cutscene_mode
  405.         $game_system.skip_cutscene_mode = false
  406.       else
  407.         $game_system.skip_cutscene_mode = true
  408.       end
  409.      
  410.     end
  411.   end
  412. end
  413.  
  414. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement