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

[转载发布] Temporarily remove a page from an event

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

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 08:41 | 显示全部楼层 |阅读模式
    Temporarily Remove Page From Event
    by Khale_Kitha

    Introduction
    Allows the designer to temporarily remove a specified page from an event.  Though the event will continue to process until it reaches it's end, this allows the designer to have parallel process pages on an event that execute once and then remove themselves until the player re-enters the map.

    How to Use
    Paste above main.
    Inside of an event page, use $game_map.events[id].remove_page(#), where id is the event id you wish to modify and # is the page on that event.

    Alternate usages:

      - You may choose to use remove_current_page to remove the currently active page on an event.  (According to find_proper_page)  Eg. $game_map.events[id].remove_current_page

      - You may also choose to simply use the code segment 'remove_current_page' from the script of an event to remove the currently active page of the event you are on.

      - There are aliases for each of the methods, as well, if you are running out of space in your script block, but they shouldn't be needed.

    Note:

    The script simply removes the page and then checks the event, again, to see which page is the next valid page.  The current page will continue to execute until it finishes and then it will not exist again, until the player re-enters the map.  This works similarly to "Erase" for an event, but it allows full functionality of an event to exist without having multiple events for one purpose.  An example of it's use will be illustrated in an upcoming tutorial, in the next few days.

    When choosing a page, pick the number listed in the UI, rather than the data page index.  I did this to make it easier on people who don't think in a 0-based indexing system to be able to wrap their head around the script.  (If you want it to be 0-based, simply remove the -1 from the script)

    Script

    Spoiler#===============================================================================
    #
    # Temporarily Remove Page From Event
    # Author: Khale_Kitha
    # Date (07/07/2013)
    # Version: (1.0.1) (VXA)
    # Level: (Easy)
    #
    #===============================================================================
    #
    # NOTES:# 1. The script simply removes the page and then checks the event, again, to see which page is the next valid page.  The current page will continue to execute until it finishes and

    # then it will not exist again, until the player re-enters the map.  This works similarly to "Erase" for an event, but it allows full functionality of an event to exist without having multiple

    # events for one purpose

    # 2.  When choosing a page, pick the number listed in the UI, rather than the data page index.  I did this to make it easier on people who don't think in a 0-based indexing system

    # to be able to wrap their head around the script.  (If you want it to be 0-based, simply remove the -1 from the script)
    #
    #===============================================================================
    #
    # Description: Allows the designer to temporarily remove a specified page from an event.
    #
    # Credits: Khale_Kitha
    #
    #===============================================================================
    #
    # Instructions
    # Paste above main.
    # Inside of an event page, use $game_map.events[id].remove_page(#), where id is the event id you wish to modify and # is the page on that event.

    # Alternate usages:

    #   - You may choose to use remove_current_page to remove the currently active page on an event.  (According to find_proper_page)  Eg. $game_map.events[id].remove_current_page

    #   - You may also choose to simply use the code segment 'remove_current_page' from the script of an event to remove the currently active page of the event you are on.

    #   - There are aliases for each of the methods, as well, if you are running out of space in your script block, but they shouldn't be needed.
    #
    #===============================================================================
    #
    # Free for any use as long as I'm credited.
    #
    class Game_Event < Game_Character
      def remove_current_page
        @event.pages.delete(@page)
        refresh
      end
     
      def remove_page(id)
        @event.pages.delete_at(id - 1)
        refresh
      end
      alias_method :rm_cur_page, :remove_current_page
      alias_method :rm_page, :remove_page
    end

    class Game_Interpreter
      def remove_current_page
        $game_map.events[event_id].remove_current_page
      end
      alias_method :rm_cur_page, :remove_current_page
    end



    FAQ
    None right now.

    Credit and Thanks
    - Khale_Kitha & Mithran
    Version Notes:

    1.0.1 - Added the ability to remove the current page of a referenced event.

             - Added the ability for an event page to remove itself.

             - Added space-saving aliases for the methods if script space is an issue.


    本贴来自国际rpgmaker官方论坛作者:Khale_Kitha处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/temporarily-remove-a-page-from-an-event.15457/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 03:50 , Processed in 0.102909 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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