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

[转载发布] Map Transfer Auto Events

[复制链接]
累计送礼:
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 10:05:22 | 显示全部楼层 |阅读模式
    Map Transfer Auto Events 1.0
    Shaz

    Introduction
    This script lets you set up event commands that should be run when entering or exiting a map, using two common events that handle ALL maps.
    Using this script, you can dispose of all the autorun or parallel process events on individual maps for "setup" or "reset" tasks, like weather, map tinting, relocating events, etc.

    Features
    - No need for parallel process events on individual maps.
    - No need to reset display (weather, tint) on multiple events or maps when exiting a map - if it's raining in a village, ONE common event will turn the rain off when you enter a building - no need to turn it off on every door or in every interior map
    - Condition setup/exit tasks based on progress in game (switches/variables) just like you'd do with a map event

    Screenshots
    In the example used here, I have an outside map where it's raining and the screen tint is normal, and an inside map where it's not raining and the screen tint is sepia.

    Spoiler







    How to Use
    Copy and paste the script into a new slot in Materials. All methods are aliased, so it can go below all other scripts.

    Create a parallel process common event for entering a map, and one for exiting a map.
    Give each common event a unique switch, and change the ENTER_MAP_SWITCH and EXIT_MAP_SWITCH constants in this script to refer to the correct switch ids.
    Add the following commands to each common event - they will be almost identical:




                    Code:       
    1. Script: jump_to_label($game_map.map_id)Comment: In case there isn't a label defined for the current map,       : jump to the end of the eventJump to Label: End<individual map commands go here>Comment: This should be run on all maps.  Turn off the switch that conditions this common eventLabel: EndControl Switches [0015: ENTER MAP] = OFF
    复制代码

    Then, in the area indicated by <individual map commands go here> above, add the following block of code for every map where you want something to happen:
     
                    Code:       
    1. Comment: The label is the map number (no leading zeros)Label: 12<add commands to be run when entering or exiting this map here>Jump to Label: End
    复制代码

    Here are the Enter Map and Exit Map common events for my sample.
    For map 12 (exterior), it makes it rain when entering the map, and stops the rain when exiting the map.
    For map 13 (interior), it changes the screen tone to sepia when entering the map, and changes it back to the default when exiting (note the longer change time when exiting - this is so it remains sepia while the screen is fading for the transfer).

    Spoiler









    Script
    Spoiler                Code:       
    1. #============================================================================# TRANSFER AUTO EVENTS# v1.0 by Shaz#----------------------------------------------------------------------------# This script allows you to call a common event whenever you leave a map or# enter a map.  This can be used to run map setup or exit commands without# needing individual events on each map.  For example, screen tint and weather# changes, event location changes, etc.#----------------------------------------------------------------------------# To Install:# Copy and paste into a new script slot in Materials.  This script aliases# existing methods, so can go below all other custom scripts.#----------------------------------------------------------------------------# To Use:# Create a parallel process common event for entering a map, and one for# exiting a map.  Allocate a unique switch for each one.# ** Change the ENTER_MAP_SWITCH and EXIT_MAP_SWITCH constants below to refer#    to the switches you are using# Add a Call Script command to the top of each common event, with the following:#    jump_to_label($game_map.map_id)# Add a Jump to Label: End command# Add a Label: End command# Add a command to turn off the switch that conditions that common event# # Between the Jump to Label: End and Label: End command, add a label for# every map where you want this to run.  The label name will be the map# number (Map023 will be Label: 23)# Add any commands you want to run when entering or exiting that map.# Add a Jump to Label: End command after every map group#----------------------------------------------------------------------------# Sample Enter Map common event (conditioned by switch 15)## Script: jump_to_label($game_map.map_id)# Comment: add a jump to end label, in case the current map is not listed# Jump to Label: End# # Comment: Entering map 12 #        : This is an outside map, and it should be raining# Label: 12# Set Weather Effects: Rain, @0, Wait# Jump to Label: End## Comment: Entering map 13#        : This is an inside map, and the screen tone should be sepia# Label: 13# Tint Screen: (34, -34, -68, 170), @1# Jump to Label: End## Comment: This should get processed for every map# Label: End# Control Switches: [0015:ENTER MAP] = OFF#----------------------------------------------------------------------------# Sample Exit Map common event (conditioned by switch 16)## Script: jump_to_label($game_map.map_id)# Comment: add a jump to end label, in case the current map is not listed# Jump to Label: End# # Comment: Exiting map 12 #        : This is an outside map and it's raining - turn the rain off# Label: 12# Set Weather Effects: None, @0, Wait# Jump to Label: End## Comment: Exiting map 13#        : This is an inside map with a sepia tone - reset the tone#        : with a delay (don't wait) so it doesn't change while fading# Label: 13# Tint Screen: (0, 0, 0, 0), @60# Jump to Label: End## Comment: This should get processed for every map# Label: End# Control Switches: [0016:EXIT MAP] = OFF#----------------------------------------------------------------------------# Terms:# Use in free or commercial games# Credit Shaz#============================================================================ENTER_MAP_SWITCH = 15EXIT_MAP_SWITCH = 16class Game_Map  alias shaz_tae_setup_events setup_events  def setup_events    $game_switches[ENTER_MAP_SWITCH] = true    shaz_tae_setup_events  endendclass Game_Player  alias shaz_tae_reserve_transfer reserve_transfer  def reserve_transfer(map_id, x, y, d = 2)    $game_switches[EXIT_MAP_SWITCH] = true if map_id != $game_map.map_id    shaz_tae_reserve_transfer(map_id, x, y, d)  endendclass Game_Interpreter  def jump_to_label(value)    @list.size.times do |i|      if @list[i].code == 118 && @list[i].parameters[0] == value.to_s        @index = i        return      end    end  endend
    复制代码





    Or download here

    FAQ


    Credit and Thanks
    - Credit Shaz
    - Okay to use in commercial games - no payment required

    Author's Notes
    I advise you to use this ONLY for things that need to be done every time you enter or leave a map. I recommend you don't use this for cutscenes that will only play once (you could, but I wouldn't).


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 12:38 , Processed in 0.116184 second(s), 59 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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