RPG Maker Forums

Made this script on a request here.



Feature:

Allow events to be triggered when the player is On & Beside it.

Though it's a bit tricky to use, this allows developers to build traps that can be disarmed without having the player to trigger the traps first.

How to Use:

[1] Place the script below Material and above Main.

[2] Put <trap> tag in the event's name you wish to set up with 2 trigger.

      

[3] Set the event to trigger by "Player Touch" and Priority to "Below Characters"

      

[4] In the event's page, set up a conditional branch using this in the script box.

$game_map.events[@event_id].x == $game_player.x && $game_map.events[@event_id].y == $game_player.y[5] This will allow you to set up 2 trigger conditions.

       When the player walks on to the trap: trigger damage

       When the player is beside the trap and pushed a button to trigger it: trigger disarm.

Compatibility:

This script is using alias method, so it's unlikely it will cause any conflicts.

Terms of Use:

Free for use in both commercial and non-commercial.

Script:

Code:
#==============================================================================# ■ Meow Face 2 trigger type Traps#------------------------------------------------------------------------------# Allow the trap to be triggered On AND Beside the event#==============================================================================# How to Use:# [1] Plug & Play, Put this script below Material and above Main# [2] Put <trap> in the event's name you wish to have 2 trigger type#==============================================================================class Game_Event < Game_Character  attr_reader   :meowname  alias meow_name initialize  def initialize(map_id, event)    meow_name(map_id, event)    @meowname = event.name  endendclass Game_Player < Game_Character  alias meow_map start_map_event  def start_map_event(x, y, triggers, normal)      $game_map.events_xy(x, y).each do |event|        if event.trigger_in?(triggers)          return event.start if $game_map.events[event.id].meowname.include?('<trap>') && event.normal_priority? != normal        end      end    meow_map(x, y, triggers, normal)  endend

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,450
Members
137,820
Latest member
georg09byron
Top