Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Functions to start and end scenes
gerrtunk
post Oct 1 2011, 09:28 AM
Post #1


Level 5
Group Icon

Group: Member
Posts: 71
Type: None
RM Skill: Undisclosed




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.

text
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
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 08:33 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker