Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Wicked Transitions., What the tiotle says, it's a script that effects the transitions.
Genshyu
post Jan 2 2009, 10:01 PM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




Creator: Genshyu.
You can add more to your transitions with this script, and it's a plug and play! biggrin.gif. i will give the code, and the demo. But first! Here's a few screeneys ^^.



Demo: http://www.megaupload.com/?d=CW8KZRDW



Here's the screeneys.









Here's the script.

CODE
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs the map screen processing.
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    $game_map.refresh
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
  end
    def create_viewports
    @viewport1 = Viewport.new(0, 0, 544, 416)
    @viewport2 = Viewport.new(0, 0, 544, 416)
    @viewport3 = Viewport.new(0, 0, 544, 416)
    @viewport2.z = 50
    @viewport3.z = 100
  end
  #--------------------------------------------------------------------------
  # * Execute Transition
  #--------------------------------------------------------------------------
  def perform_transition
    if Graphics.brightness == 0       # After battle or loading, etc.
      fadein(30)
    else                              # Restoration from menu, etc.
      Graphics.transition(15)
    end
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    if $scene.is_a?(Scene_Battle)     # If switching to battle screen
      @spriteset.dispose_characters   # Hide characters for background creation
    end
    snapshot_for_background
    @spriteset.dispose
    @message_window.dispose
    if $scene.is_a?(Scene_Battle)     # If switching to battle screen
      perform_battle_transition       # Execute pre-battle transition
    end
  end
  #--------------------------------------------------------------------------
  # * Basic Update Processing
  #--------------------------------------------------------------------------
  def update_basic
    Graphics.update                   # Update game screen
    Input.update                      # Update input information
    $game_map.update                  # Update map
    @spriteset.update                 # Update sprite set.
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    $game_map.interpreter.update      # Update interpreter
    $game_map.update                  # Update map
    $game_player.update               # Update player
    $game_system.update               # Update timer
    @spriteset.update                 # Update sprite set
    @message_window.update            # Update message window
    unless $game_message.visible      # Unless displaying a message
      update_transfer_player
      update_encounter
      update_call_menu
      update_call_debug
      update_scene_change
    end
  end
  #--------------------------------------------------------------------------
  # * Fade In Screen
  #     duration : time
  #    If you use Graphics.fadeout directly on the map screen, a number of
  #    problems can occur, such as weather effects and parallax  scrolling
  #    being stopped. So instead, perform a dynamic fade-in.
  #--------------------------------------------------------------------------
  def fadein(duration)
    Graphics.transition(0)
    for i in 0..duration-1
      Graphics.brightness = 255 * i / duration
      update_basic
    end
    Graphics.brightness = 255
  end
  #--------------------------------------------------------------------------
  # * Fade Out Screen
  #     duration : time
  #    As with the fadein above, Graphics.fadein is not used directly.
  #--------------------------------------------------------------------------
  def fadeout(duration)
    Graphics.transition(0)
    for i in 0..duration-1
      Graphics.brightness = 255 - 255 * i / duration
      update_basic
    end
    Graphics.brightness = 0
  end
  #--------------------------------------------------------------------------
  # * Player Transfer  Processing
  #--------------------------------------------------------------------------
  def update_transfer_player
    return unless $game_player.transfer?
    fade = (Graphics.brightness > 0)
    fadeout(30) if fade
    @spriteset.dispose              # Dispose of sprite set
    $game_player.perform_transfer   # Execute player transfer
    $game_map.autoplay              # Automatically switch BGM and BGS
    $game_map.update
    Graphics.wait(15)
    @spriteset = Spriteset_Map.new  # Recreate sprite set
    fadein(30) if fade
    Input.update
  end
  #--------------------------------------------------------------------------
  # * Encounter Processing
  #--------------------------------------------------------------------------
  def update_encounter
    return if $game_player.encounter_count > 0        # Check steps
    return if $game_map.interpreter.running?          # Event being executed?
    return if $game_system.encounter_disabled         # Encounters forbidden?
    troop_id = $game_player.make_encounter_troop_id   # Determine troop
    return if $data_troops[troop_id] == nil           # Troop is invalid?
    $game_troop.setup(troop_id)
    $game_troop.can_escape = true
    $game_temp.battle_proc = nil
    $game_temp.next_scene = "battle"
    preemptive_or_surprise
  end
  #--------------------------------------------------------------------------
  # * Determine Preemptive Strike and Surprise Attack Chance
  #--------------------------------------------------------------------------
  def preemptive_or_surprise
    actors_agi = $game_party.average_agi
    enemies_agi = $game_troop.average_agi
    if actors_agi >= enemies_agi
      percent_preemptive = 5
      percent_surprise = 3
    else
      percent_preemptive = 3
      percent_surprise = 5
    end
    if rand(100) < percent_preemptive
      $game_troop.preemptive = true
    elsif rand(100) < percent_surprise
      $game_troop.surprise = true
    end
  end
  #--------------------------------------------------------------------------
  # * Determine if Menu is Called due to Cancel Button
  #--------------------------------------------------------------------------
  def update_call_menu
    if Input.trigger?(Input::B)
      return if $game_map.interpreter.running?        # Event being executed?
      return if $game_system.menu_disabled            # Menu forbidden?
      $game_temp.menu_beep = true                     # Set SE play flag
      $game_temp.next_scene = "menu"
    end
  end
  #--------------------------------------------------------------------------
  # * Determine Bug Call Due to F9 key
  #--------------------------------------------------------------------------
  def update_call_debug
    if $TEST and Input.press?(Input::F9)    # F9 key during test play
      $game_temp.next_scene = "debug"
    end
  end
  #--------------------------------------------------------------------------
  # * Execute Screen Switch
  #--------------------------------------------------------------------------
  def update_scene_change
    return if $game_player.moving?    # Is player moving?
    case $game_temp.next_scene
    when "battle"
      call_battle
    when "shop"
      call_shop
    when "name"
      call_name
    when "menu"
      call_menu
    when "save"
      call_save
    when "debug"
      call_debug
    when "gameover"
      call_gameover
    when "title"
      call_title
    else
      $game_temp.next_scene = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Switch to Battle Screen
  #--------------------------------------------------------------------------
  def call_battle
    @spriteset.update
    Graphics.update
    $game_player.make_encounter_count
    $game_player.straighten
    $game_temp.map_bgm = RPG::BGM.last
    $game_temp.map_bgs = RPG::BGS.last
    RPG::BGM.stop
    RPG::BGS.stop
    Sound.play_battle_start
    $game_system.battle_bgm.play
    $game_temp.next_scene = nil
    $scene = Scene_Battle.new
  end
  #--------------------------------------------------------------------------
  # * Switch to Shop Screen
  #--------------------------------------------------------------------------
  def call_shop
    $game_temp.next_scene = nil
    $scene = Scene_Shop.new
  end
  #--------------------------------------------------------------------------
  # * Switch to Name Input Screen
  #--------------------------------------------------------------------------
  def call_name
    $game_temp.next_scene = nil
    $scene = Scene_Name.new
  end
  #--------------------------------------------------------------------------
  # * Switch to Menu Screen
  #--------------------------------------------------------------------------
  def call_menu
    if $game_temp.menu_beep
      Sound.play_decision
      $game_temp.menu_beep = false
    end
    $game_temp.next_scene = nil
    $scene = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # * Switch to Save Screen
  #--------------------------------------------------------------------------
  def call_save
    $game_temp.next_scene = nil
    $scene = Scene_File.new(true, false, true)
  end
  #--------------------------------------------------------------------------
  # * Switch to Debug Screen
  #--------------------------------------------------------------------------
  def call_debug
    Sound.play_decision
    $game_temp.next_scene = nil
    $scene = Scene_Debug.new
  end
  #--------------------------------------------------------------------------
  # * Switch to Game Over Screen
  #--------------------------------------------------------------------------
  def call_gameover
    $game_temp.next_scene = nil
    $scene = Scene_Gameover.new
  end
  #--------------------------------------------------------------------------
  # * Switch to Title Screen
  #--------------------------------------------------------------------------
  def call_title
    $game_temp.next_scene = nil
    $scene = Scene_Title.new
    fadeout(60)
  end
  #--------------------------------------------------------------------------
  # * Execute Pre-battle Transition
  #--------------------------------------------------------------------------
  def perform_battle_transition
        source = Cache.system("Special")
    bitmap = Cache.system("Special")
    bitmap.stretch_blt(bitmap.rect, source, source.rect)
    bitmap.radial_blur(9, 9)
    @Swirl_effect = Sprite.new
    @Swirl_effect.bitmap = Cache.system("Special")
    @Swirl_effect.x = 0
    @Swirl_effect.y = 0
    Graphics.transition(80, "Graphics/System/BattleStart", 80)
    @Swirl_effect.opacity -= 9
  end
