Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Cutscene Skipping

I just remembered that this isn't the latest version, expect an update later that's even cooler when I can figure out where I put my usb drive. That's the problem with posting scripts 8 months after you make them. :)

--

SG Cutscene Skip
Version: 1

Introduction
An old script I'd like to see used more often, allows players to skip cutscenes in your game.

Features
  • Effect changes & move routes will still happen even if the cutscene is skipped
  • Optional settings for playtest mode only & showing an image when a scene can be skipped

Script
Code:
#==========================================================================
# ** SG Cutscene Skip
#==========================================================================
# sandgolem 
# Version 1
# 5.02.07
#==========================================================================

SG_CutsceneSkip_Image = false
SG_CutsceneSkip_Key = Input::A
SG_CutsceneSkip_TestOnly = false

#==========================================================================

if Object.const_defined?('SDK')
  SDK.log('SG Cutscene Skip', 'sandgolem', 1, '5.02.07')
  @sg_cutsceneskip_disabled = true if !SDK.state('SG Cutscene Skip')
end

@sg_cutsceneskip_disabled = true if SG_CutsceneSkip_TestOnly && !$DEBUG

if !@sg_cutsceneskip_disabled
#--------------------------------------------------------------------------

class Game_Temp
  attr_accessor :sg_cutscene
  attr_accessor :sg_skipcutscene
end

class Game_Character
  attr_accessor :move_route_index
  attr_accessor :move_speed
  attr_accessor :sg_cs_oldthrough
  attr_accessor :sg_cs_oldmovespeed
  attr_accessor :through
  attr_accessor :wait_count
  attr_accessor :sg_csmove_skipping
  
  alias_method :sandgolem_cutsceneskip_moving, :moving?
  def moving?
    return false if @sg_csmove_skipping
    return sandgolem_cutsceneskip_moving
  end
end

class Interpreter
  alias_method :sandgolem_cutsceneskip_com101, :command_101
  def command_101
    sg = sandgolem_cutsceneskip_com101
    if $game_temp.sg_skipcutscene
      @message_waiting = false 
      $game_temp.message_text = nil
    end
    return sg
  end

  alias_method :sandgolem_cutsceneskip_com106, :command_106
  def command_106
    sandgolem_cutsceneskip_com106
    @wait_count = 0 if $game_temp.sg_skipcutscene
    return true
  end

  alias_method :sandgolem_cutsceneskip_com201, :command_201
  def command_201
    sg = sandgolem_cutsceneskip_com201
    $game_temp.transition_processing = false if $game_temp.sg_skipcutscene
    return sg
  end
    
  alias_method :sandgolem_cutsceneskip_com209, :command_209
  def command_209
    sandgolem_cutsceneskip_com209
    return if !$game_temp.sg_skipcutscene
    character = get_character(@parameters[0])
    if character != nil
      sg = @parameters[1].list.size
      character.sg_csmove_skipping = true
      character.sg_cs_oldmovespeed = character.move_speed
      character.sg_cs_oldthrough = character.through
      character.through = true
      character.move_speed = 5000
      for i in 0...sg
        character.move_type_custom
        character.update_move
        character.move_route_index += 1
        character.wait_count = 0
        case @parameters[1].list[i].code
        when 29
          character.move_speed = 5000
          character.sg_cs_oldmovespeed = @parameters[1].list[i].parameters[0]
        when 37
          character.sg_cs_oldthrough = true
        when 38
          character.through = true
          character.sg_cs_oldthrough = false
        end
      end
      character.through = character.sg_cs_oldthrough
      character.move_speed = character.sg_cs_oldmovespeed      
      character.sg_csmove_skipping = nil
    end
    return true
  end

  alias_method :sandgolem_cutsceneskip_com210, :command_210
  def command_210
    sandgolem_cutsceneskip_com210
    @move_route_waiting = false if $game_temp.sg_skipcutscene
    return true
  end  
end

class Scene_Map
  alias_method :sandgolem_cutsceneskip_update, :update
  def update
    sandgolem_cutsceneskip_update
    if $game_temp.sg_cutscene && Input.trigger?(SG_CutsceneSkip_Key)
      $game_system.se_play($data_system.cancel_se)
      $game_temp.sg_skipcutscene = true
      if $game_temp.message_text
        @message_window.terminate_message
      end
      Graphics.freeze      
    end
  end
end

def sg_cutscene
  $game_temp.sg_cutscene = Sprite.new
  if SG_CutsceneSkip_Image
    $game_temp.sg_cutscene.bitmap = RPG::Cache.title(SG_CutsceneSkip_Image)
  end
end

def sg_cutsceneend
  $game_temp.sg_cutscene.dispose if $game_temp.sg_cutscene
  $game_temp.sg_cutscene = nil
  return if !$game_temp.sg_skipcutscene
  $game_temp.transition_processing = true
  $game_temp.transition_name = ""
  $game_temp.sg_skipcutscene = nil
  Graphics.transition(0)
end

#--------------------------------------------------------------------------
else
  class Interpreter
    def sg_cutscene
    end
  
    def sg_cutsceneend
    end
  end  
end

Instructions
Script goes somewhere above main, under the other default scripts.

SG_CutsceneSkip_Image = false
SG_CutsceneSkip_Image = 'skip'

Put a file name into this line (see example above) if you'd like an image to be shown during cutscenes. The image would be loaded from your Titles directory and needs transparency/possibly full resulation as it shows at 0x0.

SG_CutsceneSkip_TestOnly = false

Set this to true if you only want skipping enabled in playtest mode.

SG_CutsceneSkip_Key = Input::A

Change this line if you'd like a different button set to skip. Input::A is the shift key.

This script also requires adding call scripts before & after your cutscenes.
Place this when your cutscene starts:

sg_cutscene

Place this when your cutscene ends:

sg_cutsceneend

Please TEST this yourself by skipping your scenes, every single one of them you add it to. There may be oddities depending on which event commands you use! If it doesn't work right, don't let people skip that scene or stop the skipping part before the conflicting area.

Near the bottom of the script you can also add different sounds & a neato skipped transition if you want.

Compatability
The script currently should ignore move route delays, show text, wait for move completion, map change transitions & wait. Have not tested with SDK 2+. Skimming through it move routes may be flawed a bit depending on what commands you used in it, I'll update that area eventually.

Really, really long events skipped may require an edit. I'll post how to do this if it ever comes up.

Misc

1 - Commercial licensing is available: $5 for the average person, $25 if you have a high quality game which will be on major portal sites or in stores. Please wait to see if there's any new bugs first though - this script wasn't mass publicly available before & I probably made it while half asleep. Any $ spent this way will go towards people who've spent long hours working on free games I liked asking for donations, the Master of the Wind folks first.

2 - You can release any enhanced versions of this script as long as you attempt to fix any bugs that crop up, keep me in the credits (& say that it was based/edited on my original script), and freely allow people who've licensed the script to use your added features commercially.

I won't be adding new things unless someone with a license wants a change, however I'll try to give support if you run into problems. New features can easily be added yourself if you know how to script the interpreter area. :)
 
I think it just makes it so you have a normal little thing in your game and you call a script that makes it so you can skip it and it goes to the next part, i think
 

Zelos

Member

Could anyone tell me where in this script the line with "When button A is pressed..." is?
I don't know anything about RGSS, but I work with UMS and want to set this script call when a button is pressed:  $game_system.text_mode = ALL_AT_ONCE
And this one when the skip ends:
$game_system.text_mode = ONE_LETTER_AT_A_TIME

Including this just into sg_cutscene doesn't work...then it skips the text immediately when I call the first script.
I just want the text box just to shut down when the skipbutton is pressed...at the moment it waits until the last letter of the message is written and then skips. That's not what I want...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top