LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



View previous topic View next topic Go down Message [Page 1 of 1]

Morderator
Morderator
#1 [RMXP] Classic Zelda Screen Transitions
Loading

albertfish

avatar
Morderator
Morderator
Morderator
profile
Hello, this is a script that I have wanted to create for a few days now and decided to quickly throw it together. This script mimics the screen transitions found in the 2D Zelda games. Instead of making several small (20x15) maps and teleporting between them, you can now just make a large map and let this script do the rest!

Here is what the script looks like:
[You must be registered and logged in to see this link.]

Note that everything you saw there was one map.

Here is the script.
Spoiler:
Code:
#==============================================================================
# ** Classic Zelda Screen Transitions
#------------------------------------------------------------------------------
# * Created by: albertfish
# * Version: 1.0
# * Last edited: September 7, 2010
#------------------------------------------------------------------------------
#  Version History:
#    Version 1.0: September 7, 2010
#      - Initial release
#------------------------------------------------------------------------------
#  Description:
#    This script mimics the screen transitions found in the 2D Zelda Games.
#------------------------------------------------------------------------------
#  Features:
#    - Separeated a large map in to small screen size parts and adds a smooth
#      transition between the parts.
#------------------------------------------------------------------------------
#  Install Instructions:
#    Place this script above the main script and below the default scripts.
#==============================================================================

#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc.
#  It's used within the Scene_Map class.
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias af_czst_ssm_init initialize
  def initialize
    @x = ($game_player.x - $game_player.x % 20) * 128
    @y = ($game_player.y - $game_player.y % 15) * 128
    @amount_x = 0
    @amount_y = 0
    @scrolling = false
    @prev_x = $game_player.x
    @prev_y = $game_player.y
    $game_map.display_x = @x
    $game_map.display_y = @y
    af_czst_ssm_init
  end
  #--------------------------------------------------------------------------
  # * Scroll Right
  #--------------------------------------------------------------------------
  def scroll_right
    @x += 128
    @amount_x -= 1
    if @amount_x <= 0
      @scrolling = false
    end
  end
  #--------------------------------------------------------------------------
  # * Scroll Left
  #--------------------------------------------------------------------------
  def scroll_left
    @x -= 128
    @amount_x += 1
    if @amount_x >= 0
      @scrolling = false
    end
  end
  #--------------------------------------------------------------------------
  # * Scroll Up
  #--------------------------------------------------------------------------
  def scroll_up
    @y -= 96
    @amount_y -= 1
    if @amount_y <= 0
      @scrolling = false
    end
  end
  #--------------------------------------------------------------------------
  # * Scroll Down
  #--------------------------------------------------------------------------
  def scroll_down
    @y += 96
    @amount_y += 1
    if @amount_y >= 0
      @scrolling = false
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias af_czst_ssm_update update
  def update
    if !@scrolling
      # Determine if the screen needs to scroll left or right
      if $game_player.x % 20 == 0 && ($game_player.x - 19) * 128 > $game_map.display_x
        @amount_x = 20
        @scrolling = true
        @prev_x += 1
      elsif $game_player.x % 20 == 19 && ($game_player.x) * 128 < $game_map.display_x
        @amount_x = -20
        @scrolling = true
        @prev_x -= 1
      end
      # Determine if the screen needs to scroll up or down
      if $game_player.y % 15 == 0 && ($game_player.y - 14) * 128 > $game_map.display_y
        @amount_y = -20
        @scrolling = true
        @prev_y += 1
      elsif $game_player.y % 15 == 14 && ($game_player.y) * 128 < $game_map.display_y
        @amount_y = 20
        @scrolling = true
        @prev_y -= 1
      end
    else @scrolling
      # Scroll either left or right
      if @amount_x > 0
        scroll_right
      elsif @amount_x < 0
        scroll_left
      end
      # Scroll either up or down
      if @amount_y < 0
        scroll_down
      elsif @amount_y > 0
        scroll_up
      end
      $game_player.x = @prev_x
      $game_player.y = @prev_y
    end
    $game_map.display_x = @x
    $game_map.display_y = @y
    @prev_x = $game_player.x
    @prev_y = $game_player.y
    af_czst_ssm_update
  end
end
class Game_Character
  def x=(x)
    @x = x
  end
  def y=(y)
    @y = y
  end
end

I have plans to make it so that you can create events that only execute when they are on the screen. This will make it easy to play different music or sounds based on where you are on the map.
Morderator
Show Signature


<'))))><
Morderator
Administrator
Administrator
#2 Re: [RMXP] Classic Zelda Screen Transitions
Loading

G@MeF@Ce

avatar
Administrator
Administrator
Administrator
profile
@albertfish - don't tell me... you just whipped this one up Razz

nice! I'm so going to use this!

thanks for sharing ^,^
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
Morderator
Morderator
#3 Re: [RMXP] Classic Zelda Screen Transitions
Loading

albertfish

avatar
Morderator
Morderator
Morderator
profile
Thanks, I actually really like how it turned out. Only seeing small sections of the map at one time it very cool when adding puzzles.

Also, using the grid with a size 20x15 is great for mapping while using this script.
Morderator
Show Signature