end


You will need to put this picture in the "Graphics/System" folder in order to make it work.


This post has been edited by Genshyu: Jan 4 2009, 03:19 PM
Reason for edit: Placed in Spoilers by jens009.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   
Valnar
post Jan 3 2009, 02:32 AM
Post #2


Level 4
Group Icon

Group: Member
Posts: 47
Type: Developer
RM Skill: Masterful




Whould be good to put the Script in a Spoiler because the post get kinda long with the script like that,but a else a nice script !

This post has been edited by Valnar: Jan 3 2009, 02:36 AM


__________________________
Memories....
http://avalnar.co.cc/ - PHP;HTML;CSS;SQL;PS;TOP Tutorials and Sources

Go to the top of the page
 
+Quote Post
   
Genshyu
post Jan 3 2009, 02:37 AM
Post #3


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




QUOTE (Valnar @ Jan 3 2009, 02:32 AM) *
Whould be good to put the Script in a Spoiler because the post get kinda long with the script like that,but a else a nice script !

Lol I tried but it just said there was an error with the BB code XD. But yeah, thanks ^^.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   
GuyInTraining
post Jan 3 2009, 04:27 PM
Post #4


Aiming for 999999 graze points on UFO
Group Icon

Group: Revolutionary
Posts: 244
Type: Artist
RM Skill: Intermediate




Quick Questions:
1. Did you make this script yourself? If so, I encourage you to put your name (Forum name is enough)
in this script because I didn't see one. This is for your own protection against plagiarism, you know? mellow.gif

2. Can I use a homemade Battle Transition graphic instead of the one you gave?
If yes, how do I use it?

But first....

Thanks for sharing! biggrin.gif


__________________________

Forever!

Signature
Userbars


Play with Tokari!


Charming Miscellany




Go to the top of the page
 
+Quote Post
   
Azuaya
post Jan 3 2009, 08:48 PM
Post #5


Random Wanderer
Group Icon

Group: Revolutionary
Posts: 157
Type: Scripter
RM Skill: Beginner




@GuyInTraining: As for answering your second question, there are two ways:

1. You can rename your "BattleStart" graphic name to "Special" (without quotes)
OR
2. Go to the script and look for this line (located near bottom):
CODE
@Swirl_effect.bitmap = Cache.system("Special")

Change the "Special" to "BattleStart"

@Topic Creator: Good job in creating a graphic enhancement script. Not many do those nowadays well just running out of ideas i guess.

This post has been edited by Azuaya: Jan 3 2009, 08:52 PM


__________________________
I wander around the RPG Maker VX forums to help others in need... if I'm bothered.

Go to the top of the page
 
+Quote Post
   
GuyInTraining
post Jan 4 2009, 03:06 PM
Post #6


Aiming for 999999 graze points on UFO
Group Icon

Group: Revolutionary
Posts: 244
Type: Artist
RM Skill: Intermediate




Alright, that worked.
Thanks both of you, Azuaya and Genshyu! thumbsup.gif


__________________________

Forever!

Signature
Userbars


Play with Tokari!


Charming Miscellany




Go to the top of the page
 
+Quote Post
   
Genshyu
post Jan 4 2009, 03:22 PM
Post #7


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




QUOTE (GuyInTraining @ Jan 3 2009, 04:27 PM) *
Quick Questions:
1. Did you make this script yourself? If so, I encourage you to put your name (Forum name is enough)
in this script because I didn't see one. This is for your own protection against plagiarism, you know? mellow.gif

2. Can I use a homemade Battle Transition graphic instead of the one you gave?
If yes, how do I use it?

But first....

Thanks for sharing! biggrin.gif

Yes you can, just replace the "BattleStart" With yours, and if you want to make the blue screen different, the replace "Special" with yours biggrin.gif. The name "Special.png" is in the System folder.

QUOTE (Azuaya @ Jan 3 2009, 08:48 PM) *
@GuyInTraining: As for answering your second question, there are two ways:

1. You can rename your "BattleStart" graphic name to "Special" (without quotes)
OR
2. Go to the script and look for this line (located near bottom):
CODE
@Swirl_effect.bitmap = Cache.system("Special")

Change the "Special" to "BattleStart"

@Topic Creator: Good job in creating a graphic enhancement script. Not many do those nowadays well just running out of ideas i guess.

Hehe, thanks ^^ Just helpin the fans of RMVX biggrin.gif.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   

Reply to this 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 May 2013 - 03:26 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker