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

[转载发布] Event triggers Event

[复制链接]
累计送礼:
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:02:37 | 显示全部楼层 |阅读模式
    Made for a request here.

    This allows an event with a name tag <eet> to trigger another event with name tag <eer> it came into collision with.

    Features:

    [1] Event triggering another Event

    [2] Able to check who triggered the event

    [3] Able to set up conditional branches to have different trigger actions depending on who triggered the event.



    (possible usage example: npc vs npc battle field)



    (possible usage example: random killer)



    (possible usage example: randomly flip switches)

    How to Use:
    [1] Paste this below Material and above Main
    [2] Add <eet> in the event's name to enable it to trigger another event.
    [3] Set trigger type to [event trigger] on the event with <eet> name tag
    [4] Add <eer> in the target event's name to enable it to be trigger-able by another event

    Note:

    Event with <eet> name tag will still be able to trigger itself when it comes into collide with the player.

    It will be counted as triggered by player.

    [5] To check if it's a player/event that triggers the event, use the script calls below in your conditional branches script box.

    Script calls for Conditional Branches:

    Check if triggered by Player:

    $game_map.events[@event_id].triggered_by == 0Check if triggered by Any Event:

    $game_map.events[@event_id].triggered_by != 0Check if triggered by Event ID N:

    $game_map.events[@event_id].triggered_by == N(where N is the event id number)



    Compatibility:

    This script overwrites the event trigger method, there might be a chance of conflict if you have another custom script overwriting the event triggers.

    Terms of Use:

    Free for both commercial and non-commercial

    Sample Map:

    Simply make a new project, add this script and extract the Map001.rvdata2 file into your Data Folder

    NPC vs NPC Battle Field with 3rd Party Medic: Map001.rar

    Demo Game:

    http://forums.rpgmakerweb.com/index.php?/topic/53887-medic-medic/

    Script:

    Spoiler#==============================================================================# ■ Meow Face Event - Event Trigger#------------------------------------------------------------------------------# Allow Event with name tag to trigger other events with name tag on collision#==============================================================================# How to Use:# [1] Paste this below Material and above Main# [2] Add <eet> in the event's name to enable it to trigger another event.# [3] Set trigger type to [event tigger] on the event with <eet> name tag# [4] Add <eer> in the target event's name to enable it to be trigger-able by another event## Script calls for Conditional Branches:#   Check If triggered by player:#     $game_map.events[@event_id].triggered_by == 0#   Check If triggered by event:#     $game_map.events[@event_id].triggered_by != 0#   Check If triggered by event id N:#     $game_map.events[@event_id].triggered_by == N (where N = event id number)#==============================================================================class Game_Player < Game_Character  def start_map_event(x, y, triggers, normal) #overwrite    return if $game_map.interpreter.running?    $game_map.events_xy(x, y).each do |event|      if event.trigger_in?(triggers) && event.normal_priority? == normal        event.triggered_by = 0        event.start      end    end  endendclass Game_Event < Game_Character  attr_reader   :meowname  attr_accessor :triggered_by  alias meow_ee_name initialize  def initialize(map_id, event)    meow_ee_name(map_id, event)    @meowname = event.name    @lock_timer = 0    @triggered_by = 0  end  def meow_lock    @locked = true    @lock_timer = 60  end  def meow_start    return if empty?    @starting = true    meow_lock if trigger_in?([2])  end  def check_event_trigger_touch(x, y) #overwrite    return if $game_map.interpreter.running?    if @trigger == 2 && $game_player.pos?(x, y)      @triggered_by = 0      start if !jumping? && normal_priority?    end    $game_map.events_xy(x, y).each do |event|      if @trigger == 2 && @event.name.include?('<eet>')        if !jumping? && normal_priority? && $game_map.events[event.id].meowname.include?('<eer>')          event.triggered_by = @event.id          event.meow_start          $game_map.events[event.id].turn_toward_character($game_map.events[@event.id]) if !@direction_fix          meow_lock        end      end    end  end  alias meow_ee_update update  def update    meow_ee_update    if @lock_timer > 0      @lock_timer -= 1      @locked = false if @lock_timer <= 0    end  endend



    Update:

    [29-Dec-2015]

    Updated to add a demo game.

    [19-Dec-2015]

    Updated the script so it can now checks who triggered the event.

    Also added a sample map for those who wish to see how the battle field is done.

    [18-Dec-2015]

    Fixed the facing problem with the triggered event <eer> so that it will be facing the triggering event <eet> properly.

    Also added a 1 second cool down timer to prevent the triggering event <eet> to spam the trigger continuously.


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

    本帖子中包含更多资源

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

    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.132439 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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