<'))))><
Morderator
ACTIVATED
ACTIVATED
#4 Re: [RMXP] Classic Zelda Screen Transitions
Loading

nhokbutchi6

ACTIVATED
ACTIVATED
ACTIVATED
profile
Can I use this for XAS? silent
ACTIVATED
Show Signature
ACTIVATED
Morderator
Morderator
#5 Re: [RMXP] Classic Zelda Screen Transitions
Loading

albertfish

avatar
Morderator
Morderator
Morderator
profile
Yes, you should be able to. If you find any bugs when using this with other scripts just let me know.
Morderator
Show Signature


<'))))><
Morderator
EVENTALIST
EVENTALIST
#6 Re: [RMXP] Classic Zelda Screen Transitions
Loading

mr_wiggles

avatar
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Nice albert fish im sure that alot of zelda fans will love this in tehre fan based games
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#7 Re: [RMXP] Classic Zelda Screen Transitions
Loading

Reala

avatar
Active Member
Active Member
Active Member
profile
how do i make it more than 20 by 15 for a transition
Active Member
Show Signature
Active Member
Morderator
Morderator
#8 Re: [RMXP] Classic Zelda Screen Transitions
Loading

albertfish

avatar
Morderator
Morderator
Morderator
profile
Reala wrote:how do i make it more than 20 by 15 for a transition
I'm not exactly sure what you are asking. You want to walk farther that 20x15 and then have the screen transition? How far are you planning on walking before the transition?
Morderator
Show Signature


<'))))><
Morderator
Active Member
Active Member
#9 Re: [RMXP] Classic Zelda Screen Transitions
Loading

Reala

avatar
Active Member
Active Member
Active Member
profile
My game is a platformer so i say 200x15(yes 200)
Active Member
Show Signature
Active Member
Morderator
Morderator
#10 Re: [RMXP] Classic Zelda Screen Transitions
Loading

albertfish

avatar
Morderator
Morderator
Morderator
profile
Well, at that point I would just create multiple maps and transition between the maps. This script was build so that you can make a large map that gets segmented into small screen sized chunks.

What you are asking is possible, however it will require some heavy modification to the code. Also, each chunk of the map has to be the same size for this to work.

I might be able to make this effect work when teleporting between two maps. I can look into that because that seems like it would be much easier to do.
Morderator
Show Signature


<'))))><
Morderator
Active Member
Active Member
#11 Re: [RMXP] Classic Zelda Screen Transitions
Loading

Reala

avatar
Active Member
Active Member
Active Member
profile
kk, cuz the 20 by 15 is too small for my game.
Active Member
Show Signature
Active Member
Morderator
Morderator
#12 Re: [RMXP] Classic Zelda Screen Transitions
Loading

albertfish

avatar
Morderator
Morderator
Morderator
profile
I will probably just edit this script so you can change the segment size.
Morderator
Show Signature


<'))))><
Morderator
Active Member
Active Member
#13 Re: [RMXP] Classic Zelda Screen Transitions
Loading

Reala

avatar
Active Member
Active Member
Active Member
profile
I tried but idk what means what, i cnt script. :/
Active Member
Show Signature
Active Member
Global Moderator
Global Moderator
#14 Re: [RMXP] Classic Zelda Screen Transitions
Loading

swoop

avatar
Global Moderator
Global Moderator
Global Moderator
profile
fantastic addition mr fish!! very clean!!
Global Moderator
Show Signature


"be the change you wish to see in the world~ ghandi"


[You must be registered and logged in to see this link.]
Global Moderator
http://creatureofopinions.blogspot.com/
ACTIVATED
ACTIVATED
#15 Re: [RMXP] Classic Zelda Screen Transitions
Loading

Baffou

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
Hello, i want to say this script is really good, the transition
is exactly what i need for my game. I'm using XAS 3.91 with it and it works fine.
The only thing i don't like it's the maps are not treated like a real map.
It is possible to restore the events erased and the enemys (or maybe in adding some switches and variables between the transitions) to make them more like "real" maps?

Also is there a possible way to keep the transitions mechanisms between the transfer to the other real maps? maybe in adding the previous tileset with the new one or something like that.
I know this maybe difficult, but the scripts is very good, with some more adjustments it may be perfect.
ACTIVATED
Show Signature
ACTIVATED
ACTIVATED
ACTIVATED
#16 VX ACE version
Loading

Wicket

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
Is there a VX ACE version of this?
ACTIVATED
Show Signature
ACTIVATED
Morderator
Morderator
#17 Re: [RMXP] Classic Zelda Screen Transitions
Loading

albertfish

avatar
Morderator
Morderator
Morderator
profile
I have not worked with VX. I am not much into RPG maker scripting at this point, as I am fairly busy.
Morderator
Show Signature


<'))))><
Morderator
ACTIVATED
ACTIVATED
#18 Re: [RMXP] Classic Zelda Screen Transitions
Loading

Evekon

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
i dont know how to use that script ?
get a error wen test it

ACTIVATED
Show Signature
ACTIVATED

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 1]

 

Chatbox system disabled
Personal messaging disabled