Introduction So I was at the request forum once again. I came across link's topic about Cut in from the RPG Tanketai Battle System(found here http://rpgex.sakura.ne.jp/home/ ). Now the problem was, link didn't want the whole script but rather just the "cut in" that shows a picture when a skill is activated. So I took the time to read through the script ( What a pain it was because it was Japanese translated by mbub and kylock) and finally figured it out. It wasn't easy taking this one small feature out of such a massive script. But hey, here it is.
Here's a Sample Screenshot:
Features - Set starting x, y and ending x,y - Add Sound Effects - Set priorities Version 1.1 - No need to set up cutin_wait - Bug fix for bad value range for duration (This error happens because the picture gets disposed while the wait frame is still going)
#============================================================ # Jens009's Cut-In Animation # Version 1.1 # - base from Tanketai SBS http://rpgex.sakura.ne.jp/home/ # Log: # Verison 1.1 # - Removed Wait Frames. # Changed Waiting command to a loop that waits for a cut_in flag # # Special Credits to: Kylock and Mbub # 1.0 Release Date: August 7, 2008 # 1.1 Release Date: August 8, 2008 # # Description: Shows a Battle Cut-In when certain skills are activated # Features: # Set Starting Point(x,y) and Ending point (x,y) # Enable Sound Effects # # How to use: # Step 1: # # First, go to module JENS009_ANIMATION # You have to define your animation here and add the necessary information in # each definition. # The template for the list is: # ANIMATION_NAME = [Start x, Start y, End x, End y, Time, Priority, # File name, Sound, Sound file name] # Start x - Starting X of Picture When Shown # Start y - Starting Y of picture when Shown # Ending x - Ending X of Picture when Shown # Ending x - Ending Y of Picture when Shown # Time- # of Frames before Picture is removed # Priority- true/false, True is above everything, false is below windows # File Name- Picture File Name found in Graphics/Pictures # Sound- true/false, When true, play sound file name. When false, don't play # anything. # Sound File Name- File Name of Sound effect. Only place something here if s # sound is true # Step 2: # # Press Ctrl F and find SkillCheck # 1. Copy and paste these lines: # when 1 # return @spriteset.call_picture(JENS009_ANIMATION::TEST) # 2.Change the 1 to the skill id of your choice # 3.and Change TEST to the name of the animation you want to play from # JENS009_ANIMATION module # # You're all set #=========================================================================
module JENS009_ANIMATION # Template #NAME = [Start x, Start y, End x, End y, Time, High Priority, File Name, #Play sound, Sound File name]
#======================================== # Game_Temp Edit # Add attr_accessor :cut_in # Cut In flag. #========================================= class Game_Temp attr_accessor :cut_in alias jens009_initialize_cut_in initialize def initialize @cut_in = false jens009_initialize_cut_in end end
class Scene_Battle < Scene_Base #===================================== # Scene_Battle Edit #==================================== #==================================== # Define cutin_skill_check # Description: Checks the skill id of activated skill # if the skill id is present, play the cut in #------------------------------------ # SKILL CHECK #==================================== def cutin_skill_check(skill_id) case skill_id when 1 return @spriteset.call_picture(JENS009_ANIMATION::TEST) when 2 return @spriteset.call_picture(JENS009_ANIMATION::TEST_TWO)
end end #==================================== # Define cutin_wait(skill_id) # Description: waits for x amount of frames depending on the value #------------------------------------- # CUTIN_WAIT #=====================================
#================================================= #================================================= # Define Wait For Picture Animation # Continuous loop until cut in flag is false #================================================== def wait_pic while $game_temp.cut_in == true update_basic break if $game_temp.cut_in == false end end
# Start Scene_Battle Method Edits alias jens009_add_cutin_execute_action_skill execute_action_skill
#================================================ # define execute_action_skill #========================================== def execute_action_skill skill = @active_battler.action.skill # Call Skill @help_window = Window_Help.new @help_window.set_text(skill.name) text = "Special!" @message_window.add_instant_text(text) cutin_skill_check(skill.id) #Find Skill id #wait_pic(cutin_wait(skill.id)) # Wait Until Cut in is finished. if $game_temp.cut_in == true wait_pic end jens009_add_cutin_execute_action_skill # Call Original Method @help_window.dispose end # End of Method Edit #================================================
end
#================================================= # Spriteset_Battle edit #================================================ class Spriteset_Battle #================================================= # Start method Edit #================================================= alias jens009_create_pictures create_pictures #================================================== # Initialize Values #=================================================== def create_pictures @picture_time = 0 jens009_create_pictures end
#================================================= # Start Adding new methods #================================================== def call_picture(cutin) @picture = Sprite.new # Picture Starting X and Y pic_x = cutin[0] pic_y = cutin[1] # Picture Ending X and Y pic_end_x = cutin[2] pic_end_y = cutin[3] @picture_time = cutin[4] # Picture Moving Rate by Time @moving_pic_x = (pic_end_x - pic_x)/ @picture_time @moving_pic_y = (pic_end_y - pic_y)/ @picture_time # Picture x and y increase by time plus_x = (pic_end_x - pic_x)% @picture_time plus_y = (pic_end_y - pic_y)% @picture_time # Get Picture @picture.bitmap = Cache.picture(cutin[6]) @picture.x = pic_x + plus_x @picture.y = pic_y + plus_y # Picture's z (priority) @picture.z = 1 # If High Priority, Show picture above everything else @picture.z = 1000 if cutin[5] @picture.visible = true # If Sound is true if cutin[7] == true # Play Sound Effect Audio.se_play("Audio/SE/" + cutin[8]) $game_temp.cut_in = true end end #========================== # update Method edit #========================= alias jens009_update_picture update def update jens009_update_picture update_cut_in if @picture_time > 0 end #======================== # Add new update method #====================== def update_cut_in # Decrease Time @picture_time -= 1 # Move Picture @picture.x += @moving_pic_x @picture.y += @moving_pic_y # If time = 0, dispose of picture if @picture_time == 0 @picture.dispose $game_temp.cut_in = false end end #===================== # End Method Edits #==================== end #=================== # End Class Edit #================
#============================================================ # Jens009's Cut-In Animation # Version 1.0 # - base from Tanketai SBS http://rpgex.sakura.ne.jp/home/ # Special Credits to: Kylock and Mbub # Release Date: August 7, 2008 # Description: Shows a Battle Cut-In when certain skills are activated # Features: # Set Starting Point(x,y) and Ending point (x,y) # Enable Sound Effects # # How to use: # Step 1: # # First, go to module JENS009_ANIMATION # You have to define your animation here and add the necessary information in # each definition. # The template for the list is: # ANIMATION_NAME = [Start x, Start y, End x, End y, Time, Priority, # File name, Sound, Sound file name] # Start x - Starting X of Picture When Shown # Start y - Starting Y of picture when Shown # Ending x - Ending X of Picture when Shown # Ending x - Ending Y of Picture when Shown # Time- # of Frames before Picture is removed # Priority- true/false, True is above everything, false is below windows # File Name- Picture File Name found in Graphics/Pictures # Sound- true/false, When true, play sound file name. When false, don't play # anything. # Sound File Name- File Name of Sound effect. Only place something here if s # sound is true # Step 2: # # Press Ctrl F and find SkillCheck # 1. Copy and paste these lines: # when 1 # return @spriteset.call_picture(JENS009_ANIMATION::TEST) # 2.Change the 1 to the skill id of your choice # 3.and Change TEST to the name of the animation you want to play from # JENS009_ANIMATION module # # Step 3: # # Press Ctrl F and find CUTIN_WAIT # 1. Copy and Paste these lines: # when 1 # return JENS009_ANIMATION::TEST[4] # 2. Change 1 to skill id of your choice # 3. change TEST to animation name of your choice # IMPORTANT: Don't change the number 4 # # You're all set. #=========================================================================
module JENS009_ANIMATION # Template #NAME = [Start x, Start y, End x, End y, Time, High Priority, File Name, #Play sound, Sound File name]
class Scene_Battle < Scene_Base #===================================== # Scene_Battle Edit #==================================== #==================================== # Define cutin_skill_check # Description: Checks the skill id of activated skill # if the skill id is present, play the cut in #------------------------------------ # SKILL CHECK #==================================== def cutin_skill_check(skill_id) case skill_id when 1 return @spriteset.call_picture(JENS009_ANIMATION::TEST) when 2 return @spriteset.call_picture(JENS009_ANIMATION::TEST_TWO)
end end #==================================== # Define cutin_wait(skill_id) # Description: waits for x amount of frames depending on the value #------------------------------------- # CUTIN_WAIT #===================================== def cutin_wait(skill_id) case skill_id when 1 return JENS009_ANIMATION::TEST[4] when 2 return JENS009_ANIMATION::TEST_TWO[4]
end end #================================================= #=================================================
# Start Scene_Battle Method Edits alias jens009_add_cutin_execute_action_skill execute_action_skill
#================================================ # define execute_action_skill #========================================== def execute_action_skill skill = @active_battler.action.skill # Call Skill @help_window = Window_Help.new @help_window.set_text(skill.name) text = "Special!" @message_window.add_instant_text(text) cutin_skill_check(skill.id) #Find Skill id wait(cutin_wait(skill.id)) # Wait Until Cut in is finished. jens009_add_cutin_execute_action_skill # Call Original Method @help_window.dispose end # End of Method Edit #================================================
end
#================================================= # Spriteset_Battle edit #================================================ class Spriteset_Battle #================================================= # Start method Edit #================================================= alias jens009_create_pictures create_pictures #================================================== # Initialize Values #=================================================== def create_pictures @picture_time = 0 jens009_create_pictures end
#================================================= # Start Adding new methods #================================================== def call_picture(cutin) @picture = Sprite.new # Picture Starting X and Y pic_x = cutin[0] pic_y = cutin[1] # Picture Ending X and Y pic_end_x = cutin[2] pic_end_y = cutin[3] @picture_time = cutin[4] # Picture Moving Rate by Time @moving_pic_x = (pic_end_x - pic_x)/ @picture_time @moving_pic_y = (pic_end_y - pic_y)/ @picture_time # Picture x and y increase by time plus_x = (pic_end_x - pic_x)% @picture_time plus_y = (pic_end_y - pic_y)% @picture_time # Get Picture @picture.bitmap = Cache.picture(cutin[6]) @picture.x = pic_x + plus_x @picture.y = pic_y + plus_y # Picture's z (priority) @picture.z = 1 # If High Priority, Show picture above everything else @picture.z = 1000 if cutin[5] @picture.visible = true # If Sound is true if cutin[7] == true # Play Sound Effect Audio.se_play("Audio/SE/" + cutin[8]) end end #========================== # update Method edit #========================= alias jens009_update_picture update def update jens009_update_picture update_cut_in if @picture_time > 0 end #======================== # Add new update method #====================== def update_cut_in # Decrease Time @picture_time -= 1 # Move Picture @picture.x += @moving_pic_x @picture.y += @moving_pic_y # If time = 0, dispose of picture if @picture_time == 0 @picture.dispose end end #===================== # End Method Edits #==================== end #=================== # End Class Edit #================
Customization Refer to the script for instructions
Compatibility Should be compatible for all battle systems.