RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Functions to start and end scenes

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 68
RMRK Junior
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: text [Select]
=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:
# http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================
 
 
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