设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 112|回复: 0

[转载发布] Fast Travel Script

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 19:24:01 | 显示全部楼层 |阅读模式
    Fast Travel Script 1.1
    by Black Mage

    Introduction
    Fast travel is a concept where you have several locations in a map (Usually this map is called an overworld map) and by selecting one of those locations, you’re transported to their respective location. That's this script's main function.

    Features
    1. Allow you to fast travel between location.
    2. You can use big map for your overworld.
    3. Customizable BGM & SFX for the map.
    4. Several additional windows for the map.
    5. Animated location icon.

    Screenshots
    I'll put a video instead. It's showing how the map selection works.

    https://www.youtube.com/embed/IZGUaf3DN0M

    How to Use
    1. Put the script on your game.
    2. Put the map graphic inside Graphics/System folder. Make sure you named the graphics “Map_Select”.
    3. Put the location selection window graphic inside Graphics/System folder. Make sure you named the graphic “Window_Map”.
    4. Put an empty graphic named “Empty”. This graphic is needed to run the script, mostly as a placeholder.
    5. Put the locations on the script.
    6. Customize where each location will transfer the player when they're selected.
    7. Customize a lot of other variables found within the script.
    8. Call the map using this script call:
    SceneManager.call(Scene_Map_Select)

    Demo
    Demo using Script V-1.0 (Mediafire)
    Demo using Script V-1.1 (Mediafire)

    Script
                    Code:       
    1. #----------------------------------------------------------------------------
    2. # Fast Travel Script By Black Mage (Credit required to use)
    3. # Version: 1.1
    4. #----------------------------------------------------------------------------
    5. #
    6. # * The script creates a map that hovers through listed locations.
    7. #
    8. # * The background image is named "Map_Select", and placed inside
    9. #   Graphics/System folder.
    10. #
    11. # * The image named "Empty" is required as dummy and placeholder in several cases.
    12. #   You can use an empty PNG file for it.
    13. #   The image is placed inside Graphics/System folder.
    14. #
    15. # * The image named "Window_Map" is used as the location selection window.
    16. #   The image is placed inside Graphics/System folder.
    17. #
    18. #----------------------------------------------------------------------------
    19. #
    20. # * How to use:
    21. #
    22. # * Enlist every available location into MAP_LIST.
    23. #
    24. # * Assign a switch for each location. Put them on SWITCH_LIST.
    25. #
    26. # * When you want a map is listed on the Map Select menu, simply turn their
    27. #   respective switch value to "true".
    28. #
    29. # * Assign x and y variables for the screen to hover when a location is
    30. #   highlighted. Put them on LOCATION_COORDINATE
    31. #
    32. # * Assign where to teleport when a location is selected. Put them on
    33. #   TELEPORT_LIST.
    34. #
    35. # * Enjoy your map select menu.
    36. #
    37. #----------------------------------------------------------------------------
    38. #
    39. # * There's several additional option below. Feel free to edit them.
    40. #
    41. #----------------------------------------------------------------------------
    42. module BLACK_MAP_LIST
    43.   #--------------------------------------------------------------------------
    44.   # Map name list. This is needed for metaprogramming.
    45.   #--------------------------------------------------------------------------
    46.   MAP_LIST = ["Australia",
    47.              "Russia",
    48.              "America"]
    49.   #--------------------------------------------------------------------------
    50.   # Switches that enable the map.
    51.   #--------------------------------------------------------------------------
    52.   SWITCH_LIST = [1, # When switch 01 is on, you can transfer to Australia.
    53.                 3, # When switch 03 is on, you can transfer to Russia.
    54.                 2] # And so on.
    55.   #--------------------------------------------------------------------------
    56.   # Assign each map name where to teleport.
    57.   #--------------------------------------------------------------------------
    58.   #                 Map ID, x,  y,  player direction
    59.   TELEPORT_LIST = [[2,      8,  1,  2], # This is where "Australia" is going to be.
    60.                   [3,      8, 11,  8], # "Russia".
    61.                   [1,     15,  7,  4]] # and so on.
    62.   
    63.   #--------------------------------------------------------------------------
    64.   # Assign overworld location coordinate.
    65.   #--------------------------------------------------------------------------
    66.   LOCATION_COORDINATE = [[-470,-100], #The map will move here when "Australia" is highlighted
    67.                         [-120,560],
    68.                         [880,300]]
    69.   #--------------------------------------------------------------------------
    70.   # Assign text color for location selection. The color depends on Window
    71.   # graphic that you use. 0 is the default color.
    72.   #--------------------------------------------------------------------------
    73.   TEXT_LOCA_COLOR = [0,
    74.                     3,
    75.                     2]
    76.   #--------------------------------------------------------------------------
    77.   # Position of the background image.
    78.   #--------------------------------------------------------------------------
    79.   MAP_POSITION = [0,0] #[x,y]
    80.   #--------------------------------------------------------------------------
    81.   # How far the background image is zoomed out.
    82.   #--------------------------------------------------------------------------
    83.   MAP_ZOOM_OUT = [0.25, 0.25] #[zoom_x, zoom_y]
    84.   #--------------------------------------------------------------------------
    85.   # How far the background image is zoomed in when a location is selected.
    86.   #--------------------------------------------------------------------------
    87.   MAP_ZOOM_IN = [1, 1] #[x, y]
    88.   #--------------------------------------------------------------------------
    89.   # Maximum magnify speed when the scene is started.
    90.   #--------------------------------------------------------------------------
    91.   MAX_ZOOM_SPEED = 0.01
    92.   #--------------------------------------------------------------------------
    93.   # Position of the available choices.
    94.   #--------------------------------------------------------------------------
    95.   CHOICE_POSITION = [0,0] #[x,y]
    96.   #--------------------------------------------------------------------------
    97.   # Position of the window that holds list of the available choices.
    98.   #--------------------------------------------------------------------------
    99.   WINDOW_POSITION = [0,10] #[x,y]
    100.   #--------------------------------------------------------------------------
    101.   # The width for location selection choices.
    102.   #--------------------------------------------------------------------------
    103.   MAP_WINDOW_WIDTH = 132
    104.   #--------------------------------------------------------------------------
    105.   # The height for location selection choices.
    106.   #--------------------------------------------------------------------------
    107.   MAP_WINDOW_HEIGHT = 10 # Amount of visible choices in the window.
    108.   #--------------------------------------------------------------------------
    109.   # Maximum scroll speed when scrolling through the map.
    110.   #--------------------------------------------------------------------------
    111.   MAX_SCROLL_SPEED = 20
    112.   #--------------------------------------------------------------------------
    113.   # The map won't scrolled until the zoom is above this number for x and y.
    114.   #--------------------------------------------------------------------------
    115.   SCROLL_BOUNDARY = [0.5, 0.5] #[zoom_x, zoom_y]
    116.   #--------------------------------------------------------------------------
    117.   # Position of location selection window picture.
    118.   #--------------------------------------------------------------------------
    119.   WINDOW_PIC_POSITION = [0, 0] #[x, y]
    120.   #--------------------------------------------------------------------------
    121.   # Opacity of location selection window picture.
    122.   #--------------------------------------------------------------------------
    123.   WINDOW_PIC_OPACITY = 200
    124.   #--------------------------------------------------------------------------
    125.   # Map Menu BGM.
    126.   #--------------------------------------------------------------------------
    127.   MAP_MENU_BGM = ["Field3", 100, 100] #["BGM name", Volume, Pitch]
    128.   #--------------------------------------------------------------------------
    129.   # SFX played when the selection is changed.
    130.   #--------------------------------------------------------------------------
    131.   MAP_MENU_SFX = ["Wind1", 100, 100] #["SFX name", Volume, Pitch]
    132.   #--------------------------------------------------------------------------
    133.   #
    134.   # * Below is the configuration of additional information window.
    135.   #
    136.   #--------------------------------------------------------------------------
    137.   #--------------------------------------------------------------------------
    138.   # Location name.
    139.   #--------------------------------------------------------------------------
    140.   ADD_LOC_NAME = true # Set this to true to enable the location name info
    141.   #--------------------------------------------------------------------------
    142.   # Location name info position.
    143.   #--------------------------------------------------------------------------
    144.   ADD_LOC_NAME_POS = [347,0]
    145.   #--------------------------------------------------------------------------
    146.   # Location name info width & height.
    147.   #--------------------------------------------------------------------------
    148.   ADD_LOC_NAME_W_H = [200,100] # [width, height]
    149.   #--------------------------------------------------------------------------
    150.   # Location name font size.
    151.   #--------------------------------------------------------------------------
    152.   ADD_LOC_NAME_F_SIZE = 20
    153.   #--------------------------------------------------------------------------
    154.   # Location description.
    155.   #--------------------------------------------------------------------------
    156.   ADD_LOC_DESC = true # Set this to true to enable the location description info
    157.   #--------------------------------------------------------------------------
    158.   # Location description position.
    159.   #--------------------------------------------------------------------------
    160.   ADD_LOC_DESC_POS = [347,155] # [x, y]
    161.   #--------------------------------------------------------------------------
    162.   # Location description width & height.
    163.   #--------------------------------------------------------------------------
    164.   ADD_LOC_DESC_W_H = [300,100] # [width, height]
    165.   #--------------------------------------------------------------------------
    166.   # Location description font size.
    167.   #--------------------------------------------------------------------------
    168.   ADD_LOC_DESC_F_SIZE = 20
    169.   #--------------------------------------------------------------------------
    170.   # Description for each location.
    171.   #--------------------------------------------------------------------------
    172.   ADD_LOC_DESC_VALUE = ["Australia is, well," + "\n" + "Australia.",  # Desc. for Australia.
    173.                        "Russia..." + "\n" + "Yeah, Russia.",         # Desc. for Russia.
    174.                        "America is America."]                        # and so on.
    175.                      
    176.   #--------------------------------------------------------------------------
    177.   # Location thumbnail.
    178.   #--------------------------------------------------------------------------
    179.   ADD_LOC_THUMB = true # Set this to true to enable the location thumbnail.
    180.   #--------------------------------------------------------------------------
    181.   # Location description position.
    182.   #--------------------------------------------------------------------------
    183.   ADD_LOC_THUMB_POS = [376,47] # [x, y]
    184.   #--------------------------------------------------------------------------
    185.   # Location quests.
    186.   #--------------------------------------------------------------------------
    187.   ADD_LOC_QUEST = true
    188.   #--------------------------------------------------------------------------
    189.   # Location quests switches.
    190.   #--------------------------------------------------------------------------
    191.   ADD_LOC_QUEST_S = [[],
    192.                     [6],
    193.                     [4,5]]
    194.   #--------------------------------------------------------------------------
    195.   # Location quests text.
    196.   #--------------------------------------------------------------------------
    197.   #                 [switch number,   text to show when the value is true]
    198.   ADD_LOC_Q_TEXT = [[4,               "* Find a way to" + "\n" + "Russia!"],
    199.                    [5,               "* Get the package!"],
    200.                    [6,               "* Deliver the package"]]
    201.   #--------------------------------------------------------------------------
    202.   # Location quests position.
    203.   #--------------------------------------------------------------------------
    204.   ADD_LOC_QUEST_POS = [347,200] # [x, y]
    205.   #--------------------------------------------------------------------------
    206.   # Location quests width & height.
    207.   #--------------------------------------------------------------------------
    208.   ADD_LOC_QUEST_W_H = [300,300] # [width, height]
    209.   #--------------------------------------------------------------------------
    210.   # Location quests font size.
    211.   #--------------------------------------------------------------------------
    212.   ADD_LOC_QUEST_F_SIZE = 20
    213.   #--------------------------------------------------------------------------
    214.   # Information Window Picture.
    215.   #--------------------------------------------------------------------------
    216.   ADD_WIN_PIC = true # Set this to true to enable the information window picture.
    217.   #--------------------------------------------------------------------------
    218.   # Position of additional information window picture.
    219.   #--------------------------------------------------------------------------
    220.   ADD_WIN_PIC_POS = [350, 3] #[x, y]
    221.   #--------------------------------------------------------------------------
    222.   # Opacity of additional information window picture.
    223.   #--------------------------------------------------------------------------
    224.   ADD_WIN_PIC_OPA = 200
    225.   #--------------------------------------------------------------------------
    226.   # Current Party Window.
    227.   #--------------------------------------------------------------------------
    228.   ADD_CUR_PARTY = true
    229.   #--------------------------------------------------------------------------
    230.   # Location quests position.
    231.   #--------------------------------------------------------------------------
    232.   ADD_CUR_PARTY_POS = [352,340] # [x, y]
    233.   #--------------------------------------------------------------------------
    234.   # Location quests width & height.
    235.   #--------------------------------------------------------------------------
    236.   ADD_CUR_PARTY_W_H = [180,80] # [width, height]
    237.   #--------------------------------------------------------------------------
    238.   # * This is an instruction if you want to use an icon for your location.
    239.   # * First, the icon canvas mus be as big as the overworld canvas. This is
    240.   #   the case to make sure the scrolling is as smooth as possible.
    241.   # * Second, the icon must be named after the location found in MAP_LIST.
    242.   # * Third, after the icon name, put the frame number of the icon. The number
    243.   #   starts from 0.
    244.   #--------------------------------------------------------------------------
    245.   #--------------------------------------------------------------------------
    246.   # * Location animated icon.
    247.   #--------------------------------------------------------------------------
    248.   LOC_ANI_ICON = true
    249.   #--------------------------------------------------------------------------
    250.   # * Location animated icon delay.
    251.   #   You can call this animation speed. Decrease the value to make the animation
    252.   #   faster.
    253.   #--------------------------------------------------------------------------
    254.   LOC_ANI_ICON_DELAY = 10
    255. end
    256. #----------------------------------------------------------------------------
    257. # * Beyond this is the sacred land of code. You need programming qualification
    258. #   to delve deeper, or it'll cause many unnecessary problems. Proceed on your
    259. #   own risk.
    260. #----------------------------------------------------------------------------
    261. class Scene_Map_Select < Scene_Base
    262.   include BLACK_MAP_LIST
    263.   
    264.   def start
    265.    super
    266.    @last_map = "placeholder"
    267.    @first_sfx = false
    268.    @last_position = [MAP_POSITION[0], MAP_POSITION[1]]
    269.    @distance_x = 0
    270.    @distance_y = 0
    271.   
    272.    @last_zoom = [MAP_ZOOM_OUT[0], MAP_ZOOM_OUT[1]]
    273.   
    274.    @icon_max = 0
    275.    @icon_current = 0
    276.    @icon_delay_cur = 0
    277.   
    278.    create_maplist
    279.   
    280.    create_information_window
    281.    create_command_window
    282.   
    283.    create_background
    284.    create_map_icon
    285.    create_map_window
    286.    location_update_index
    287.    RPG::BGM.new(MAP_MENU_BGM[0], MAP_MENU_BGM[1], MAP_MENU_BGM[2]).play
    288.   end
    289.   
    290.   def create_information_window
    291.    if ADD_LOC_NAME
    292.      @information_window_1 = Window_Information_1.new
    293.      @information_window_1.opacity = 0
    294.    end
    295.    if ADD_LOC_DESC
    296.      @information_window_2 = Window_Information_2.new
    297.      @information_window_2.opacity = 0
    298.    end
    299.    if ADD_LOC_THUMB
    300.      @information_window_3 = Sprite.new
    301.      @information_window_3.bitmap = Cache.system("Empty")  
    302.      @information_window_3.ox = 0
    303.      @information_window_3.oy = 0
    304.      @information_window_3.x = ADD_LOC_THUMB_POS[0]
    305.      @information_window_3.y = ADD_LOC_THUMB_POS[1]
    306.      @information_window_3.z = 2
    307.    end
    308.    if ADD_LOC_QUEST
    309.      @information_window_4 = Window_Information_4.new
    310.      @information_window_4.opacity = 0
    311.    end
    312.    if ADD_WIN_PIC
    313.      @info_window = Sprite.new
    314.      @info_window.bitmap = Cache.system("Window_Info")  
    315.      @info_window.ox = 0
    316.      @info_window.oy = 0
    317.      @info_window.x = ADD_WIN_PIC_POS[0]
    318.      @info_window.y = ADD_WIN_PIC_POS[1]
    319.      @info_window.z = 2
    320.      @info_window.opacity = 0
    321.    end
    322.    if ADD_CUR_PARTY
    323.      @current_party_window = Window_Current_Party.new
    324.      @current_party_window.opacity = 0
    325.      @current_party_window.refresh
    326.    end
    327.   end
    328.   def create_map_window
    329.    @map_window = Sprite.new
    330.    @map_window.bitmap = Cache.system("Window_Map")  
    331.    @map_window.ox = 0
    332.    @map_window.oy = 0
    333.    @map_window.x = WINDOW_PIC_POSITION[0]
    334.    @map_window.y = WINDOW_PIC_POSITION[1]
    335.    @map_window.z = 2
    336.    @map_window.opacity = 0
    337.   end
    338.   
    339.   def create_maplist
    340.    @map_list = []
    341.    for i in 0..MAP_LIST.size - 1
    342.      if $game_switches[SWITCH_LIST[i]] == true
    343.        @map_list.push(MAP_LIST[i])
    344.      end
    345.    end
    346.   end
    347.   alias black_update update
    348.   def update
    349.    black_update
    350.    if @map_list.size != 0
    351.      icon_update if @map_window != nil
    352.    end
    353.   end
    354.   def location_update_index
    355.    if @command_window != nil
    356.      @last_map = @map_list[@command_window.index].to_s
    357.    
    358.      if LOC_ANI_ICON
    359.        @map_name = assigned_number(@map_list[@command_window.index].to_s)
    360.        @map_name = @map_list[@command_window.index].to_s
    361.        @map_icon.bitmap = Cache.system(@map_name + "0")
    362.        @icon_max = pic_list_number
    363.        @icon_current = 0
    364.      else
    365.        @map_icon.bitmap = Cache.system("Empty")
    366.      end
    367.    
    368.    end
    369.    if @first_sfx == true
    370.      RPG::SE.new(MAP_MENU_SFX[0], MAP_MENU_SFX[1], MAP_MENU_SFX[2]).play
    371.    end
    372.   end
    373.   
    374.   def pic_list_number
    375.    @map_name
    376.    @pic_frames = []
    377.    for index in 0..999
    378.      begin
    379.        picture = Cache.system(@map_name + index.to_s).nil?
    380.      rescue
    381.        nil
    382.      else
    383.        @pic_frames[index] = index
    384.      end
    385.      break if @pic_frames[index] == nil
    386.    end
    387.    return @pic_frames.size
    388.   end
    389.   def icon_update
    390.    if LOC_ANI_ICON
    391.      if @icon_delay_cur < LOC_ANI_ICON_DELAY
    392.        @icon_delay_cur += 1
    393.      else
    394.        @icon_delay_cur = 0
    395.        if @icon_current.to_i < (@icon_max - 1)
    396.          @map_icon.bitmap = Cache.system(@map_name + (@icon_current.to_i + 1).to_s)
    397.          @icon_current += 1
    398.        else
    399.          @map_icon.bitmap = Cache.system(@map_name + "0")
    400.          @icon_current = 0
    401.        end
    402.      end
    403.    end
    404.   
    405.    @map_window.opacity = WINDOW_PIC_OPACITY
    406.    @info_window.opacity = ADD_WIN_PIC_OPA if ADD_WIN_PIC
    407.   
    408.    @map_index = assigned_number(@map_list[@command_window.index].to_s)
    409.    map_move(@last_position[0], @last_position[1],
    410.             LOCATION_COORDINATE[@map_index][0], LOCATION_COORDINATE[@map_index][1],
    411.             255)
    412.          
    413.    #--------------------------------------------------------------------------
    414.    # Define the magnifying speed.
    415.    #--------------------------------------------------------------------------
    416.    @magnify_x = (MAP_ZOOM_IN[0] - @last_zoom[0])/10
    417.   
    418.    if @magnify_x > 0
    419.      @magnify_x = [MAX_ZOOM_SPEED, @magnify_x].min
    420.    end
    421.    if @magnify_x < 0
    422.      @magnify_x = [MAX_ZOOM_SPEED, @magnify_x].max
    423.    end
    424.    
    425.    if @magnify_x < 0.005 and @magnify_x > 0
    426.        @magnify_x = 0.005
    427.    elsif @magnify_x > -0.005 and @magnify_x < 0
    428.        @magnify_x = -0.005
    429.    end
    430.          
    431.    @magnify_y = (MAP_ZOOM_IN[1] - @last_zoom[1])/10
    432.   
    433.    if @magnify_y > 0
    434.      @magnify_y = [MAX_ZOOM_SPEED, @magnify_y].min
    435.    end
    436.    if @magnify_y < 0
    437.      @magnify_y = [MAX_ZOOM_SPEED, @magnify_y].max
    438.    end
    439.   
    440.    if @magnify_y < 0.005 and @magnify_y > 0
    441.        @magnify_y = 0.005
    442.    elsif @magnify_y > -0.005 and @magnify_y < 0
    443.        @magnify_y = -0.005
    444.    end
    445.       
    446.    #--------------------------------------------------------------------------
    447.    # Scrolling.
    448.    #--------------------------------------------------------------------------
    449.    if @background_sprite.zoom_x > SCROLL_BOUNDARY[0] and @background_sprite.zoom_y > SCROLL_BOUNDARY[1]
    450.      if @first_sfx == false
    451.        RPG::SE.new(MAP_MENU_SFX[0], MAP_MENU_SFX[1], MAP_MENU_SFX[2]).play
    452.        @first_sfx = true
    453.      end
    454.      @background_sprite.x = @background_sprite.x + @distance_x
    455.      @background_sprite.y = @background_sprite.y + @distance_y
    456.      @map_icon.x = @map_icon.x + @distance_x
    457.      @map_icon.y = @map_icon.y + @distance_y
    458.    end
    459.   
    460.    @background_sprite.zoom_x = @background_sprite.zoom_x + @magnify_x
    461.    @map_icon.zoom_x = @map_icon.zoom_x + @magnify_x
    462.    if @magnify_x == 0.005
    463.      if @background_sprite.zoom_x > MAP_ZOOM_IN[0]
    464.        @background_sprite.zoom_x = MAP_ZOOM_IN[0]
    465.        @map_icon.zoom_x = MAP_ZOOM_IN[0]
    466.      end
    467.    elsif @magnify_x == -0.005
    468.      if @background_sprite.zoom_x < MAP_ZOOM_IN[0]
    469.        @background_sprite.zoom_x = MAP_ZOOM_IN[0]
    470.        @map_icon.zoom_x = MAP_ZOOM_IN[0]
    471.      end
    472.    end
    473.   
    474.    @background_sprite.zoom_y = @background_sprite.zoom_y + @magnify_y
    475.    @map_icon.zoom_y = @map_icon.zoom_y + @magnify_y
    476.    if @magnify_y == 0.005
    477.      if @background_sprite.zoom_y > MAP_ZOOM_IN[1]
    478.        @background_sprite.zoom_y = MAP_ZOOM_IN[1]
    479.        @map_icon.zoom_y = MAP_ZOOM_IN[1]
    480.      end
    481.    elsif @magnify_y == -0.005
    482.      if @background_sprite.zoom_y < MAP_ZOOM_IN[1]
    483.        @background_sprite.zoom_y = MAP_ZOOM_IN[1]
    484.        @map_icon.zoom_y = MAP_ZOOM_IN[1]
    485.      end
    486.    end
    487.       
    488.    #--------------------------------------------------------------------------
    489.    # Adjust the position.
    490.    #--------------------------------------------------------------------------
    491.    @last_position[0] = @background_sprite.x
    492.    @last_position[1] = @background_sprite.y
    493.    @last_zoom[0] = @background_sprite.zoom_x
    494.    @last_zoom[1] = @background_sprite.zoom_y
    495.   
    496.   end
    497.   def map_move(f_x, f_y, x, y, opacity)
    498.    @distance_x = (x - f_x)/10
    499.    if @distance_x > 0
    500.      @distance_x = [MAX_SCROLL_SPEED, @distance_x].min
    501.    end
    502.    if @distance_x < 0
    503.      @distance_x = [(MAX_SCROLL_SPEED*(-1)), @distance_x].max
    504.    end
    505.   
    506.    if @distance_x == 0
    507.      if @last_position[0] == LOCATION_COORDINATE[@map_index][0]
    508.      elsif (x - f_x) < 0
    509.        @distance_x = -1
    510.      else
    511.        @distance_x = 1      
    512.      end
    513.    end
    514.   
    515.    @distance_y = (y - f_y)/10
    516.    if @distance_y > 0
    517.      @distance_y = [MAX_SCROLL_SPEED, @distance_y].min
    518.    end
    519.    if @distance_y < 0
    520.      @distance_y = [(MAX_SCROLL_SPEED*(-1)), @distance_y].max
    521.    end
    522.    if @distance_y == 0
    523.      if @last_position[1] == LOCATION_COORDINATE[@map_index][1]
    524.      elsif (y - f_y) < 0
    525.        @distance_y = -1
    526.      else
    527.        @distance_y = 1      
    528.      end
    529.    end
    530.   
    531.   end
    532.   
    533.   def create_command_window
    534.    @command_window = Window_MapSelect.new
    535.    @command_window.x = WINDOW_POSITION[0]
    536.    @command_window.y = WINDOW_POSITION[1]
    537.    for i in 0..MAP_LIST.size - 1
    538.      @command_window.set_handler(MAP_LIST[i].to_sym, method(MAP_LIST[i].to_sym))
    539.    end
    540.    @command_window.set_handler(:cancel,    method(:return_scene))
    541.    @command_window.information_window_1 = @information_window_1
    542.    @command_window.information_window_2 = @information_window_2
    543.    @command_window.information_window_4 = @information_window_4
    544.    @command_window.information_1_update if ADD_LOC_NAME
    545.    @command_window.information_2_update if ADD_LOC_DESC
    546.    information_3_update if ADD_LOC_THUMB
    547.    @command_window.information_4_update if ADD_LOC_QUEST
    548.   end
    549.   def information_3_update
    550.    if @information_window_3 != nil and @command_window !=nil
    551.      bitmap_pic = @map_list[@command_window.index].to_s + "_Thumb"
    552.      @information_window_3.bitmap = Cache.system(bitmap_pic)
    553.    end
    554.   end
    555.   def create_background
    556.    @background_sprite = Sprite.new
    557.    @background_sprite.bitmap = Cache.system("Map_Select")  
    558.    @background_sprite.ox = @background_sprite.bitmap.width / 2
    559.    @background_sprite.oy = @background_sprite.bitmap.height / 2
    560.    @background_sprite.x = Graphics.width / 2
    561.    @background_sprite.y = Graphics.height / 2
    562.    @background_sprite.zoom_x = MAP_ZOOM_OUT[0]
    563.    @background_sprite.zoom_y = MAP_ZOOM_OUT[1]
    564.   end
    565.   def create_map_icon
    566.    @map_icon = Sprite.new
    567.    @map_icon.bitmap = Cache.system("Empty")  
    568.    @map_icon.ox = @background_sprite.bitmap.width / 2
    569.    @map_icon.oy = @background_sprite.bitmap.height / 2
    570.    @map_icon.zoom_x = MAP_ZOOM_OUT[0]
    571.    @map_icon.zoom_y = MAP_ZOOM_OUT[1]
    572.    @map_icon.x = Graphics.width / 2
    573.    @map_icon.y = Graphics.height / 2
    574.    @map_icon.z = 1
    575.   end
    576.   MAP_LIST.each do |map_name|
    577.    define_method(map_name) do
    578.      list_number = assigned_number(map_name)
    579.      transfer_map(list_number)
    580.    end
    581.   end
    582.   def assigned_number(map_name)
    583.    for i in 0..MAP_LIST.size - 1
    584.      if MAP_LIST[i] == map_name
    585.        return i
    586.      end
    587.    end
    588.   end
    589.   def transfer_map(a)
    590.    b = TELEPORT_LIST
    591.    $game_temp.fade_type = 2
    592.    $game_player.reserve_transfer(b[a][0],b[a][1],b[a][2],b[a][3])
    593.    return_scene
    594.   end
    595.   
    596.   def close_command_window
    597.    @command_window.close
    598.    update until @command_window.close?
    599.    fadeout_all
    600.    @command_window.dispose
    601.    @background_sprite.bitmap = nil
    602.   end
    603.   def black_dispose
    604.    @command_window.dispose
    605.    @map_window.bitmap.dispose ; @map_window.dispose ; @map_window = nil
    606.    @map_icon.bitmap.dispose ; @map_icon.dispose ; @map_icon = nil
    607.   
    608.    if ADD_WIN_PIC
    609.      @info_window.bitmap.dispose
    610.      @info_window.dispose
    611.      @info_window = nil
    612.    end
    613.   
    614.    if @background_sprite.bitmap != nil
    615.      @background_sprite.bitmap.dispose
    616.    end
    617.    @background_sprite.dispose
    618.    @background_sprite = nil
    619.   
    620.    @information_window_1.dispose if ADD_LOC_NAME
    621.    @information_window_2.dispose if ADD_LOC_DESC
    622.   
    623.    if ADD_LOC_THUMB
    624.      @information_window_3.bitmap.dispose
    625.      @information_window_3.dispose
    626.      @information_window_3 = nil
    627.    end
    628.   
    629.    @information_window_4.dispose if ADD_LOC_QUEST
    630.    @current_party_window.dispose if ADD_CUR_PARTY
    631.   end
    632.   def return_scene
    633.    close_command_window
    634.    black_dispose
    635.    super
    636.    RPG::BGM.fade(500)
    637.    $game_map.autoplay
    638.   end
    639. end
    640. #--------------------------------------------------------------------------
    641. # * Map Command List Window
    642. #--------------------------------------------------------------------------
    643. class Window_MapSelect < Window_Command
    644.   include BLACK_MAP_LIST
    645.   #--------------------------------------------------------------------------
    646.   # * Object Initialization
    647.   #--------------------------------------------------------------------------
    648.   def initialize
    649.    create_maplist
    650.    super(0, 0)
    651.    self.openness = 0
    652.    open
    653.    self.opacity = 0
    654.   end
    655.   
    656.   #--------------------------------------------------------------------------
    657.   # * Get Window Width
    658.   #--------------------------------------------------------------------------
    659.   def window_width
    660.    return MAP_WINDOW_WIDTH
    661.   end
    662.   #--------------------------------------------------------------------------
    663.   # * Create Command List
    664.   #--------------------------------------------------------------------------
    665.   def make_command_list
    666.    for i in 0..@map_list.size - 1
    667.      if @map_list.size != 0
    668.        add_command(@map_list[i], @map_list[i].to_sym)
    669.      end
    670.    end
    671.   end
    672.   #--------------------------------------------------------------------------
    673.   # * Get unlocked map list
    674.   #--------------------------------------------------------------------------
    675.   def create_maplist
    676.    @map_list = []
    677.    for i in 0..MAP_LIST.size - 1
    678.      if $game_switches[SWITCH_LIST[i]] == true
    679.        @map_list.push(MAP_LIST[i])
    680.      end
    681.    end
    682.   end
    683.   def index=(index)
    684.    super
    685.    SceneManager.scene.location_update_index
    686.    information_1_update if ADD_LOC_NAME
    687.    information_2_update if ADD_LOC_DESC
    688.    SceneManager.scene.information_3_update if ADD_LOC_THUMB
    689.    information_4_update if ADD_LOC_QUEST
    690.   end
    691.   #--------------------------------------------------------------------------
    692.   # * Draw Item
    693.   #--------------------------------------------------------------------------
    694.   def draw_item(index)
    695.    font_color = assigned_number(command_name(index))
    696.    change_color(text_color(TEXT_LOCA_COLOR[font_color]), command_enabled?(index))
    697.    draw_text(item_rect_for_text(index), command_name(index), alignment)
    698.   end
    699.   
    700.   #--------------------------------------------------------------------------
    701.   # * Get Window Height
    702.   #--------------------------------------------------------------------------
    703.   def window_height
    704.    fitting_height(MAP_WINDOW_HEIGHT)
    705.   end
    706.   #--------------------------------------------------------------------------
    707.   # * Information Window
    708.   #--------------------------------------------------------------------------
    709.   def information_window_1=(information_window)
    710.    @information_window_1 = information_window
    711.   end
    712.   def information_window_2=(information_window)
    713.    @information_window_2 = information_window
    714.   end
    715.   def information_window_4=(information_window)
    716.    @information_window_4 = information_window
    717.   end
    718.   def information_1_update
    719.    if @information_window_1 != nil
    720.      @information_window_1.clear
    721.      text = @map_list[self.index].to_s
    722.      @information_window_1.set_text(text)
    723.    end
    724.   end
    725.   def information_2_update
    726.    if @information_window_2 != nil
    727.      @information_window_2.clear
    728.      text = ADD_LOC_DESC_VALUE[assigned_number(@map_list[self.index].to_s)]
    729.      @information_window_2.set_text(text)
    730.    end
    731.   end
    732.   def information_4_update
    733.    if @information_window_4 != nil
    734.      @information_window_4.clear
    735.      text = ""
    736.      map_num = assigned_number(@map_list[self.index].to_s)
    737.      for i in 0..ADD_LOC_QUEST_S[map_num].size - 1
    738.        if ADD_LOC_QUEST_S[map_num].size != -1
    739.          if $game_switches[ADD_LOC_QUEST_S[map_num][i]]
    740.            quest_desc = assigned_quest(ADD_LOC_QUEST_S[map_num][i])
    741.            text = text + "\n" + ADD_LOC_Q_TEXT[quest_desc][1]
    742.          end
    743.        end
    744.      end
    745.      @information_window_4.set_text(text)
    746.    end
    747.   end
    748.   #--------------------------------------------------------------------------
    749.   # * Return location number from location name
    750.   #--------------------------------------------------------------------------
    751.   def assigned_number(map_name)
    752.    for i in 0..MAP_LIST.size - 1
    753.      if MAP_LIST[i] == map_name
    754.        return i
    755.      end
    756.    end
    757.   end
    758.   #--------------------------------------------------------------------------
    759.   # * Return quest number from quest switch
    760.   #--------------------------------------------------------------------------
    761.   def assigned_quest(quest_switch)
    762.    for i in 0..ADD_LOC_Q_TEXT.size - 1
    763.      if ADD_LOC_Q_TEXT[i][0] == quest_switch
    764.        return i
    765.      end
    766.    end
    767.   end
    768. end
    769. #--------------------------------------------------------------------------
    770. # * Map Additional Location Name Window
    771. #--------------------------------------------------------------------------
    772. class Window_Information_1 < Window_Base
    773.   include BLACK_MAP_LIST
    774.   #--------------------------------------------------------------------------
    775.   # * Object Initialization
    776.   #--------------------------------------------------------------------------
    777.   def initialize
    778.    super(ADD_LOC_NAME_POS[0], ADD_LOC_NAME_POS[1], ADD_LOC_NAME_W_H[0], ADD_LOC_NAME_W_H[1])
    779.   end
    780.   #--------------------------------------------------------------------------
    781.   # * Set Text
    782.   #--------------------------------------------------------------------------
    783.   def set_text(text)
    784.    if text != @text
    785.      @text = text
    786.      refresh
    787.    end
    788.   end
    789.   #--------------------------------------------------------------------------
    790.   # * Clear
    791.   #--------------------------------------------------------------------------
    792.   def clear
    793.    set_text("")
    794.   end
    795.   #--------------------------------------------------------------------------
    796.   # * Refresh
    797.   #--------------------------------------------------------------------------
    798.   def refresh
    799.    contents.clear
    800.    draw_text_ex(4, 0, @text)
    801.   end
    802.   def reset_font_settings
    803.    super # run's Window_Base's reset_font_settings
    804.    contents.font.size = ADD_LOC_NAME_F_SIZE
    805.   end
    806. end
    807. class Window_Information_2 < Window_Base
    808.   include BLACK_MAP_LIST
    809.   #--------------------------------------------------------------------------
    810.   # * Object Initialization
    811.   #--------------------------------------------------------------------------
    812.   def initialize
    813.    super(ADD_LOC_DESC_POS[0], ADD_LOC_DESC_POS[1], ADD_LOC_DESC_W_H[0], ADD_LOC_DESC_W_H[1])
    814.   end
    815.   #--------------------------------------------------------------------------
    816.   # * Set Text
    817.   #--------------------------------------------------------------------------
    818.   def set_text(text)
    819.    if text != @text
    820.      @text = text
    821.      refresh
    822.    end
    823.   end
    824.   #--------------------------------------------------------------------------
    825.   # * Clear
    826.   #--------------------------------------------------------------------------
    827.   def clear
    828.    set_text("")
    829.   end
    830.   #--------------------------------------------------------------------------
    831.   # * Refresh
    832.   #--------------------------------------------------------------------------
    833.   def refresh
    834.    contents.clear
    835.    draw_text_ex(4, 0, @text)
    836.   end
    837.   def reset_font_settings
    838.    super # run's Window_Base's reset_font_settings
    839.    contents.font.size = ADD_LOC_DESC_F_SIZE
    840.   end
    841. end
    842. class Window_Information_4 < Window_Base
    843.   include BLACK_MAP_LIST
    844.   #--------------------------------------------------------------------------
    845.   # * Object Initialization
    846.   #--------------------------------------------------------------------------
    847.   def initialize
    848.    super(ADD_LOC_QUEST_POS[0], ADD_LOC_QUEST_POS[1], ADD_LOC_QUEST_W_H[0], ADD_LOC_QUEST_W_H[1])
    849.   end
    850.   #--------------------------------------------------------------------------
    851.   # * Set Text
    852.   #--------------------------------------------------------------------------
    853.   def set_text(text)
    854.    if text != @text
    855.      @text = text
    856.      refresh
    857.    end
    858.   end
    859.   #--------------------------------------------------------------------------
    860.   # * Clear
    861.   #--------------------------------------------------------------------------
    862.   def clear
    863.    set_text("")
    864.   end
    865.   #--------------------------------------------------------------------------
    866.   # * Refresh
    867.   #--------------------------------------------------------------------------
    868.   def refresh
    869.    contents.clear
    870.    draw_text_ex(4, 0, @text)
    871.   end
    872.   def reset_font_settings
    873.    super # run's Window_Base's reset_font_settings
    874.    contents.font.size = ADD_LOC_QUEST_F_SIZE
    875.   end
    876. end
    877. #--------------------------------------------------------------------------
    878. # * Window Current Party
    879. #--------------------------------------------------------------------------
    880. class Window_Current_Party < Window_Base
    881.   include BLACK_MAP_LIST
    882.   #--------------------------------------------------------------------------
    883.   # * Object Initialization
    884.   #--------------------------------------------------------------------------
    885.   def initialize
    886.    super(ADD_CUR_PARTY_POS[0], ADD_CUR_PARTY_POS[1], ADD_CUR_PARTY_W_H[0], ADD_CUR_PARTY_W_H[1])
    887.   end
    888.   #--------------------------------------------------------------------------
    889.   # * Draw Item
    890.   #--------------------------------------------------------------------------
    891.   def item_max
    892.    return $game_party.members.size
    893.   end
    894.   def draw_all_items
    895.    item_max.times {|i| draw_item(i) }
    896.   end
    897.   def draw_item(index)
    898.    @actor = $game_party.members[index]
    899.    if @actor != nil
    900.      x_pos = 60
    901.      draw_actor_graphic(@actor, index*40 + 20, 45)
    902.    end
    903.   end
    904.   #--------------------------------------------------------------------------
    905.   # * Refresh
    906.   #--------------------------------------------------------------------------
    907.   def refresh
    908.    contents.clear
    909.    draw_all_items
    910.   end
    911. end
    复制代码


    FAQ
    None yet.

    Credit and Thanks
    Black Mage.
    Thanks to Sixth for reminding me that I forgot to put the dispose method inside the script. Also for several other contributions.


    Author's Note
    If you having trouble on using this script, and it seems that I rarely appeared here, you can go directly to my wordpress, and ask something there. I mostly roaming around there so there's no need to worry that your question will be left unanswered.

    Here's a link to the pages of this script in my wordpress.
    Fast Travel Script


    本贴来自国际rpgmaker官方论坛作者:BlackMage处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/fast-travel-script.78185/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-18 08:55 , Processed in 0.144801 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表