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.

Functions to start and end scenes

This is a very small script that automatizes the start and end of X type of scenes.
You have a start and end scene that call commons events, and active a optional
switch, that you can use to know if in scene or not.

Code:
 =begin

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

# Functions to start and end scenes

# By gerkrt/gerrtunk

# Version: 1.1

# License: MIT, credits

# Date: 30/09/2011

# Look here for updates or more scripts:

# [url=http://usuarios.multimania.es/kisap/english_list.html]http://usuarios.multimania.es/kisap/english_list.html[/url]

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

 

 

This is a very small script that automatizes the start and end of X type of scenes.

You have a start and end scene that call commons events, and active a optional

switch, that you can use to know if in scene or not.

 

Example call script:

 

st_scene 7

 

Call common event configurated to start scene and active switch 7

 

end_scene 7

 

Call common event configurated to end scene and desactive switch 7

 

-You can use the short alias for each one: s_s and e_s, work equals.

-Note that the switch id is optional. If no pased don touch nothing.

 

end_scene

 

=end

 

module Wep

  Event_start_scene = 6 # Common event id that start scene

  Event_end_scene = 7 # Common event id that end scene

end

 

class Interpreter

  

  #--------------------------------------------------------------------------

  # * Start cutscene    

  #--------------------------------------------------------------------------

  def st_scene(sw_id=nil)

    $game_switches[sw_id] = true if sw_id != nil

    $game_temp.common_event_id = Wep::Event_start_scene 

    # Refresh map

    $game_map.need_refresh = true

  end

  

  #--------------------------------------------------------------------------

  # * Start cutscene(short alias)  

  #--------------------------------------------------------------------------

  def s_s(sw_id=nil)

    st_scene(sw_id)

  end

  

  

  #--------------------------------------------------------------------------

  # * End cutscene    

  #--------------------------------------------------------------------------

  def end_scene(sw_id=nil)

    $game_switches[sw_id] = false if sw_id != nil

    $game_temp.common_event_id = Wep::Event_end_scene 

    # Refresh map

    $game_map.need_refresh = true

  end

  

  #--------------------------------------------------------------------------

  # * End cutscene(short alias)  

  #--------------------------------------------------------------------------

  def e_s(sw_id=nil)

    end_scene(sw_id)

  end

  

end

 

 

 

module Wep

  Scripts_list = [] unless defined? Scripts_list

  Scripts_list.push ('Functions to start and end scenes')

end
 

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