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

[转载发布] [Joe Pro] Teleportation System

[复制链接]
累计送礼:
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-2 19:35:16 | 显示全部楼层 |阅读模式
    [url=http://s1371.photobucket.com/user/Joe_Programmer/media/NameTag_zps2e908375.png.html][/url]

    class Teleportation System(version 1.0)

      defInitialize:
           Creates a scene where the player can choose from a list of locations they can travel too.
      end

      defFeatures:

    • New teleportation system.
    • Add locations as you play.
      end

      defHow to use:
               This script has a Customizeable Area inside of the script's module as well as details how to set up and add locations.
      end

      defScript:
    Spoiler                Code:       
    1. #################################################################################↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓##↓                                                                            ↓##↓                     Teleportation System: Version 1.0                      ↓##↓                                                                            ↓##↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕##↑                                                                            ↑##↑                            Written By: Joe Pro                             ↑##↑                        Last Edited:  July 31, 2014                         ↑##↑                                                                            ↑##↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑##################################################################################◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙ ** Disclaimer                                                              ◙##◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙##◙                                                                            ◙##◙ This script is not for commercial, if you wish to use this script in a     ◙##◙ game please PM me. All credit is to be given to me as the author of this   ◙##◙ script.                                                                    ◙##◙                                                                            ◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙ ** How To Use                                                              ◙##◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙##◙                                                                            ◙##◙ * Cusomizable area below.                                                  ◙##◙                                                                            ◙##◙ * Use the following command in a script call to call the teleport scene.   ◙##◙       teleport                                                             ◙##◙                                                                            ◙##◙ * Use the following command in a script call to add a location.            ◙##◙       add_location(id_from_list_below)                                     ◙##◙                                                                            ◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙ ** Updates / Version Notes                                                 ◙##◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙##◙                                                                            ◙##◙   v0.1                                                                     ◙##◙ ~◄◙◙◙◙►~                                                                   ◙##◙ * This script creates a menu that displays areas the player can travel to. ◙##◙                                                                            ◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##################################################################################↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓##↓                                                                            ↓##↕                     Teleportation System: Version 0.1                      ↕##↑                                                                            ↑##↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑##################################################################################==============================================================================# ** Teleportation System #------------------------------------------------------------------------------#  This module manages the customizable and function modules.#==============================================================================module Teleportation_System    #◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙Customizeable Area◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#  #=============================================================================  # * Fade Type  #=============================================================================    Fade_Type = "Normal"      #=============================================================================  # * Menu Windows BG Options  #=============================================================================    Teleport_SE = "Teleport"    Volume = 80    Pitch = 100      #=============================================================================  # * Teleport Header Text  #=============================================================================    Teleport_Header_Text = "Where would you like to teleport to?"      #=============================================================================  # * Locations  #=============================================================================    Locations = {    #Location ID      0 => { :display_name => "Adomite Factory",                         #[Map_id, X_Tile, Y_Tile, Direction]             :location => [   4  ,   8   ,   4   ,     2    ],           },          1 => { :display_name => "AEIOU Facility",                         #[Map_id, X_Tile, Y_Tile, Direction]             :location => [   5  ,   3   ,   55   ,    2    ],           },                2 => { :display_name => "Creadair Chamber",                         #[Map_id, X_Tile, Y_Tile, Direction]             :location => [   6  ,   3   ,   4   ,     4    ],           },            }#◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙End Customizeable Area◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙#end#==============================================================================# ** Game_System#------------------------------------------------------------------------------#  This class handles system data. It saves the disable state of saving and # menus. Instances of this class are referenced by $game_system.#==============================================================================class Game_System  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_accessor :teleport_locations              # Teleport Locations  attr_accessor :teleporting              # Teleport Locations  attr_accessor :list_window_index              # Teleport Locations  #--------------------------------------------------------------------------  # * Aliasing Method: Object Initialization  #--------------------------------------------------------------------------  alias :gsi04506451 :initialize    #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    gsi04506451()    @teleport_locations = {}    @teleporting = false    @list_window_index = 0  endend#==============================================================================# ** Game_Map#------------------------------------------------------------------------------#  This class handles maps. It includes scrolling and passage determination# functions. The instance of this class is referenced by $game_map.#==============================================================================class Game_Map  #--------------------------------------------------------------------------  # * Aliasing Method: Object Initialization  #--------------------------------------------------------------------------  alias :gmu046560 :update    #--------------------------------------------------------------------------  # * Frame Update  #     main:  Interpreter update flag  #--------------------------------------------------------------------------  def update(main = false)    transfer_player if $game_system.teleporting == true    gmu046560(main)  end    #--------------------------------------------------------------------------  # * Teleport Locations  #--------------------------------------------------------------------------  def fade_type    Teleportion_System::Specs::Fade_Type  end  #--------------------------------------------------------------------------  # * Teleport Locations  #--------------------------------------------------------------------------  def teleport_se    ["Audio/SE/" + Teleportation_System::Teleport_SE, Teleportation_System::Volume, Teleportation_System::Specs::Pitch]  end  #--------------------------------------------------------------------------  # * Teleport Locations  #--------------------------------------------------------------------------  def current_map_info    $game_system.teleport_locations[$game_system.list_window_index][:location]  end  #--------------------------------------------------------------------------  # * Frame Update  #     main:  Interpreter update flag  #--------------------------------------------------------------------------  def transfer_player    $game_system.teleporting = false    map_id = current_map_info[0]    x = current_map_info[1]    y = current_map_info[2]    direction = current_map_info[3]    $game_player.reserve_transfer(map_id, x, y, direction)    $game_temp.fade_type = 1    Audio.se_play(teleport_se[0], teleport_se[1], teleport_se[2])  end  end#==============================================================================# ** Game_Interpreter#------------------------------------------------------------------------------#  An interpreter for executing event commands. This class is used within the# Game_Map, Game_Troop, and Game_Event classes.#==============================================================================class Game_Interpreter  #--------------------------------------------------------------------------  # * Calls Scene_Teleport Class  #--------------------------------------------------------------------------  def teleport    SceneManager.call(Scene_Teleport)  end    #--------------------------------------------------------------------------  # * Add Location by Name  #--------------------------------------------------------------------------  def add_location(id)    $game_system.teleport_locations[id] = Teleportation_System::Locations[id]  end  end#==============================================================================# ** Window_Base#------------------------------------------------------------------------------#  This is a super class of all windows within the game.#==============================================================================class Window_LocationHeader < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, width, height)    super    refresh  end    #--------------------------------------------------------------------------  # * Refresh Processing  #--------------------------------------------------------------------------  def refresh    contents.clear    draw_text(-10, -10, ((Graphics.width / 5) * 3), 50, Teleportation_System::Teleport_Header_Text, 1)  end  end#==============================================================================# ** Window_Command#------------------------------------------------------------------------------#  This window deals with general command choices.#==============================================================================class Window_ConfirmLocation < Window_Command    #--------------------------------------------------------------------------  # * Refresh Processing  #--------------------------------------------------------------------------  def alignment    return 1  end  #--------------------------------------------------------------------------  # * Refresh Processing  #--------------------------------------------------------------------------  def col_max    return item_max  end  #--------------------------------------------------------------------------  # * Refresh Processing  #--------------------------------------------------------------------------  def window_width    return (Graphics.width / 5) * 3  end  #--------------------------------------------------------------------------  # * Refresh Processing  #--------------------------------------------------------------------------  def window_height    return 50  end  #--------------------------------------------------------------------------  # * Get Window Height  #--------------------------------------------------------------------------  def make_command_list    add_command("Confirm", :confirm)    add_command("Cancel", :cancel)  endend#==============================================================================# ** Window_Command#------------------------------------------------------------------------------#  This window deals with general command choices.#==============================================================================class Window_LocationList < Window_Command    #--------------------------------------------------------------------------  # * Get Window Width  #--------------------------------------------------------------------------  def window_width    (Graphics.width / 5) * 2  end    #--------------------------------------------------------------------------  # * Get Window Height  #--------------------------------------------------------------------------  def window_height    (Graphics.height / 5) * 3  end  #--------------------------------------------------------------------------  # * Teleport Locations  #--------------------------------------------------------------------------  def teleport_locations    $game_system.teleport_locations  end  #--------------------------------------------------------------------------  # * Check For Current Map  #--------------------------------------------------------------------------  def not_current_map?(index)    return (teleport_locations[index][:location][0] != $game_map.map_id)  end  #--------------------------------------------------------------------------  # * Get Window Height  #--------------------------------------------------------------------------  def make_command_list    teleport_locations.each_key { |i| add_command(teleport_locations[i][:display_name], :select, not_current_map?(i)) }  endend#==============================================================================# ** Scene_Teleport < Scene_MenuBase#------------------------------------------------------------------------------#  This class performs basic processing related to the teleport screen.#==============================================================================class Scene_Teleport < Scene_MenuBase  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    super    create_windows  end  #--------------------------------------------------------------------------  # * Free Viewport  #--------------------------------------------------------------------------  def dispose_main_viewport    @viewport.dispose if @viewport  end    #--------------------------------------------------------------------------  # * Create Windows  #--------------------------------------------------------------------------  def create_windows    create_header_window    create_list_window    create_confirm_window  end  #--------------------------------------------------------------------------  # * Create List Window  #--------------------------------------------------------------------------  def create_header_window    @location_header_window = Window_LocationHeader.new((Graphics.width / 5) * 1, ((Graphics.height / 5) * 1) - 50, (Graphics.width / 5) * 3, 50)  end  #--------------------------------------------------------------------------  # * Create List Window  #--------------------------------------------------------------------------  def create_list_window    @location_list_window = Window_LocationList.new((Graphics.width / 5) * 1.5, (Graphics.height / 5) * 1)    @location_list_window.set_handler(:select, method(:command_select))  end  #--------------------------------------------------------------------------  # * Create List Window  #--------------------------------------------------------------------------  def create_confirm_window    @confirm_window = Window_ConfirmLocation.new((Graphics.width / 5), ((Graphics.height / 5) * 2) + 10)    @confirm_window.set_handler(:confirm, method(:command_confirm))    @confirm_window.set_handler(:cancel, method(:command_cancel))    @confirm_window.deactivate    @confirm_window.select(0)    @confirm_window.openness = 0  end  #--------------------------------------------------------------------------  # * Create Windows  #--------------------------------------------------------------------------  def command_select    @location_list_window.deactivate    @confirm_window.open    @confirm_window.select(0)    @confirm_window.activate  end  #--------------------------------------------------------------------------  # * Create Windows  #--------------------------------------------------------------------------  def command_confirm    $game_system.teleporting = true    return_scene  end  #--------------------------------------------------------------------------  # * Create Windows  #--------------------------------------------------------------------------  def command_cancel    @confirm_window.close    @confirm_window.select(0)    @confirm_window.deactivate    @location_list_window.activate  end  #--------------------------------------------------------------------------  # * Update Processing  #--------------------------------------------------------------------------  def update    super    case     when Input.trigger?(:      return_scene    when Input.trigger?(:UP)      $game_system.list_window_index = @location_list_window.index    when Input.trigger?(:DOWN)      $game_system.list_window_index = @location_list_window.index    end  endend
    复制代码





      end

      defCredit, Licence & Commercial Usage:
           This script is free to use for non-commercial use. If you want to obtain a license to use this script in a commercial game(contests included)
               please PM me. Credit is to be give to myself, JoePro.
      end

    end


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 09:31 , Processed in 0.116340 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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